Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into hetero-dist-sampler
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarghi-nv authored Jan 10, 2025
2 parents a21e673 + a6eea2f commit 0ccf4f1
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 97 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test-results
## Python build directories & artifacts
dask-worker-space/
htmlcov
*.conda
dist/
*.egg-info/
python/build
Expand All @@ -40,9 +41,7 @@ wheels/
wheelhouse/
_skbuild/
cufile.log

## pylibcugraph build directories & artifacts
python/pylibcugraph/pylibcugraph.egg-info
*.whl

## Patching
*.diff
Expand Down Expand Up @@ -89,10 +88,7 @@ docs/cugraph/lib*
docs/cugraph/api/*

# created by Dask tests
python/dask-worker-space
python/cugraph/dask-worker-space
python/cugraph/cugraph/dask-worker-space
python/cugraph/cugraph/tests/dask-worker-space
dask-worker-space/

# Sphinx docs & build artifacts
docs/cugraph/source/api_docs/api/*
Expand Down
6 changes: 1 addition & 5 deletions benchmarks/cugraph/pytest-based/bench_algos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
# Copyright (c) 2020-2025, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -42,7 +42,6 @@ def setFixtureParamNames(*args, **kwargs):
from cugraph.structure.number_map import NumberMap
from cugraph.generators import rmat
from cugraph.testing import utils, mg_utils
from cugraph.utilities.utils import is_device_version_less_than

from cugraph_benchmarking.params import (
directed_datasets,
Expand Down Expand Up @@ -362,9 +361,6 @@ def bench_sorensen(gpubenchmark, unweighted_graph):
gpubenchmark(sorensen, G, vert_pairs)


@pytest.mark.skipif(
is_device_version_less_than((7, 0)), reason="Not supported on Pascal"
)
def bench_louvain(gpubenchmark, graph):
louvain = dask_cugraph.louvain if is_graph_distributed(graph) else cugraph.louvain
gpubenchmark(louvain, graph)
Expand Down
15 changes: 1 addition & 14 deletions ci/notebook_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,7 @@ def _get_cuda_version_string():
minor //= 10
return f"{major}.{minor}"


def _is_ampere_or_newer():
status, device_id = runtime.cudaGetDevice()
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device.")
status, device_prop = runtime.cudaGetDeviceProperties(device_id)
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device properties.")
return (device_prop.major, device_prop.minor) >= (8, 0)

cuda_version_string = _get_cuda_version_string()

parser = argparse.ArgumentParser(description="Condition for running the notebook tests")
parser.add_argument("runtype", type=str)
Expand Down Expand Up @@ -86,10 +77,6 @@ def _is_ampere_or_newer():
)
skip = True
break
elif _is_ampere_or_newer() and re.search("# Does not run on Ampere", line):
print(f"SKIPPING {filename} (does not run on Ampere)", file=sys.stderr)
skip = True
break
elif re.search("# Does not run on CUDA ", line) and (
cuda_version_string in line
):
Expand Down
11 changes: 1 addition & 10 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -eoxu pipefail

package_name=$1

python_package_name=$(echo ${package_name}|sed 's/-/_/g')

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# use 'ls' to expand wildcard before adding `[extra]` requires for pip
# pip creates wheels using python package names
python -m pip install $(ls ./dist/${python_package_name}*.whl)[test]

# Run smoke tests for aarch64 pull requests
arch=$(uname -m)
if [[ "${arch}" == "aarch64" && ${RAPIDS_BUILD_TYPE} == "pull-request" ]]; then
Expand Down
14 changes: 10 additions & 4 deletions ci/test_wheel_cugraph.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -eoxu pipefail

# Download the pylibcugraph built in the previous step
# Download the packages built in the previous step
mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-pylibcugraph-dep
python -m pip install --no-deps ./local-pylibcugraph-dep/pylibcugraph*.whl
RAPIDS_PY_WHEEL_NAME="cugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist
RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./local-pylibcugraph-dep

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install \
"$(echo ./dist/cugraph*.whl)[test]" \
./local-pylibcugraph-dep/pylibcugraph*.whl

./ci/test_wheel.sh cugraph
11 changes: 10 additions & 1 deletion ci/test_wheel_pylibcugraph.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -eoxu pipefail

# Download the packages built in the previous step
mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install \
"$(echo ./dist/pylibcugraph*.whl)[test]"

./ci/test_wheel.sh pylibcugraph
2 changes: 1 addition & 1 deletion cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function(find_and_configure_raft)
OPTIONS
"RAFT_COMPILE_LIBRARY ${PKG_COMPILE_RAFT_LIB}"
"BUILD_TESTS OFF"
"BUILD_BENCH OFF"
"BUILD_PRIMS_BENCH OFF"
"BUILD_CAGRA_HNSWLIB OFF"
)

Expand Down
10 changes: 6 additions & 4 deletions cpp/libcugraph_etl/cmake/thirdparty/get_cudf.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,9 @@ function(find_and_configure_cudf)
GIT_REPOSITORY https://github.com/${PKG_FORK}/cudf.git
GIT_TAG ${PKG_PINNED_TAG}
SOURCE_SUBDIR cpp
OPTIONS "BUILD_TESTS OFF"
OPTIONS
"BUILD_BENCHMARKS OFF"
"BUILD_TESTS OFF"
)

message(VERBOSE "CUGRAPH_ETL: Using CUDF located in ${cudf_SOURCE_DIR}")
Expand All @@ -39,8 +41,8 @@ set(CUGRAPH_ETL_BRANCH_VERSION_cudf "${CUGRAPH_ETL_VERSION_MAJOR}.${CUGRAPH_ETL_


# Change pinned tag and fork here to test a commit in CI
# To use a different RAFT locally, set the CMake variable
# RPM_cudf_SOURCE=/path/to/local/cudf
# To use a different cuDF locally, set the CMake variable
# CPM_cudf_SOURCE=/path/to/local/cudf
find_and_configure_cudf(VERSION ${CUGRAPH_ETL_MIN_VERSION_cudf}
FORK rapidsai
PINNED_TAG branch-${CUGRAPH_ETL_BRANCH_VERSION_cudf}
Expand Down
6 changes: 3 additions & 3 deletions cpp/libcugraph_etl/cmake/thirdparty/get_cugraph.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,8 +39,8 @@ set(CUGRAPH_ETL_BRANCH_VERSION_cugraph "${CUGRAPH_ETL_VERSION_MAJOR}.${CUGRAPH_E


# Change pinned tag and fork here to test a commit in CI
# To use a different RAFT locally, set the CMake variable
# RPM_cugraph_SOURCE=/path/to/local/cugraph
# To use a different cuGraph locally, set the CMake variable
# CPM_cugraph_SOURCE=/path/to/local/cugraph
find_and_configure_cugraph(VERSION ${CUGRAPH_ETL_MIN_VERSION_cugraph}
FORK rapidsai
PINNED_TAG branch-${CUGRAPH_ETL_BRANCH_VERSION_cugraph}
Expand Down
17 changes: 11 additions & 6 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ files:
- depends_on_ucx_py
- docs
- python_build_cythonize
- python_build_skbuild
- python_build_rapids
- python_build_wheel
- python_run_cugraph
Expand Down Expand Up @@ -77,6 +78,7 @@ files:
includes:
- python_build_cythonize
- python_build_rapids
- python_build_skbuild
py_rapids_build_cugraph:
output: pyproject
pyproject_dir: python/cugraph
Expand Down Expand Up @@ -121,6 +123,7 @@ files:
includes:
- python_build_cythonize
- python_build_rapids
- python_build_skbuild
py_rapids_build_pylibcugraph:
output: pyproject
pyproject_dir: python/pylibcugraph
Expand Down Expand Up @@ -370,6 +373,14 @@ dependencies:
- output_types: [conda, pyproject, requirements]
packages:
- rapids-build-backend>=0.3.1,<0.4.0.dev0
python_build_skbuild:
common:
- output_types: conda
packages:
- scikit-build-core>=0.10.0
- output_types: [requirements, pyproject]
packages:
- scikit-build-core[pyproject]>=0.10.0
python_build_wheel:
common:
- output_types: [conda, pyproject, requirements]
Expand All @@ -381,12 +392,6 @@ dependencies:
- output_types: [conda, pyproject, requirements]
packages:
- cython>=3.0.0
- output_types: conda
packages:
- scikit-build-core>=0.10.0
- output_types: [pyproject, requirements]
packages:
- scikit-build-core[pyproject]>=0.10.0
python_run_cugraph:
common:
- output_types: [conda, pyproject]
Expand Down
3 changes: 1 addition & 2 deletions python/cugraph/cugraph/traversal/ms_bfs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -56,7 +56,6 @@ def _get_feasibility(G, sources, components=None, depth_limit=None):

# Fixme not implemented in RMM yet
# using 96GB upper bound for now
# mem = get_device_memory_info()
mem = 9.6e10
n_sources = sources.size
V = G.number_of_vertices()
Expand Down
40 changes: 0 additions & 40 deletions python/cugraph/cugraph/utilities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import cudf
from cudf.core.column import as_column

from cuda.bindings import runtime

from warnings import warn

# optional dependencies
Expand Down Expand Up @@ -207,44 +205,6 @@ def get_traversed_path_list(df, id):
return answer


def is_cuda_version_less_than(min_version):
"""
Returns True if the version of CUDA being used is less than min_version
"""
status, version = runtime.getLocalRuntimeVersion()
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA runtime version.")
major = version // 1000
minor = (version % 1000) // 10
return (major, minor) < min_version


def is_device_version_less_than(min_version):
"""
Returns True if the version of CUDA being used is less than min_version
"""
status, device_id = runtime.cudaGetDevice()
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device.")
status, device_prop = runtime.cudaGetDeviceProperties(device_id)
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device properties.")
return (device_prop.major, device_prop.minor) < min_version


def get_device_memory_info():
"""
Returns the total amount of global memory on the device in bytes
"""
status, device_id = runtime.cudaGetDevice()
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device.")
status, device_prop = runtime.cudaGetDeviceProperties(device_id)
if status != runtime.cudaError_t.cudaSuccess:
raise RuntimeError("Could not get CUDA device properties.")
return device_prop.totalGlobalMem


# FIXME: if G is a Nx type, the weight attribute is assumed to be "weight", if
# set. An additional optional parameter for the weight attr name when accepting
# Nx graphs may be needed. From the Nx docs:
Expand Down

0 comments on commit 0ccf4f1

Please sign in to comment.