Skip to content

Commit 4b9e709

Browse files
authored
Merge branch 'main' into binyli/tile-api
2 parents 72b87d9 + 4865b20 commit 4b9e709

6 files changed

Lines changed: 26 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ set_target_properties(mscclpp_static PROPERTIES VERSION ${MSCCLPP_VERSION} SOVER
8383

8484
add_subdirectory(include)
8585
add_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
9395
if (BUILD_TESTS)

include/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33

44
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp)
55
target_sources(mscclpp_obj PUBLIC FILE_SET HEADERS FILES ${HEADERS})
6-
if(NOT SKBUILD)
7-
install(TARGETS mscclpp FILE_SET HEADERS)
8-
endif()

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
14
[build-system]
25
requires = ["scikit-build-core"]
36
build-backend = "scikit_build_core.build"
@@ -9,6 +12,8 @@ version = "0.2.0"
912
[tool.scikit-build]
1013
cmake.minimum-version = "3.25.0"
1114
build-dir = "build/{wheel_tag}"
15+
wheel.packages = ["python/mscclpp"]
16+
wheel.install-dir = "mscclpp"
1217

1318
[tool.scikit-build.cmake.define]
1419
BUILD_PYTHON_BINDINGS = "ON"

python/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ include(FetchContent)
66
FetchContent_Declare(nanobind GIT_REPOSITORY https://github.com/wjakob/nanobind.git GIT_TAG v1.4.0)
77
FetchContent_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)
1212
target_link_libraries(mscclpp_py PRIVATE mscclpp_static)
1313
target_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 .)

python/core_py.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

python/mscclpp/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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")

0 commit comments

Comments
 (0)