-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Open
Description
Currently, we use a patch to remove nvidia-nccl-cu12
from the dependencies when building the CPU wheel:
xgboost/tests/buildkite/remove_nccl_dep.patch
Lines 1 to 12 in f52f11e
diff --git python-package/pyproject.toml python-package/pyproject.toml | |
index 20d3f9974..953087ff4 100644 | |
--- python-package/pyproject.toml | |
+++ python-package/pyproject.toml | |
@@ -30,7 +30,6 @@ classifiers = [ | |
dependencies = [ | |
"numpy", | |
"scipy", | |
- "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'", | |
] | |
[project.urls] |
This approach has several disadvantages:
- Fragility: Future changes to the original file may break the patch.
- Cannot accommodate multiple CUDA versions. The patch bakes in the assumption that we are only building wheels for CPU and CUDA 12 targets. What happens when we also want a wheel for CUDA 11 ?
Proposal. Use rapids-dependency-file-generator
to modify the dependencies
section in pyproject.toml
.
The tool is standalone and lightweight, and can be easily integrated in our CI/CD pipelines.
The following configuration will let us generate three variants (CPU, CUDA 11, CUDA 12):
# dependencies.yaml
files:
pyproject:
output: pyproject
pyproject_dir: python-package
matrix:
cuda: ["none", "11.8", "12.4"]
includes:
- deps
extras:
table: project
dependencies:
deps:
common:
- output_types: pyproject
packages:
- numpy
- scipy
specific:
- output_types: pyproject
matrices:
- matrix:
cuda: "11.8"
packages:
- nvidia-nccl-cu11 ; platform_system == 'Linux' and platform_machine != 'aarch64'
- matrix:
cuda: "12.4"
packages:
- nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'
# Don't add NCCL dep for CPU package
- matrix:
packages:
Command: rapids-dependency-file-generator --file-key pyproject --output pyproject --matrix cuda=12.4
cc @jameslamb
jameslamb
Metadata
Metadata
Assignees
Labels
No labels