-
Notifications
You must be signed in to change notification settings - Fork 351
introduce libcugraph wheels #4804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 63 commits
2898e78
0ecd5a5
f1645ac
6e1d3d9
3aa693c
7c55d20
c5cb53d
e73606c
fc37020
e80d566
695f627
486bf96
fce4fcf
796b54e
157f63e
4b4c4b2
e5aa3c2
089109f
881dc25
3484186
ead60e4
7dd4409
1d60712
7913278
96a7b5b
a18be8c
7f4f13b
dc7dac9
a38e5ae
3e57917
79cebbc
3a07f41
c753752
8e9fc0e
e72f55c
f924cef
c6b1d5a
ba612bd
bf8f815
1847314
740c3e9
9b0d635
4f742e5
4a9c070
2e77200
a026fc6
ffc122e
073504c
f5c8f16
f959f49
cdffb59
fbdc791
c629a4b
cce3e86
e7a2291
05e8617
8fe1d33
86c56d0
3130739
d623139
4e1265d
12a01e2
540c1a4
5573920
72978c7
5bc7523
47672c9
5b6fd89
abd6f18
96fb23a
ba73e56
2dbd946
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,29 @@ jobs: | |
| node_type: "gpu-v100-latest-1" | ||
| run_script: "ci/build_docs.sh" | ||
| sha: ${{ inputs.sha }} | ||
| wheel-build-libcugraph: | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
| build_type: ${{ inputs.build_type || 'branch' }} | ||
| branch: ${{ inputs.branch }} | ||
| sha: ${{ inputs.sha }} | ||
| date: ${{ inputs.date }} | ||
| script: ci/build_wheel_libcugraph.sh | ||
| node_type: cpu32 | ||
| wheel-publish-libcugraph: | ||
| needs: wheel-publish-libcugraph | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
| build_type: ${{ inputs.build_type || 'branch' }} | ||
| branch: ${{ inputs.branch }} | ||
| sha: ${{ inputs.sha }} | ||
| date: ${{ inputs.date }} | ||
| package-name: libcugraph | ||
| package-type: cpp | ||
| wheel-build-pylibcugraph: | ||
| needs: wheel-publish-libcugraph | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
|
|
@@ -76,7 +98,6 @@ jobs: | |
| sha: ${{ inputs.sha }} | ||
| date: ${{ inputs.date }} | ||
| script: ci/build_wheel_pylibcugraph.sh | ||
| node_type: cpu32 | ||
| wheel-publish-pylibcugraph: | ||
| needs: wheel-build-pylibcugraph | ||
| secrets: inherit | ||
|
|
@@ -87,6 +108,7 @@ jobs: | |
| sha: ${{ inputs.sha }} | ||
| date: ${{ inputs.date }} | ||
| package-name: pylibcugraph | ||
| package-type: python | ||
| wheel-build-cugraph: | ||
| needs: wheel-publish-pylibcugraph | ||
| secrets: inherit | ||
|
|
@@ -107,3 +129,4 @@ jobs: | |
| sha: ${{ inputs.sha }} | ||
| date: ${{ inputs.date }} | ||
| package-name: cugraph | ||
| package-type: cpp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,12 +23,14 @@ jobs: | |
| - conda-python-build | ||
| - conda-python-tests | ||
| - docs-build | ||
| - wheel-build-libcugraph | ||
| - wheel-build-pylibcugraph | ||
| - wheel-tests-pylibcugraph | ||
| - wheel-build-cugraph | ||
| - wheel-tests-cugraph | ||
| - telemetry-setup | ||
| - devcontainer | ||
| # TODO(jameslamb): restore 'devcontainers' job before merging | ||
| # - devcontainer | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| if: always() | ||
|
|
@@ -149,14 +151,22 @@ jobs: | |
| arch: "amd64" | ||
| container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" | ||
| run_script: "ci/build_docs.sh" | ||
| wheel-build-libcugraph: | ||
| # needs: checks | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
| # build for every combination of arch and CUDA version, but only for the latest Python | ||
| matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) | ||
| build_type: pull-request | ||
| script: ci/build_wheel_libcugraph.sh | ||
| wheel-build-pylibcugraph: | ||
| needs: checks | ||
| needs: wheel-build-libcugraph | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
| build_type: pull-request | ||
| script: ci/build_wheel_pylibcugraph.sh | ||
| node_type: cpu32 | ||
| wheel-tests-pylibcugraph: | ||
| needs: [wheel-build-pylibcugraph, changed-files] | ||
| secrets: inherit | ||
|
|
@@ -176,22 +186,24 @@ jobs: | |
| needs: [wheel-build-cugraph, changed-files] | ||
| secrets: inherit | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python | ||
| # if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python | ||
| with: | ||
| build_type: pull-request | ||
| script: ci/test_wheel_cugraph.sh | ||
| devcontainer: | ||
| secrets: inherit | ||
| needs: telemetry-setup | ||
| uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| with: | ||
| arch: '["amd64"]' | ||
| cuda: '["12.5"]' | ||
| node_type: cpu32 | ||
| build_command: | | ||
| sccache -z; | ||
| build-all --verbose -j$(nproc --ignore=1) -DBUILD_CUGRAPH_MG_TESTS=ON; | ||
| sccache -s; | ||
| # This selects "ARCH=amd64 + the latest supported Python + CUDA". | ||
| matrix_filter: map(select(.ARCH == "amd64")) | max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]) | [.] | ||
|
jameslamb marked this conversation as resolved.
Outdated
|
||
| # devcontainer: | ||
| # secrets: inherit | ||
| # # needs: telemetry-setup | ||
| # uses: rapidsai/shared-workflows/.github/workflows/[email protected] | ||
| # with: | ||
| # arch: '["amd64"]' | ||
| # cuda: '["12.5"]' | ||
| # node_type: cpu32 | ||
| # build_command: | | ||
| # sccache -z; | ||
| # build-all --verbose -j$(nproc --ignore=1) -DBUILD_CUGRAPH_MG_TESTS=ON; | ||
| # sccache -s; | ||
| telemetry-summarize: | ||
| # This job must use a self-hosted runner to record telemetry traces. | ||
| runs-on: linux-amd64-cpu4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,30 @@ | ||
| #!/bin/bash | ||
| # Copyright (c) 2023-2024, NVIDIA CORPORATION. | ||
| # Copyright (c) 2023-2025, NVIDIA CORPORATION. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| package_dir="python/cugraph" | ||
|
|
||
| RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" | ||
|
|
||
| # Download the pylibcugraph wheel built in the previous step and make it | ||
| # Download the libcugraph and pylibcugraph wheels built in the previous step and make them | ||
| # available for pip to find. | ||
| # | ||
| # ensure 'cugraph' wheel builds always use the 'pylibcugraph' just built in the same CI run | ||
| # | ||
| # using env variable PIP_CONSTRAINT is necessary to ensure the constraints | ||
| # are used when creating the isolated build environment | ||
| CPP_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 /tmp/pylibcugraph_dist) | ||
|
|
||
| echo "pylibcugraph-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${CPP_WHEELHOUSE}/pylibcugraph_*.whl)" > ./constraints.txt | ||
| LIBCUGRAPH_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libcugraph_dist) | ||
| PYLIBCUGRAPH_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python /tmp/pylibcugraph_dist) | ||
|
|
||
| # TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged | ||
| source ./ci/use_wheels_from_prs.sh | ||
|
|
||
| cat >> ./constraints.txt <<EOF | ||
| libcugraph-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUGRAPH_WHEELHOUSE}/libcugraph_*.whl) | ||
| pylibcugraph-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${PYLIBCUGRAPH_WHEELHOUSE}/pylibcugraph_*.whl) | ||
| EOF | ||
|
|
||
| # Using env variable PIP_CONSTRAINT is necessary to ensure the constraints | ||
| # are used when creating the isolated build environment. | ||
| export PIP_CONSTRAINT="${PWD}/constraints.txt" | ||
|
|
||
| PARALLEL_LEVEL=$(python -c \ | ||
| "from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))") | ||
| case "${RAPIDS_CUDA_VERSION}" in | ||
| 12.*) | ||
| EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=ON" | ||
| ;; | ||
| 11.*) | ||
| EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=OFF" | ||
| ;; | ||
| esac | ||
|
|
||
| export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF${EXTRA_CMAKE_ARGS}" | ||
| export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}" | ||
|
|
||
| ./ci/build_wheel.sh cugraph ${package_dir} | ||
| export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF" | ||
|
|
||
| ./ci/build_wheel.sh cugraph ${package_dir} python | ||
| ./ci/validate_wheel.sh ${package_dir} final_dist |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/bash | ||
| # Copyright (c) 2025, NVIDIA CORPORATION. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| package_name="libcugraph" | ||
| package_dir="python/libcugraph" | ||
|
|
||
| rapids-logger "Generating build requirements" | ||
| matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" | ||
|
|
||
| rapids-dependency-file-generator \ | ||
| --output requirements \ | ||
| --file-key "py_build_${package_name}" \ | ||
| --file-key "py_rapids_build_${package_name}" \ | ||
| --matrix "${matrix_selectors}" \ | ||
| | tee /tmp/requirements-build.txt | ||
|
|
||
| # TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged | ||
| source ./ci/use_wheels_from_prs.sh | ||
|
|
||
| rapids-logger "Installing build requirements" | ||
| python -m pip install \ | ||
| -v \ | ||
| --prefer-binary \ | ||
| -r /tmp/requirements-build.txt | ||
|
|
||
| rapids-logger "Done build requirements" | ||
|
|
||
| # build with '--no-build-isolation', for better sccache hit rate | ||
| # 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) | ||
| export PIP_NO_BUILD_ISOLATION=0 | ||
|
|
||
| RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" | ||
|
|
||
| PARALLEL_LEVEL=$(python -c \ | ||
| "from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is copied from pylibcugraph, so I want to question it a bit. Are we really limited to only 1/4 of the available cores? I am guessing it's due to memory requirements at compile time? Can we try to be more aggressive in a follow-up PR? Or can we add comments to explain why this is so limited?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Exactly, this was added back in #4489 (comment) to deal with out-of-memory issues building wheels. Since most of the heavy compilation would move to HOWEVER... maybe now that these builds aren't also compiling RAFT and since #4720 reduced the number of TUs being compiled, we could get away with a higher degree of parallelism. I'll push a change here trying to remove this limit, let's see what happens.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just pushed a changed removing this limiting of |
||
|
|
||
| case "${RAPIDS_CUDA_VERSION}" in | ||
| 12.*) | ||
| EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=ON" | ||
| ;; | ||
| 11.*) | ||
| EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=OFF" | ||
| ;; | ||
| esac | ||
|
|
||
| export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF${EXTRA_CMAKE_ARGS}" | ||
| export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}" | ||
|
|
||
| ./ci/build_wheel.sh libcugraph ${package_dir} cpp | ||
| ./ci/validate_wheel.sh ${package_dir} final_dist | ||
Uh oh!
There was an error while loading. Please reload this page.