Skip to content
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

introduce libcugraph wheels #4804

Open
wants to merge 63 commits into
base: branch-25.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2898e78
distribute libcugraph wheels
jameslamb Dec 3, 2024
0ecd5a5
exclude libcugraph.so from cugraph/pylibcugraph
jameslamb Dec 4, 2024
f1645ac
fix pr-builder
jameslamb Dec 5, 2024
6e1d3d9
remove more cugraph-ops, fix variables
jameslamb Dec 5, 2024
3aa693c
remove Python interpreter stuff
jameslamb Dec 6, 2024
7c55d20
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Dec 6, 2024
c5cb53d
temporarily raise size threshold
jameslamb Dec 6, 2024
e73606c
declare librmm dependency, fix CI dependency tree
jameslamb Dec 6, 2024
fc37020
run a subet of wheel-testing CI
jameslamb Dec 6, 2024
e80d566
skip devcontainer jobs
jameslamb Dec 6, 2024
695f627
skip 'checks' job too
jameslamb Dec 6, 2024
486bf96
just run Python 3.12 builds
jameslamb Dec 6, 2024
fce4fcf
move CUDA libs deps to wheels, ignore deprecation warning
jameslamb Dec 6, 2024
796b54e
more dependency fiddling
jameslamb Dec 6, 2024
157f63e
fix CI configs, remove unnecessary stuff from pylibcugraph CMake
jameslamb Dec 9, 2024
4b4c4b2
load libcugraph_c too
jameslamb Dec 9, 2024
e5aa3c2
merge branch-25.02
jameslamb Dec 9, 2024
089109f
fix typo
jameslamb Dec 9, 2024
881dc25
header install sort of working
jameslamb Dec 10, 2024
3484186
Merge branch 'branch-25.02' into libcugraph-wheel
nv-rliu Dec 12, 2024
ead60e4
install working (no libraft.a/libraft.so, just headers) ... export no…
jameslamb Dec 12, 2024
7dd4409
install working, exports still not quite working
jameslamb Dec 12, 2024
1d60712
remove debugging stuff
jameslamb Dec 12, 2024
7913278
merge branch-25.02
jameslamb Dec 12, 2024
96a7b5b
Merge branch 'libcugraph-wheel' of github.com:jameslamb/cugraph into …
jameslamb Dec 12, 2024
a18be8c
remove more debugging stuff
jameslamb Dec 12, 2024
7f4f13b
try adding exports back
jameslamb Dec 12, 2024
dc7dac9
use libraft wheels
jameslamb Dec 17, 2024
a38e5ae
use libraft from PR
jameslamb Dec 17, 2024
3e57917
update RAFT reference
jameslamb Dec 17, 2024
79cebbc
fix libcugraph build script
jameslamb Dec 17, 2024
3a07f41
try to fix installing libraft
jameslamb Dec 17, 2024
c753752
use constraints instead
jameslamb Dec 17, 2024
8e9fc0e
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Dec 17, 2024
e72f55c
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Dec 18, 2024
f924cef
merge branch-25.02
jameslamb Dec 20, 2024
c6b1d5a
try new libraft wheels
jameslamb Dec 20, 2024
ba612bd
merge
jameslamb Dec 20, 2024
bf8f815
merge branch-25.02
jameslamb Dec 23, 2024
1847314
remove USE_CUDA_MATH_WHEELS
jameslamb Dec 30, 2024
740c3e9
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Jan 2, 2025
9b0d635
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Jan 6, 2025
4f742e5
Merge branch 'libcugraph-wheel' of github.com:jameslamb/cugraph into …
jameslamb Jan 6, 2025
4a9c070
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Jan 7, 2025
2e77200
Merge branch 'libcugraph-wheel' of github.com:jameslamb/cugraph into …
jameslamb Jan 7, 2025
a026fc6
update copyrights, get packages from CI
jameslamb Jan 7, 2025
ffc122e
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Jan 7, 2025
073504c
merge branch-25.02
jameslamb Jan 8, 2025
f5c8f16
more changes
jameslamb Jan 8, 2025
f959f49
use dynamic libraft
jameslamb Jan 9, 2025
cdffb59
more fixes
jameslamb Jan 9, 2025
fbdc791
merge branch-25.02
jameslamb Jan 9, 2025
c629a4b
move Cython, other small changes
jameslamb Jan 9, 2025
cce3e86
clean up dependencies, other misc. fixes
jameslamb Jan 10, 2025
e7a2291
use newer raft packages
jameslamb Jan 10, 2025
05e8617
merge branch-25.02
jameslamb Jan 13, 2025
8fe1d33
updated RAFT commit
jameslamb Jan 13, 2025
86c56d0
update RAFT pin, remove more TODO comments
jameslamb Jan 14, 2025
3130739
uncomment more CI
jameslamb Jan 14, 2025
d623139
Merge branch 'branch-25.02' into libcugraph-wheel
jameslamb Jan 14, 2025
4e1265d
empty commit to re-trigger CI
jameslamb Jan 14, 2025
12a01e2
Merge branch 'libcugraph-wheel' of github.com:jameslamb/cugraph into …
jameslamb Jan 14, 2025
540c1a4
stop installing RMM
jameslamb Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -107,3 +129,4 @@ jobs:
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cugraph
package-type: cpp
44 changes: 28 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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))]) | [.]
# 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
Expand Down
7 changes: 1 addition & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Copyright (c) 2019-2025, NVIDIA CORPORATION.

