Files
mscclpp/pyproject.toml
Binyang Li eeea00b298 Support python wheel build (#787)
## Support Python wheel build

This PR modernizes the Python packaging for MSCCL++ by defining
dependencies and optional extras in `pyproject.toml`, enabling proper
wheel builds with `pip install ".[cuda12]"`.

### Changes

**`pyproject.toml`**
- Add `dependencies` (numpy, blake3, pybind11, sortedcontainers)
- Add `optional-dependencies` for platform-specific CuPy (`cuda11`,
`cuda12`, `cuda13`, `rocm6`), `benchmark`, and `test` extras
- Bump minimum Python version from 3.8 to 3.10

**`test/deploy/setup.sh`**
- Use `pip install ".[<platform>,benchmark,test]"` instead of separate
`pip install -r requirements_*.txt` + `pip install .` steps
- Add missing CUDA 13 case

**`docs/quickstart.md`**
- Update install instructions to use extras (e.g., `pip install
".[cuda12]"`)
- Document all available extras and clarify that `rocm6` builds CuPy
from source
- Update Python version references to 3.10

**`python/csrc/CMakeLists.txt`**, **`python/test/CMakeLists.txt`**
- Update `find_package(Python)` from 3.8 to 3.10

### Notes
- The `requirements_*.txt` files are kept for Docker base image builds
where only dependencies (not the project itself) should be installed.
- CuPy is intentionally not in base dependencies — users must specify a
platform extra to get the correct pre-built wheel (or source build for
ROCm).

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 21:24:45 -07:00

68 lines
1.5 KiB
TOML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
[build-system]
requires = [
"scikit-build-core>=0.10.0",
"setuptools-scm[toml]>=8"
]
build-backend = "scikit_build_core.build"
[project]
name = "mscclpp"
dynamic = ["version"]
description = "MSCCL++ Python API"
requires-python = ">=3.10"
dependencies = [
"numpy",
"blake3",
"pybind11",
"sortedcontainers",
]
[project.optional-dependencies]
cuda11 = ["cupy-cuda11x"]
cuda12 = ["cupy-cuda12x"]
cuda13 = ["cupy-cuda13x"]
rocm6 = ["cupy"]
benchmark = [
"mpi4py",
"prettytable",
"netifaces",
"matplotlib",
]
test = [
"pytest",
"mpi4py",
"netifaces",
]
[tool.setuptools_scm]
write_to = "python/mscclpp/_version.py"
version_scheme = "no-guess-dev"
[tool.scikit-build]
cmake.version = ">=3.25.0"
cmake.build-type = "Release"
build-dir = "build/{wheel_tag}"
# Tell scikit-build-core to get version from setuptools-scm
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
[tool.scikit-build.wheel]
packages = ["python/mscclpp", "python/mscclpp_benchmark"]
install-dir = "mscclpp"
license-files = ["VERSION", "LICENSE", "CITATION.cff", "CODE_OF_CONDUCT.md", "README.md", "SECURITY.md", "SUPPORT.md"]
exclude = ["mscclpp/*.cpp"]
[tool.scikit-build.sdist]
include= ["python/mscclpp/_version.py"]
[tool.scikit-build.cmake.define]
MSCCLPP_BUILD_PYTHON_BINDINGS = "ON"
MSCCLPP_BUILD_TESTS = "OFF"
[tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'