Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ jobs:
build_type: pull-request
script: ci/test_wheel_pylibwholegraph.sh
matrix_filter: map(select(.ARCH == "amd64"))
matrix_type: 'nightly'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matrix_type: 'nightly'

TODO: revert this. Just added here for testing, to confirm this will fix the issues we've been seeing in nightlies.

wheel-build-cugraph-pyg:
needs: checks
secrets: inherit
Expand All @@ -279,3 +280,4 @@ jobs:
build_type: pull-request
script: ci/test_wheel_cugraph-pyg.sh
matrix_filter: map(select(.ARCH == "amd64"))
matrix_type: 'nightly'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matrix_type: 'nightly'

Revert before merging.

28 changes: 28 additions & 0 deletions ci/install-torch-cuda-variant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -e -u -o pipefail

# Ensure CUDA-enabled 'torch' packages are always used.
#
# Downloading + adding the downloaded file to the constraint forces the use of this
# package, so we don't accidentally end up with a CPU-only 'torch' from 'pypi.org'
# (which can happen because --extra-index-url doesn't imply a priority).
rapids-logger "Downloading 'torch' wheel"
CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
if [[ "${CUDA_MAJOR}" == "12" ]]; then
PYTORCH_INDEX="https://download.pytorch.org/whl/cu126"
else
PYTORCH_INDEX="https://download.pytorch.org/whl/cu130"
fi

TORCH_WHEEL_DIR=$(mktemp -d)
pip download \
--prefer-binary \
--no-dps \
--constraint "${PIP_CONSTRAINT}" \
--index-url "${PYTORCH_INDEX}" \
'torch'

echo "torch @ file://$(echo ${TORCH_WHEEL_DIR}/torch_*.whl)" >> "${PIP_CONSTRAINT}"
16 changes: 9 additions & 7 deletions ci/test_wheel_cugraph-pyg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ LIBWHOLEGRAPH_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libwholegraph_${RAPIDS_PY_CUDA_
PYLIBWHOLEGRAPH_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" pylibwholegraph --stable --cuda "$RAPIDS_CUDA_VERSION")")
CUGRAPH_PYG_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-github python)

CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
# generate constraints, accounting for 'oldset' and 'latest' dependencies
rapids-dependency-file-generator \
--output requirements \
--file-key "test_cugraph_pyg" \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES};include_torch_extra_index=false" \
| tee "${PIP_CONSTRAINTS}"

if [[ "${CUDA_MAJOR}" == "12" ]]; then
PYTORCH_INDEX="https://download.pytorch.org/whl/cu126"
else
PYTORCH_INDEX="https://download.pytorch.org/whl/cu130"
fi
# ensure a CUDA variant of 'torch' is used
./install-torch-cuda-variant.sh

# notes:
#
Expand All @@ -31,7 +33,7 @@ fi
#
rapids-pip-retry install \
-v \
--extra-index-url "${PYTORCH_INDEX}" \
--constraint "${PIP_CONSTRAINT}" \
--extra-index-url 'https://pypi.nvidia.com' \
"${LIBWHOLEGRAPH_WHEELHOUSE}"/*.whl \
"$(echo "${PYLIBWHOLEGRAPH_WHEELHOUSE}"/pylibwholegraph_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)" \
Expand Down
25 changes: 13 additions & 12 deletions ci/test_wheel_pylibwholegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -e # abort the script on error
set -o pipefail # piped commands propagate their error
set -E # ERR traps are inherited by subcommands
set -e -u -o pipefail

# Delete system libnccl.so to ensure the wheel is used.
# (but only do this in CI, to avoid breaking local dev environments)
Expand All @@ -18,23 +16,26 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
LIBWHOLEGRAPH_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libwholegraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
PYLIBWHOLEGRAPH_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" pylibwholegraph --stable --cuda "$RAPIDS_CUDA_VERSION")")

# determine pytorch source
if [[ "${CUDA_MAJOR}" == "12" ]]; then
PYTORCH_INDEX="https://download.pytorch.org/whl/cu126"
else
PYTORCH_INDEX="https://download.pytorch.org/whl/cu130"
fi
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"}
mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"

# generate constraints, accounting for 'oldset' and 'latest' dependencies
rapids-dependency-file-generator \
--output requirements \
--file-key "test_pylibwholegraph" \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES};include_torch_extra_index=false" \
| tee "${PIP_CONSTRAINTS}"

# ensure a CUDA variant of 'torch' is used
./install-torch-cuda-variant.sh

# echo to expand wildcard before adding `[extra]` requires for pip
rapids-logger "Installing Packages"
rapids-pip-retry install \
--extra-index-url ${PYTORCH_INDEX} \
--constraint "${PIP_CONSTRAINT}" \
"$(echo "${PYLIBWHOLEGRAPH_WHEELHOUSE}"/pylibwholegraph*.whl)[test]" \
"${LIBWHOLEGRAPH_WHEELHOUSE}"/*.whl \
'torch>=2.3'
"${LIBWHOLEGRAPH_WHEELHOUSE}"/*.whl

rapids-logger "pytest pylibwholegraph"
cd python/pylibwholegraph/pylibwholegraph/tests
Expand Down
31 changes: 25 additions & 6 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ dependencies:
- *cmake_ver
test_python_common:
common:
- output_types: [conda]
packages:
- torchdata
- pydantic
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moving this here so depends_on_pytorch only ever contains torch / pytorch.

This test_python_common group is used everywhere that depends_on_pytorch is.

- output_types: [conda, pyproject, requirements]
packages:
- pytest<9.0.0
Expand All @@ -343,14 +347,15 @@ dependencies:
- pytest-forked
- scipy
depends_on_pytorch:
common:
- output_types: [conda]
packages:
- torchdata
- pydantic
specific:
- output_types: [requirements]
matrices:
# If 'include_torch_extra_index=false' is passed, avoid these --extra-index-url.
# (useful in CI scripts where we want to tightly which indices 'pip' uses).
- matrix:
include_torch_extra_index: "false"
packages:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rapids-dependency-file-generator uses the first matching matrix (see https://github.com/rapidsai/dependency-file-generator?tab=readme-ov-file#how-dependency-lists-are-merged).

This will only affect cases where include_torch_extra_index=false is passed (as in CI here). Other cases (like RAPIDS devcontainers) will fall through to othe groups that pull in --extra-index-url lines.

So this should not break any other uses of this file.

# otherwise, choose a CUDA-version-specific index
- matrix:
cuda: "12.*"
packages:
Expand All @@ -374,13 +379,27 @@ dependencies:
- matrix:
packages:
- *pytorch_pip
- output_types: [requirements]
matrices:
- matrix:
cuda: "12.*"
dependencies: "oldest"
packages:
- torch==2.3
- matrix:
cuda: "13.*"
dependencies: "oldset"
packages:
- torch==2.9.0
- matrix:
packages:
- output_types: [conda]
matrices:
# Prevent fallback to CPU-only pytorch when we want a CUDA variant.
- matrix:
require_gpu: "true"
packages:
- pytorch-gpu
- pytorch-gpu >=2.3
# Default to falling back to whatever 'pytorch' is pulled in via cugraph-pyg's dependencies.
- matrix:
packages:
Expand Down
Loading