# cugraph build script

Expand Down Expand Up @@ -175,11 +175,6 @@ SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}"
# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS
SKBUILD_EXTRA_CMAKE_ARGS=$(echo ${SKBUILD_EXTRA_CMAKE_ARGS} | sed 's/ /;/g')

# Append `-DFIND_CUGRAPH_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUGRAPH_CPP"* ]]; then
SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DFIND_CUGRAPH_CPP=ON"
fi

# If clean or uninstall targets given, run them prior to any other steps
if hasArg uninstall; then
if [[ "$INSTALL_PREFIX" != "" ]]; then
Expand Down
5 changes: 4 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -9,6 +9,9 @@ source rapids-configure-sccache

source rapids-date-string

# TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged
source ci/use_conda_packages_from_prs.sh

export CMAKE_GENERATOR=Ninja

rapids-print-env
Expand Down
5 changes: 4 additions & 1 deletion ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -10,6 +10,9 @@ export RAPIDS_VERSION="$(rapids-version)"
export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
export RAPIDS_VERSION_NUMBER="$RAPIDS_VERSION_MAJOR_MINOR"

# TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged
source ci/use_conda_packages_from_prs.sh

rapids-dependency-file-generator \
--output conda \
--file-key docs \
Expand Down
5 changes: 4 additions & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -9,6 +9,9 @@ source rapids-configure-sccache

source rapids-date-string

# TODO(jameslamb): remove this when https://github.com/rapidsai/raft/pull/2531 is merged
source ci/use_conda_packages_from_prs.sh

export CMAKE_GENERATOR=Ninja

rapids-print-env
Expand Down
29 changes: 23 additions & 6 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -euo pipefail

package_name=$1
package_dir=$2
package_type=$3

source rapids-configure-sccache
source rapids-date-string
Expand All @@ -29,9 +30,13 @@ python -m pip wheel \

sccache --show-adv-stats

EXCLUDE_ARGS=(
--exclude "libraft.so"
)

case "${RAPIDS_CUDA_VERSION}" in
12.*)
EXCLUDE_ARGS=(
EXCLUDE_ARGS+=(
--exclude "libcublas.so.12"
--exclude "libcublasLt.so.12"
--exclude "libcurand.so.10"
Expand All @@ -40,11 +45,23 @@ case "${RAPIDS_CUDA_VERSION}" in
--exclude "libnvJitLink.so.12"
)
;;
11.*)
EXCLUDE_ARGS=()
;;
esac

case "${package_dir}" in
python/pylibcugraph)
EXCLUDE_ARGS+=(
--exclude "libcugraph_c.so"
--exclude "libcugraph.so"
)
;;
python/cugraph)
EXCLUDE_ARGS+=(
--exclude "libcugraph_c.so"
--exclude "libcugraph.so"
)
;;
esac

mkdir -p final_dist
python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/*
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 "${package_type}" final_dist
43 changes: 18 additions & 25 deletions ci/build_wheel_cugraph.sh
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
52 changes: 52 additions & 0 deletions ci/build_wheel_libcugraph.sh
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))")

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
Loading
Loading