File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,11 +83,13 @@ set_target_properties(mscclpp_static PROPERTIES VERSION ${MSCCLPP_VERSION} SOVER
8383
8484add_subdirectory (include )
8585add_subdirectory (src )
86- install (TARGETS mscclpp mscclpp_static
87- LIBRARY DESTINATION lib
88- ARCHIVE DESTINATION lib)
8986
90- install (DIRECTORY ${PROJECT_SOURCE_DIR } /include/ DESTINATION include FILES_MATCHING PATTERN "*.hpp" )
87+ install (TARGETS mscclpp_obj
88+ FILE_SET HEADERS DESTINATION include)
89+ install (TARGETS mscclpp
90+ LIBRARY DESTINATION lib)
91+ install (TARGETS mscclpp_static
92+ ARCHIVE DESTINATION lib)
9193
9294# Tests
9395if (BUILD_TESTS)
Original file line number Diff line number Diff line change 33
44file (GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp )
55target_sources (mscclpp_obj PUBLIC FILE_SET HEADERS FILES ${HEADERS} )
6- if (NOT SKBUILD)
7- install (TARGETS mscclpp FILE_SET HEADERS)
8- endif ()
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation.
2+ # Licensed under the MIT license.
3+
14[build-system ]
25requires = [" scikit-build-core" ]
36build-backend = " scikit_build_core.build"
@@ -9,6 +12,8 @@ version = "0.2.0"
912[tool .scikit-build ]
1013cmake.minimum-version = " 3.25.0"
1114build-dir = " build/{wheel_tag}"
15+ wheel.packages = [" python/mscclpp" ]
16+ wheel.install-dir = " mscclpp"
1217
1318[tool .scikit-build .cmake .define ]
1419BUILD_PYTHON_BINDINGS = " ON"
Original file line number Diff line number Diff line change @@ -6,11 +6,9 @@ include(FetchContent)
66FetchContent_Declare (nanobind GIT_REPOSITORY https://github.com/wjakob/nanobind.git GIT_TAG v1.4.0)
77FetchContent_MakeAvailable (nanobind)
88
9- nanobind_add_module ( mscclpp_py core_py.cpp error_py.cpp proxy_channel_py .cpp fifo_py.cpp semaphore_py.cpp
10- config_py.cpp utils_py.cpp sm_channel_py.cpp )
11- set_target_properties (mscclpp_py PROPERTIES OUTPUT_NAME mscclpp )
9+ file ( GLOB_RECURSE SOURCES CONFIGURE_DEPENDS * .cpp)
10+ nanobind_add_module ( mscclpp_py ${SOURCES} )
11+ set_target_properties (mscclpp_py PROPERTIES OUTPUT_NAME _mscclpp )
1212target_link_libraries (mscclpp_py PRIVATE mscclpp_static )
1313target_include_directories (mscclpp_py PRIVATE ${CUDAToolkit_INCLUDE_DIRS} )
14- if (SKBUILD)
15- install (TARGETS mscclpp_py LIBRARY DESTINATION ${SKBUILD_PLATLIB_DIR} )
16- endif ()
14+ install (TARGETS mscclpp_py LIBRARY DESTINATION .)
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ void register_core(nb::module_& m) {
143143 .def (" setup" , &Communicator::setup);
144144}
145145
146- NB_MODULE (mscclpp , m) {
146+ NB_MODULE (_mscclpp , m) {
147147 register_error (m);
148148 register_proxy_channel (m);
149149 register_sm_channel (m);
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation.
2+ # Licensed under the MIT license.
3+
4+ from ._mscclpp import *
5+ import os as _os
6+
7+
8+ def get_include ():
9+ """Return the directory that contains the MSCCL++ headers."""
10+ return _os .path .join (_os .path .dirname (__file__ ), "include" )
You can’t perform that action at this time.
0 commit comments