diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 190003dd7af..96e491f4cb4 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -31,8 +31,5 @@ ENV PYTHONDONTWRITEBYTECODE="1"
ENV SCCACHE_REGION="us-east-2"
ENV SCCACHE_BUCKET="rapids-sccache-devs"
-ENV VAULT_HOST="https://vault.ops.k8s.rapids.ai"
+ENV AWS_ROLE_ARN="arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs"
ENV HISTFILE="/home/coder/.cache/._bash_history"
-
-# cugraph_pyg's setup.py needs this defined when building in a conda env
-ENV CUDA_HOME="${CUDA_HOME:-/home/coder/.conda/envs/$DEFAULT_CONDA_ENV}"
diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json
index 9c83535b771..f5886540252 100644
--- a/.devcontainer/cuda11.8-conda/devcontainer.json
+++ b/.devcontainer/cuda11.8-conda/devcontainer.json
@@ -5,17 +5,17 @@
"args": {
"CUDA": "11.8",
"PYTHON_PACKAGE_MANAGER": "conda",
- "BASE": "rapidsai/devcontainers:24.10-cpp-cuda11.8-mambaforge-ubuntu22.04"
+ "BASE": "rapidsai/devcontainers:24.12-cpp-cuda11.8-mambaforge-ubuntu22.04"
}
},
"runArgs": [
"--rm",
"--name",
- "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda11.8-conda"
+ "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda11.8-conda"
],
"hostRequirements": {"gpu": "optional"},
"features": {
- "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {}
+ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {}
},
"overrideFeatureInstallOrder": [
"ghcr.io/rapidsai/devcontainers/features/rapids-build-utils"
diff --git a/.devcontainer/cuda11.8-pip/devcontainer.json b/.devcontainer/cuda11.8-pip/devcontainer.json
index a559be18077..270bfa239ad 100644
--- a/.devcontainer/cuda11.8-pip/devcontainer.json
+++ b/.devcontainer/cuda11.8-pip/devcontainer.json
@@ -5,24 +5,24 @@
"args": {
"CUDA": "11.8",
"PYTHON_PACKAGE_MANAGER": "pip",
- "BASE": "rapidsai/devcontainers:24.10-cpp-cuda11.8-ucx1.15.0-openmpi-ubuntu22.04"
+ "BASE": "rapidsai/devcontainers:24.12-cpp-cuda11.8-ucx1.15.0-openmpi-ubuntu22.04"
}
},
"runArgs": [
"--rm",
"--name",
- "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda11.8-pip"
+ "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda11.8-pip"
],
"hostRequirements": {"gpu": "optional"},
"features": {
- "ghcr.io/rapidsai/devcontainers/features/cuda:24.10": {
+ "ghcr.io/rapidsai/devcontainers/features/cuda:24.12": {
"version": "11.8",
"installcuBLAS": true,
"installcuSOLVER": true,
"installcuRAND": true,
"installcuSPARSE": true
},
- "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {}
+ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {}
},
"overrideFeatureInstallOrder": [
"ghcr.io/rapidsai/devcontainers/features/cuda",
diff --git a/.devcontainer/cuda12.5-conda/devcontainer.json b/.devcontainer/cuda12.5-conda/devcontainer.json
index ca10c04edee..e31428e4b0c 100644
--- a/.devcontainer/cuda12.5-conda/devcontainer.json
+++ b/.devcontainer/cuda12.5-conda/devcontainer.json
@@ -5,17 +5,17 @@
"args": {
"CUDA": "12.5",
"PYTHON_PACKAGE_MANAGER": "conda",
- "BASE": "rapidsai/devcontainers:24.10-cpp-mambaforge-ubuntu22.04"
+ "BASE": "rapidsai/devcontainers:24.12-cpp-mambaforge-ubuntu22.04"
}
},
"runArgs": [
"--rm",
"--name",
- "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda12.5-conda"
+ "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda12.5-conda"
],
"hostRequirements": {"gpu": "optional"},
"features": {
- "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {}
+ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {}
},
"overrideFeatureInstallOrder": [
"ghcr.io/rapidsai/devcontainers/features/rapids-build-utils"
diff --git a/.devcontainer/cuda12.5-pip/devcontainer.json b/.devcontainer/cuda12.5-pip/devcontainer.json
index 6e2bf45700a..835274999ba 100644
--- a/.devcontainer/cuda12.5-pip/devcontainer.json
+++ b/.devcontainer/cuda12.5-pip/devcontainer.json
@@ -5,24 +5,24 @@
"args": {
"CUDA": "12.5",
"PYTHON_PACKAGE_MANAGER": "pip",
- "BASE": "rapidsai/devcontainers:24.10-cpp-cuda12.5-ucx1.17.0-openmpi-ubuntu22.04"
+ "BASE": "rapidsai/devcontainers:24.12-cpp-cuda12.5-ucx1.17.0-openmpi-ubuntu22.04"
}
},
"runArgs": [
"--rm",
"--name",
- "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda12.5-pip"
+ "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda12.5-pip"
],
"hostRequirements": {"gpu": "optional"},
"features": {
- "ghcr.io/rapidsai/devcontainers/features/cuda:24.10": {
+ "ghcr.io/rapidsai/devcontainers/features/cuda:24.12": {
"version": "12.5",
"installcuBLAS": true,
"installcuSOLVER": true,
"installcuRAND": true,
"installcuSPARSE": true
},
- "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {}
+ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {}
},
"overrideFeatureInstallOrder": [
"ghcr.io/rapidsai/devcontainers/features/cuda",
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index bc489ffd3f0..2962b4438fe 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -28,7 +28,7 @@ concurrency:
jobs:
cpp-build:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -38,7 +38,7 @@ jobs:
python-build:
needs: [cpp-build]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -47,7 +47,7 @@ jobs:
upload-conda:
needs: [cpp-build, python-build]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -57,7 +57,7 @@ jobs:
if: github.ref_type == 'branch'
needs: python-build
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12
with:
arch: "amd64"
branch: ${{ inputs.branch }}
@@ -69,7 +69,7 @@ jobs:
sha: ${{ inputs.sha }}
wheel-build-pylibcugraph:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -77,13 +77,13 @@ jobs:
date: ${{ inputs.date }}
script: ci/build_wheel_pylibcugraph.sh
extra-repo: rapidsai/cugraph-ops
- extra-repo-sha: branch-24.10
+ extra-repo-sha: branch-24.12
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
node_type: cpu32
wheel-publish-pylibcugraph:
needs: wheel-build-pylibcugraph
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -93,7 +93,7 @@ jobs:
wheel-build-cugraph:
needs: wheel-publish-pylibcugraph
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
@@ -101,94 +101,15 @@ jobs:
date: ${{ inputs.date }}
script: ci/build_wheel_cugraph.sh
extra-repo: rapidsai/cugraph-ops
- extra-repo-sha: branch-24.10
+ extra-repo-sha: branch-24.12
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
wheel-publish-cugraph:
needs: wheel-build-cugraph
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cugraph
- wheel-build-nx-cugraph:
- needs: wheel-publish-pylibcugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- script: ci/build_wheel_nx-cugraph.sh
- wheel-publish-nx-cugraph:
- needs: wheel-build-nx-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- package-name: nx-cugraph
- wheel-build-cugraph-dgl:
- needs: wheel-publish-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- script: ci/build_wheel_cugraph-dgl.sh
- wheel-publish-cugraph-dgl:
- needs: wheel-build-cugraph-dgl
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- package-name: cugraph-dgl
- wheel-build-cugraph-pyg:
- needs: wheel-publish-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- script: ci/build_wheel_cugraph-pyg.sh
- wheel-publish-cugraph-pyg:
- needs: wheel-build-cugraph-pyg
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- package-name: cugraph-pyg
- wheel-build-cugraph-equivariant:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- script: ci/build_wheel_cugraph-equivariant.sh
- wheel-publish-cugraph-equivariant:
- needs: wheel-build-cugraph-equivariant
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10
- with:
- build_type: ${{ inputs.build_type || 'branch' }}
- branch: ${{ inputs.branch }}
- sha: ${{ inputs.sha }}
- date: ${{ inputs.date }}
- package-name: cugraph-equivariant
diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index dacd9a93399..c8bf94b0987 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -10,8 +10,10 @@ concurrency:
cancel-in-progress: true
jobs:
+ # Please keep pr-builder as the top job here
pr-builder:
needs:
+ - changed-files
- checks
- conda-cpp-build
- conda-cpp-tests
@@ -24,39 +26,77 @@ jobs:
- wheel-tests-pylibcugraph
- wheel-build-cugraph
- wheel-tests-cugraph
- - wheel-build-nx-cugraph
- - wheel-tests-nx-cugraph
- - wheel-build-cugraph-dgl
- - wheel-tests-cugraph-dgl
- - wheel-build-cugraph-pyg
- - wheel-tests-cugraph-pyg
- - wheel-build-cugraph-equivariant
- - wheel-tests-cugraph-equivariant
+ - telemetry-setup
- devcontainer
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12
+ if: always()
+ with:
+ needs: ${{ toJSON(needs) }}
+ telemetry-setup:
+ runs-on: ubuntu-latest
+ continue-on-error: true
+ env:
+ OTEL_SERVICE_NAME: "pr-cugraph"
+ steps:
+ - name: Telemetry setup
+ uses: rapidsai/shared-actions/telemetry-dispatch-stash-base-env-vars@main
+ changed-files:
+ secrets: inherit
+ needs: telemetry-setup
+ uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12
+ with:
+ files_yaml: |
+ test_cpp:
+ - '**'
+ - '!.devcontainers/**'
+ - '!CONTRIBUTING.md'
+ - '!README.md'
+ - '!docs/**'
+ - '!img/**'
+ - '!mg_utils/**'
+ - '!notebooks/**'
+ - '!python/**'
+ - '!readme_pages/**'
+ test_notebooks:
+ - '**'
+ - '!.devcontainers/**'
+ - '!CONTRIBUTING.md'
+ - '!README.md'
+ - '!docs/**'
+ test_python:
+ - '**'
+ - '!.devcontainers/**'
+ - '!CONTRIBUTING.md'
+ - '!README.md'
+ - '!docs/**'
+ - '!img/**'
+ - '!notebooks/**'
checks:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.10
+ needs: telemetry-setup
+ uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12
with:
enable_check_generated_files: false
+ ignored_pr_jobs: telemetry-summarize
conda-cpp-build:
needs: checks
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12
with:
build_type: pull-request
node_type: cpu32
conda-cpp-tests:
- needs: conda-cpp-build
+ needs: [conda-cpp-build, changed-files]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12
+ if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
conda-cpp-checks:
needs: conda-cpp-build
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12
with:
build_type: pull-request
enable_check_symbols: true
@@ -64,19 +104,21 @@ jobs:
conda-python-build:
needs: conda-cpp-build
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12
with:
build_type: pull-request
conda-python-tests:
- needs: conda-python-build
+ needs: [conda-python-build, changed-files]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12
+ if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
conda-notebook-tests:
- needs: conda-python-build
+ needs: [conda-python-build, changed-files]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12
+ if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
@@ -86,7 +128,7 @@ jobs:
docs-build:
needs: conda-python-build
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
@@ -96,99 +138,44 @@ jobs:
wheel-build-pylibcugraph:
needs: checks
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: pull-request
script: ci/build_wheel_pylibcugraph.sh
extra-repo: rapidsai/cugraph-ops
- extra-repo-sha: branch-24.10
+ extra-repo-sha: branch-24.12
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
node_type: cpu32
wheel-tests-pylibcugraph:
- needs: wheel-build-pylibcugraph
+ needs: [wheel-build-pylibcugraph, changed-files]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
+ if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
script: ci/test_wheel_pylibcugraph.sh
wheel-build-cugraph:
needs: wheel-tests-pylibcugraph
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: pull-request
script: ci/build_wheel_cugraph.sh
extra-repo: rapidsai/cugraph-ops
- extra-repo-sha: branch-24.10
+ extra-repo-sha: branch-24.12
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
wheel-tests-cugraph:
- needs: wheel-build-cugraph
+ needs: [wheel-build-cugraph, changed-files]
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
+ if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
script: ci/test_wheel_cugraph.sh
- wheel-build-nx-cugraph:
- needs: wheel-tests-pylibcugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/build_wheel_nx-cugraph.sh
- wheel-tests-nx-cugraph:
- needs: wheel-build-nx-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/test_wheel_nx-cugraph.sh
- wheel-build-cugraph-dgl:
- needs: wheel-tests-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/build_wheel_cugraph-dgl.sh
- wheel-tests-cugraph-dgl:
- needs: wheel-build-cugraph-dgl
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/test_wheel_cugraph-dgl.sh
- matrix_filter: map(select(.ARCH == "amd64"))
- wheel-build-cugraph-pyg:
- needs: wheel-tests-cugraph
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/build_wheel_cugraph-pyg.sh
- wheel-tests-cugraph-pyg:
- needs: wheel-build-cugraph-pyg
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/test_wheel_cugraph-pyg.sh
- matrix_filter: map(select(.ARCH == "amd64"))
- wheel-build-cugraph-equivariant:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/build_wheel_cugraph-equivariant.sh
- wheel-tests-cugraph-equivariant:
- needs: wheel-build-cugraph-equivariant
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: pull-request
- script: ci/test_wheel_cugraph-equivariant.sh
- matrix_filter: map(select(.ARCH == "amd64"))
devcontainer:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.10
+ needs: telemetry-setup
+ uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12
with:
arch: '["amd64"]'
cuda: '["12.5"]'
@@ -198,3 +185,17 @@ jobs:
sccache -z;
build-all --verbose -j$(nproc --ignore=1) -DBUILD_CUGRAPH_MG_TESTS=ON;
sccache -s;
+ telemetry-summarize:
+ runs-on: ubuntu-latest
+ needs: pr-builder
+ if: always()
+ continue-on-error: true
+ steps:
+ - name: Load stashed telemetry env vars
+ uses: rapidsai/shared-actions/telemetry-dispatch-load-base-env-vars@main
+ with:
+ load_service_name: true
+ - name: Telemetry summarize
+ uses: rapidsai/shared-actions/telemetry-dispatch-write-summary@main
+ with:
+ cert_concat: "${{ secrets.OTEL_EXPORTER_OTLP_CA_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE }};${{ secrets.OTEL_EXPORTER_OTLP_CLIENT_KEY }}"
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 957d29ce72b..72f76904f4b 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -16,7 +16,7 @@ on:
jobs:
conda-cpp-checks:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
@@ -26,7 +26,7 @@ jobs:
symbol_exclusions: (cugraph::ops|hornet|void writeEdgeCountsKernel|void markUniqueOffsetsKernel)
conda-cpp-tests:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
@@ -34,7 +34,7 @@ jobs:
sha: ${{ inputs.sha }}
conda-python-tests:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
@@ -42,7 +42,7 @@ jobs:
sha: ${{ inputs.sha }}
wheel-tests-pylibcugraph:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
@@ -51,49 +51,10 @@ jobs:
script: ci/test_wheel_pylibcugraph.sh
wheel-tests-cugraph:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/test_wheel_cugraph.sh
- wheel-tests-nx-cugraph:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: nightly
- branch: ${{ inputs.branch }}
- date: ${{ inputs.date }}
- sha: ${{ inputs.sha }}
- script: ci/test_wheel_nx-cugraph.sh
- wheel-tests-cugraph-dgl:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: nightly
- branch: ${{ inputs.branch }}
- date: ${{ inputs.date }}
- sha: ${{ inputs.sha }}
- script: ci/test_wheel_cugraph-dgl.sh
- matrix_filter: map(select(.ARCH == "amd64"))
- wheel-tests-cugraph-pyg:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: nightly
- branch: ${{ inputs.branch }}
- date: ${{ inputs.date }}
- sha: ${{ inputs.sha }}
- script: ci/test_wheel_cugraph-pyg.sh
- matrix_filter: map(select(.ARCH == "amd64"))
- wheel-tests-cugraph-equivariant:
- secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10
- with:
- build_type: nightly
- branch: ${{ inputs.branch }}
- date: ${{ inputs.date }}
- sha: ${{ inputs.sha }}
- script: ci/test_wheel_cugraph-equivariant.sh
- matrix_filter: map(select(.ARCH == "amd64"))
diff --git a/.gitignore b/.gitignore
index 2fea1022910..9480c2618bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -78,9 +78,6 @@ datasets/*
!datasets/karate-disjoint.csv
!datasets/netscience.csv
-# nx-cugraph side effects
-python/nx-cugraph/objects.inv
-
.pydevproject
# Jupyter Notebooks
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b65faff9dfc..f1e83aa6a83 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -19,7 +19,6 @@ repos:
language_version: python3
args: [--target-version=py310]
files: ^(python/.*|benchmarks/.*)$
- exclude: ^python/nx-cugraph/
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
@@ -55,28 +54,13 @@ repos:
setup[.]cfg$
- id: verify-alpha-spec
args: ["--fix", "--mode=release"]
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
+ rev: v1.0.0
+ hooks:
+ - id: sphinx-lint
+ args: ["--enable=all", "--disable=line-too-long"]
- repo: https://github.com/rapidsai/dependency-file-generator
- rev: v1.13.11
+ rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
- - repo: local
- hooks:
- - id: nx-cugraph-meta-data-update
- name: nx-cugraph meta-data updater
- entry: bash -c "PYTHONPATH=./python/nx-cugraph python ./python/nx-cugraph/_nx_cugraph/__init__.py"
- files: ^python/nx-cugraph/
- types: [python]
- language: python
- pass_filenames: false
- additional_dependencies: ["networkx>=3.3"]
- - repo: local
- hooks:
- - id: nx-cugraph-readme-update
- name: nx-cugraph README updater
- entry: bash -c "PYTHONPATH=./python/nx-cugraph python ./python/nx-cugraph/scripts/update_readme.py ./python/nx-cugraph/README.md"
- files: ^python/nx-cugraph/
- types_or: [python, markdown]
- language: python
- pass_filenames: false
- additional_dependencies: ["networkx>=3.3"]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aea1fc015e5..6f153a9f8cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,79 @@
+# cugraph 24.12.00 (11 Dec 2024)
+
+## 🚨 Breaking Changes
+
+- Fix SSL Error ([#4825](https://github.com/rapidsai/cugraph/pull/4825)) [@nv-rliu](https://github.com/nv-rliu)
+- [BUG] Set Max PyTorch Version, Skip 11.4 Tests Using WholeGraph ([#4808](https://github.com/rapidsai/cugraph/pull/4808)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Remove GNN Packages ([#4765](https://github.com/rapidsai/cugraph/pull/4765)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- remove cugraph-dgl and cugraph-pyg building/testing/publishing ([#4752](https://github.com/rapidsai/cugraph/pull/4752)) [@jameslamb](https://github.com/jameslamb)
+- Remove `nx-cugraph` build/test/publish from cugraph ([#4748](https://github.com/rapidsai/cugraph/pull/4748)) [@nv-rliu](https://github.com/nv-rliu)
+- Remove CMake/C++ references to cugraph-ops ([#4744](https://github.com/rapidsai/cugraph/pull/4744)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Delete the deprecated data_type_id_t enum ([#4737](https://github.com/rapidsai/cugraph/pull/4737)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Don't compile int32_t/int64_t vertex_t/edge_t combinations ([#4720](https://github.com/rapidsai/cugraph/pull/4720)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Remove deprecated C API functions for graph creation/graph free ([#4718](https://github.com/rapidsai/cugraph/pull/4718)) [@ChuckHastings](https://github.com/ChuckHastings)
+
+## 🐛 Bug Fixes
+
+- Fix SSL Error ([#4825](https://github.com/rapidsai/cugraph/pull/4825)) [@nv-rliu](https://github.com/nv-rliu)
+- [BUG] Set Max PyTorch Version, Skip 11.4 Tests Using WholeGraph ([#4808](https://github.com/rapidsai/cugraph/pull/4808)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Fix CCCL 2.7.0-rc2 compile issue by removing reference from values. ([#4799](https://github.com/rapidsai/cugraph/pull/4799)) [@bdice](https://github.com/bdice)
+- Re-enable balanced edge cut test ([#4781](https://github.com/rapidsai/cugraph/pull/4781)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Fix debug build failure ([#4774](https://github.com/rapidsai/cugraph/pull/4774)) [@seunghwak](https://github.com/seunghwak)
+- Add sphinx-lint pre-commit and some docs fixes ([#4771](https://github.com/rapidsai/cugraph/pull/4771)) [@eriknw](https://github.com/eriknw)
+- Fix improper initialization of degree_type ([#4755](https://github.com/rapidsai/cugraph/pull/4755)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Put a ceiling on cuda-python ([#4747](https://github.com/rapidsai/cugraph/pull/4747)) [@bdice](https://github.com/bdice)
+- Fix MG similarity issues ([#4741](https://github.com/rapidsai/cugraph/pull/4741)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Address Leiden clustering generating too many clusters ([#4730](https://github.com/rapidsai/cugraph/pull/4730)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Add support for storing results for all k-values ([#4728](https://github.com/rapidsai/cugraph/pull/4728)) [@nv-rliu](https://github.com/nv-rliu)
+- Remove `--collect-only` Option Left by Accident ([#4727](https://github.com/rapidsai/cugraph/pull/4727)) [@nv-rliu](https://github.com/nv-rliu)
+- Update nx-cugraph to NetworkX 3.4 ([#4717](https://github.com/rapidsai/cugraph/pull/4717)) [@eriknw](https://github.com/eriknw)
+- Symmetrize edgelist when creating a CSR graph ([#4716](https://github.com/rapidsai/cugraph/pull/4716)) [@jnke2016](https://github.com/jnke2016)
+
+## 📖 Documentation
+
+- nx-cugraph: add `bipartite_betweenness_centrality` to supported algorithms ([#4778](https://github.com/rapidsai/cugraph/pull/4778)) [@eriknw](https://github.com/eriknw)
+- Notebook to run Centrality against PatentsView data for Medium Blog ([#4769](https://github.com/rapidsai/cugraph/pull/4769)) [@acostadon](https://github.com/acostadon)
+- Drop support for NetworkX 3.0 and 3.1 for nx-cugraph ([#4766](https://github.com/rapidsai/cugraph/pull/4766)) [@eriknw](https://github.com/eriknw)
+- Update nx-cugraph Docs URLs ([#4761](https://github.com/rapidsai/cugraph/pull/4761)) [@nv-rliu](https://github.com/nv-rliu)
+- Update `nx-cugraph` README with New Env Variable ([#4705](https://github.com/rapidsai/cugraph/pull/4705)) [@nv-rliu](https://github.com/nv-rliu)
+
+## 🚀 New Features
+
+- [FEA] Support Edge ID Lookup in PyLibcuGraph ([#4687](https://github.com/rapidsai/cugraph/pull/4687)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+
+## 🛠️ Improvements
+
+- Increase max_iterations in MG HITS TEST ([#4783](https://github.com/rapidsai/cugraph/pull/4783)) [@seunghwak](https://github.com/seunghwak)
+- Updates READMEs, updates `core_number` to properly ignore `degree_type`, minor cleanup ([#4776](https://github.com/rapidsai/cugraph/pull/4776)) [@rlratzel](https://github.com/rlratzel)
+- Remove edge renumber map from the homogeneous sampling API ([#4775](https://github.com/rapidsai/cugraph/pull/4775)) [@jnke2016](https://github.com/jnke2016)
+- Remove GNN Packages ([#4765](https://github.com/rapidsai/cugraph/pull/4765)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Remove cugraph-equivariance ([#4762](https://github.com/rapidsai/cugraph/pull/4762)) [@BradReesWork](https://github.com/BradReesWork)
+- deprecate NetworkX Graph as input ([#4759](https://github.com/rapidsai/cugraph/pull/4759)) [@BradReesWork](https://github.com/BradReesWork)
+- Remove `nx-cugraph` from this repo ([#4756](https://github.com/rapidsai/cugraph/pull/4756)) [@eriknw](https://github.com/eriknw)
+- enforce wheel size limits, README formatting in CI ([#4754](https://github.com/rapidsai/cugraph/pull/4754)) [@jameslamb](https://github.com/jameslamb)
+- remove cugraph-dgl and cugraph-pyg building/testing/publishing ([#4752](https://github.com/rapidsai/cugraph/pull/4752)) [@jameslamb](https://github.com/jameslamb)
+- Primitives & BFS performance improvements ([#4751](https://github.com/rapidsai/cugraph/pull/4751)) [@seunghwak](https://github.com/seunghwak)
+- extract the edgelist from the graph ([#4750](https://github.com/rapidsai/cugraph/pull/4750)) [@jnke2016](https://github.com/jnke2016)
+- Remove `nx-cugraph` build/test/publish from cugraph ([#4748](https://github.com/rapidsai/cugraph/pull/4748)) [@nv-rliu](https://github.com/nv-rliu)
+- Remove CMake/C++ references to cugraph-ops ([#4744](https://github.com/rapidsai/cugraph/pull/4744)) [@ChuckHastings](https://github.com/ChuckHastings)
+- add telemetry ([#4740](https://github.com/rapidsai/cugraph/pull/4740)) [@msarahan](https://github.com/msarahan)
+- Delete the deprecated data_type_id_t enum ([#4737](https://github.com/rapidsai/cugraph/pull/4737)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Updates README with new dataset, removes mention of script no longer used ([#4736](https://github.com/rapidsai/cugraph/pull/4736)) [@rlratzel](https://github.com/rlratzel)
+- devcontainer: replace `VAULT_HOST` with `AWS_ROLE_ARN` ([#4732](https://github.com/rapidsai/cugraph/pull/4732)) [@jjacobelli](https://github.com/jjacobelli)
+- Adds new dataset for benchmarking in the 100k node 1M edge range, adds additional k-values for BC benchmarks ([#4726](https://github.com/rapidsai/cugraph/pull/4726)) [@rlratzel](https://github.com/rlratzel)
+- re-run all CI when files in .github/workflows change ([#4723](https://github.com/rapidsai/cugraph/pull/4723)) [@jameslamb](https://github.com/jameslamb)
+- Don't compile int32_t/int64_t vertex_t/edge_t combinations ([#4720](https://github.com/rapidsai/cugraph/pull/4720)) [@ChuckHastings](https://github.com/ChuckHastings)
+- print sccache stats in builds ([#4719](https://github.com/rapidsai/cugraph/pull/4719)) [@jameslamb](https://github.com/jameslamb)
+- Remove deprecated C API functions for graph creation/graph free ([#4718](https://github.com/rapidsai/cugraph/pull/4718)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Clean up the use of cuco hash functions ([#4707](https://github.com/rapidsai/cugraph/pull/4707)) [@PointKernel](https://github.com/PointKernel)
+- Relax PyTorch upper bound (allowing 2.4) ([#4703](https://github.com/rapidsai/cugraph/pull/4703)) [@jakirkham](https://github.com/jakirkham)
+- combine pip install calls in wheel-testing scripts ([#4701](https://github.com/rapidsai/cugraph/pull/4701)) [@jameslamb](https://github.com/jameslamb)
+- Merge branch-24.10 into branch-24.12 ([#4697](https://github.com/rapidsai/cugraph/pull/4697)) [@jameslamb](https://github.com/jameslamb)
+- Merge branch-24.10 into branch-24.12 ([#4682](https://github.com/rapidsai/cugraph/pull/4682)) [@jameslamb](https://github.com/jameslamb)
+- Update all rmm imports to use pylibrmm/librmm ([#4671](https://github.com/rapidsai/cugraph/pull/4671)) [@Matt711](https://github.com/Matt711)
+- Prune workflows based on changed files ([#4634](https://github.com/rapidsai/cugraph/pull/4634)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+- support heterogenous fanout type ([#4608](https://github.com/rapidsai/cugraph/pull/4608)) [@jnke2016](https://github.com/jnke2016)
+
# cugraph 24.10.00 (9 Oct 2024)
## 🚨 Breaking Changes
diff --git a/README.md b/README.md
index 8026e4feb64..f77b5702f71 100644
--- a/README.md
+++ b/README.md
@@ -34,16 +34,6 @@
------
-## News
-
-___NEW!___ _[nx-cugraph](./python/nx-cugraph/README.md)_, a NetworkX backend that provides GPU acceleration to NetworkX with zero code change.
-```
-> pip install nx-cugraph-cu11 --extra-index-url https://pypi.nvidia.com
-> export NETWORKX_AUTOMATIC_BACKENDS=cugraph
-```
-That's it. NetworkX now leverages cuGraph for accelerated graph algorithms.
-
-----
## Table of contents
@@ -62,9 +52,8 @@ That's it. NetworkX now leverages cuGraph for accelerated graph algorithms.
- [External Data Types](./readme_pages/data_types.md)
- [pylibcugraph](./readme_pages/pylibcugraph.md)
- [libcugraph (C/C++/CUDA)](./readme_pages/libcugraph.md)
- - [nx-cugraph](./python/nx-cugraph/README.md)
+ - [nx-cugraph](https://rapids.ai/nx-cugraph/)
- [cugraph-service](./readme_pages/cugraph_service.md)
- - [cugraph-dgl](./readme_pages/cugraph_dgl.md)
- [cugraph-ops](./readme_pages/cugraph_ops.md)
- API Docs
- Python
@@ -127,7 +116,7 @@ df_page.sort_values('pagerank', ascending=False).head(10)
* ArangoDB - a free and open-source native multi-model database system - https://www.arangodb.com/
* CuPy - "NumPy/SciPy-compatible Array Library for GPU-accelerated Computing with Python" - https://cupy.dev/
* Memgraph - In-memory Graph database - https://memgraph.com/
-* NetworkX (via [nx-cugraph](./python/nx-cugraph/README.md) backend) - an extremely popular, free and open-source package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks - https://networkx.org/
+* NetworkX (via [nx-cugraph](https://rapids.ai/nx-cugraph/) backend) - an extremely popular, free and open-source package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks - https://networkx.org/
* PyGraphistry - free and open-source GPU graph ETL, AI, and visualization, including native RAPIDS & cuGraph support - http://github.com/graphistry/pygraphistry
* ScanPy - a scalable toolkit for analyzing single-cell gene expression data - https://scanpy.readthedocs.io/en/stable/
diff --git a/VERSION b/VERSION
index 7c7ba04436f..af28c42b528 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-24.10.00
+24.12.00
diff --git a/benchmarks/nx-cugraph/pytest-based/README.md b/benchmarks/nx-cugraph/pytest-based/README.md
deleted file mode 100644
index 781550fa560..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-## `nx-cugraph` Benchmarks
-
-### Overview
-
-This directory contains a set of scripts designed to benchmark NetworkX with the `nx-cugraph` backend and deliver a report that summarizes the speed-up and runtime deltas over default NetworkX.
-
-Our current benchmarks provide the following datasets:
-
-| Dataset | Nodes | Edges | Directed |
-| -------- | ------- | ------- | ------- |
-| netscience | 1,461 | 5,484 | Yes |
-| email-Eu-core | 1,005 | 25,571 | Yes |
-| cit-Patents | 3,774,768 | 16,518,948 | Yes |
-| hollywood | 1,139,905 | 57,515,616 | No |
-| soc-LiveJournal1 | 4,847,571 | 68,993,773 | Yes |
-
-
-
-### Scripts
-
-#### 1. `run-main-benchmarks.sh`
-This script allows users to run a small set of commonly-used algorithms across multiple datasets and backends. All results are stored inside a sub-directory (`logs/`) and output files are named based on the combination of parameters for that benchmark.
-
-NOTE: If running with all algorithms and datasets using NetworkX without an accelerated backend, this script may take a few hours to finish running.
-
-**Usage:**
- - Run with `--cpu-only`:
- ```bash
- ./run-main-benchmarks.sh --cpu-only
- ```
- - Run with `--gpu-only`:
- ```bash
- ./run-main-benchmarks.sh --gpu-only
- ```
- - Run without any arguments (all backends):
- ```bash
- ./run-main-benchmarks.sh
- ```
-
-#### 2. `get_graph_bench_dataset.py`
-This script downloads the specified dataset using `cugraph.datasets`.
-
-**Usage:**
- ```bash
- python get_graph_bench_dataset.py [dataset]
- ```
-
-#### 3. `create_results_summary_page.py`
-This script is designed to be run after `run-gap-benchmarks.sh` in order to generate an HTML page displaying a results table comparing default NetworkX to nx-cugraph. The script also provides information about the current system, so it should be run on the machine on which benchmarks were run.
-
-**Usage:**
- ```bash
- python create_results_summary_page.py > report.html
- ```
diff --git a/benchmarks/nx-cugraph/pytest-based/bench_algos.py b/benchmarks/nx-cugraph/pytest-based/bench_algos.py
deleted file mode 100644
index f88d93c3f17..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/bench_algos.py
+++ /dev/null
@@ -1,962 +0,0 @@
-# Copyright (c) 2023-2024, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import random
-
-import networkx as nx
-import pandas as pd
-import pytest
-from cugraph import datasets
-import nx_cugraph as nxcg
-
-# Attempt to import the NetworkX dispatching module, which is only needed when
-# testing with NX <3.2 in order to dynamically switch backends. NX >=3.2 allows
-# the backend to be specified directly in the API call.
-try:
- from networkx.classes import backends # NX <3.2
-except ImportError:
- backends = None
-
-
-################################################################################
-# Fixtures and params
-
-# See https://pytest-benchmark.readthedocs.io/en/latest/glossary.html for how
-# these variables are used.
-rounds = 1
-iterations = 1
-warmup_rounds = 1
-
-dataset_param_values = [
- # name: karate, nodes: 34, edges: 156
- pytest.param(datasets.karate, marks=[pytest.mark.small, pytest.mark.undirected]),
- # name: netscience, nodes: 1461, edges: 5484
- pytest.param(datasets.netscience, marks=[pytest.mark.small, pytest.mark.directed]),
- # name: email-Eu-core, nodes: 1005, edges: 25571
- pytest.param(
- datasets.email_Eu_core, marks=[pytest.mark.small, pytest.mark.directed]
- ),
- # name: cit-Patents, nodes: 3774768, edges: 16518948
- pytest.param(
- datasets.cit_patents, marks=[pytest.mark.medium, pytest.mark.directed]
- ),
- # name: hollywood, nodes: 1139905, edges: 57515616
- pytest.param(
- datasets.hollywood, marks=[pytest.mark.medium, pytest.mark.undirected]
- ),
- # name: soc-LiveJournal1, nodes: 4847571, edges: 68993773
- pytest.param(
- datasets.soc_livejournal, marks=[pytest.mark.medium, pytest.mark.directed]
- ),
- # name: europe_osm, nodes: 50912018, edges: 54054660
- pytest.param(
- datasets.europe_osm, marks=[pytest.mark.large, pytest.mark.undirected]
- ),
-]
-
-backend_param_values = ["cugraph", "cugraph-preconverted", None]
-
-
-def setup_module(module):
- """
- Trivial conversion call to force various one-time CUDA initialization
- operations to happen outside of benchmarks.
- """
- G = nx.karate_club_graph()
- nxcg.from_networkx(G)
-
-
-# Test IDs are generated using the lambda assigned to the ids arg to provide an
-# easier-to-read name. This is especially helpful for Dataset objs (see
-# https://docs.pytest.org/en/stable/reference/reference.html#pytest-fixture)
-@pytest.fixture(
- scope="module", params=dataset_param_values, ids=lambda ds: f"ds={str(ds)}"
-)
-def graph_obj(request):
- """
- Returns a NX Graph or DiGraph obj from the dataset instance parameter.
- """
- dataset = request.param
- return nx_graph_from_dataset(dataset)
-
-
-@pytest.fixture(
- scope="module",
- params=backend_param_values,
- ids=lambda backend: f"backend={backend}",
-)
-def backend(request):
- """
- Returns the backend name to use. This is done as a fixture for consistency
- and simplicity when creating benchmarks (no need to mark the benchmark as
- parametrized).
- """
- return request.param
-
-
-################################################################################
-# Helpers
-def nx_graph_from_dataset(dataset_obj):
- """
- Read the dataset specified by the dataset_obj and create and return a
- nx.Graph or nx.DiGraph instance based on the dataset is_directed metadata.
- """
- create_using = nx.DiGraph if dataset_obj.metadata["is_directed"] else nx.Graph
- names = dataset_obj.metadata["col_names"]
- dtypes = dataset_obj.metadata["col_types"]
- if isinstance(dataset_obj.metadata["header"], int):
- header = dataset_obj.metadata["header"]
- else:
- header = None
-
- pandas_edgelist = pd.read_csv(
- dataset_obj.get_path(),
- delimiter=dataset_obj.metadata["delim"],
- names=names,
- dtype=dict(zip(names, dtypes)),
- header=header,
- )
- G = nx.from_pandas_edgelist(
- pandas_edgelist, source=names[0], target=names[1], create_using=create_using
- )
- return G
-
-
-def get_legacy_backend_wrapper(backend_name):
- """
- Returns a callable that wraps an algo function with either the default
- dispatcher (which dispatches based on input graph type), or the "testing"
- dispatcher (which autoconverts and unconditionally dispatches).
- This is only supported for NetworkX <3.2
- """
- backends.plugin_name = "cugraph"
- orig_dispatch = backends._dispatch
- testing_dispatch = backends.test_override_dispatch
-
- if backend_name == "cugraph":
- dispatch = testing_dispatch
- else:
- dispatch = orig_dispatch
-
- def wrap_callable_for_dispatch(func, exhaust_returned_iterator=False):
- # Networkx <3.2 registers functions when the dispatch decorator is
- # applied (called) and errors if re-registered, so clear bookkeeping to
- # allow it to be called repeatedly.
- backends._registered_algorithms = {}
- actual_func = dispatch(func) # returns the func the dispatcher picks
-
- def wrapper(*args, **kwargs):
- retval = actual_func(*args, **kwargs)
- if exhaust_returned_iterator:
- retval = list(retval)
- return retval
-
- return wrapper
-
- return wrap_callable_for_dispatch
-
-
-def get_backend_wrapper(backend_name):
- """
- Returns a callable that wraps an algo function in order to set the
- "backend" kwarg on it.
- This is only supported for NetworkX >= 3.2
- """
-
- def wrap_callable_for_dispatch(func, exhaust_returned_iterator=False):
- def wrapper(*args, **kwargs):
- kwargs["backend"] = backend_name
- retval = func(*args, **kwargs)
- if exhaust_returned_iterator:
- retval = list(retval)
- return retval
-
- return wrapper
-
- return wrap_callable_for_dispatch
-
-
-@pytest.fixture(
- scope="module",
- params=backend_param_values,
- ids=lambda backend: f"backend={backend}",
-)
-def backend_wrapper(request):
- """
- Returns a callable that takes a function algo and wraps it in another
- function that calls the algo using the appropriate backend.
-
- For example: if the backend to test is "cugraph", this will return a
- function that calls nx.pagerank(..., backend='cugraph')
- """
- backend_name = request.param
- actual_backend_name = backend_name
-
- # Special case: cugraph-preconverted may be specified as a backend but this
- # name is reserved to indicate a cugraph backend is to be used with a
- # preconverted graph obj (rather than having the backend do the
- # conversion).
- if backend_name == "cugraph-preconverted":
- actual_backend_name = "cugraph"
-
- # NX <3.2 does not support the backends= kwarg, so the backend must be
- # enabled differently
- if backends is not None:
- wrapper = get_legacy_backend_wrapper(actual_backend_name)
- else:
- wrapper = get_backend_wrapper(actual_backend_name)
-
- wrapper.backend_name = backend_name
- return wrapper
-
-
-def get_graph_obj_for_benchmark(graph_obj, backend_wrapper):
- """
- Given a Graph object and a backend name, return a converted Graph or the
- original Graph object based on the backend to use.
-
- This is needed because some backend names are actually used as descriptions
- for combinations of backends and converted/non-converted graphs. For
- example, a benchmark may specify the "cugraph-preconverted" backend, which
- is not an installed backend but instead refers to the "cugraph" backend
- passed a NX Graph that has been converted to a nx-cugraph Graph object.
- """
- G = graph_obj
- if backend_wrapper.backend_name == "cugraph-preconverted":
- G = nxcg.from_networkx(G, preserve_all_attrs=True)
- return G
-
-
-def get_highest_degree_node(graph_obj):
- degrees = graph_obj.degree() # list of tuples of (node, degree)
- return max(degrees, key=lambda t: t[1])[0]
-
-
-def build_personalization_dict(pagerank_dict):
- """
- Returns a dictionary that can be used as the personalization value for a
- call to nx.pagerank(). The pagerank_dict passed in is used as the initial
- source of values for each node, and this function simply treats the list of
- dict values as two halves (halves A and B) and swaps them so (most if not
- all) nodes/keys are assigned a different value from the dictionary.
- """
- num_half = len(pagerank_dict) // 2
- A_half_items = list(pagerank_dict.items())[:num_half]
- B_half_items = list(pagerank_dict.items())[num_half:]
-
- # Support an odd number of items by initializing with B_half_items, which
- # will always be one bigger if the number of items is odd. This will leave
- # the one remainder (in the case of an odd number) unchanged.
- pers_dict = dict(B_half_items)
- pers_dict.update({A_half_items[i][0]: B_half_items[i][1] for i in range(num_half)})
- pers_dict.update({B_half_items[i][0]: A_half_items[i][1] for i in range(num_half)})
-
- return pers_dict
-
-
-################################################################################
-# Benchmarks
-def bench_from_networkx(benchmark, graph_obj):
- benchmark(nxcg.from_networkx, graph_obj)
-
-
-# normalized_param_values = [True, False]
-normalized_param_values = [True]
-k_param_values = [10, 100, 1000]
-
-
-@pytest.mark.parametrize(
- "normalized", normalized_param_values, ids=lambda norm: f"{norm=}"
-)
-@pytest.mark.parametrize("k", k_param_values, ids=lambda k: f"{k=}")
-def bench_betweenness_centrality(benchmark, graph_obj, backend_wrapper, normalized, k):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
-
- if k > G.number_of_nodes():
- pytest.skip(reason=f"{k=} > {G.number_of_nodes()=}")
-
- result = benchmark.pedantic(
- target=backend_wrapper(nx.betweenness_centrality),
- args=(G,),
- kwargs=dict(
- weight=None,
- normalized=normalized,
- k=k,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-@pytest.mark.parametrize(
- "normalized", normalized_param_values, ids=lambda norm: f"{norm=}"
-)
-@pytest.mark.parametrize("k", k_param_values, ids=lambda k: f"{k=}")
-def bench_edge_betweenness_centrality(
- benchmark, graph_obj, backend_wrapper, normalized, k
-):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
-
- if k > G.number_of_nodes():
- pytest.skip(reason=f"{k=} > {G.number_of_nodes()=}")
-
- result = benchmark.pedantic(
- target=backend_wrapper(nx.edge_betweenness_centrality),
- args=(G,),
- kwargs=dict(
- weight=None,
- normalized=normalized,
- k=k,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_louvain_communities(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.community.louvain_communities),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_degree_centrality(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.degree_centrality),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_eigenvector_centrality(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.eigenvector_centrality),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-@pytest.mark.parametrize(
- "normalized", normalized_param_values, ids=lambda norm: f"{norm=}"
-)
-def bench_hits(benchmark, graph_obj, backend_wrapper, normalized):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.hits),
- args=(G,),
- kwargs=dict(
- normalized=normalized,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is tuple
- assert len(result) == 2
- assert type(result[0]) is dict
- assert type(result[1]) is dict
-
-
-def bench_in_degree_centrality(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.in_degree_centrality),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-@pytest.mark.parametrize(
- "normalized", normalized_param_values, ids=lambda norm: f"{norm=}"
-)
-def bench_katz_centrality(benchmark, graph_obj, backend_wrapper, normalized):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.katz_centrality),
- args=(G,),
- kwargs=dict(
- normalized=normalized,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_k_truss(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.k_truss),
- args=(G,),
- kwargs=dict(
- k=2,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- # Check that this at least appears to be some kind of NX-like Graph
- assert hasattr(result, "has_node")
-
-
-def bench_out_degree_centrality(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.out_degree_centrality),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_pagerank(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.pagerank),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_pagerank_personalized(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
-
- # FIXME: This will run for every combination of inputs, even if the
- # graph/dataset does not change. Ideally this is run once per
- # graph/dataset.
- pagerank_dict = nx.pagerank(G)
- personalization_dict = build_personalization_dict(pagerank_dict)
-
- result = benchmark.pedantic(
- target=backend_wrapper(nx.pagerank),
- args=(G,),
- kwargs={"personalization": personalization_dict},
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_shortest_path(benchmark, graph_obj, backend_wrapper):
- """
- This passes in the source node with the highest degree, but no target.
- """
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
-
- result = benchmark.pedantic(
- target=backend_wrapper(nx.shortest_path),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_single_source_shortest_path_length(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
-
- result = benchmark.pedantic(
- target=backend_wrapper(nx.single_source_shortest_path_length),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_single_target_shortest_path_length(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(
- nx.single_target_shortest_path_length, exhaust_returned_iterator=True
- ),
- args=(G,),
- kwargs=dict(
- target=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- # exhaust_returned_iterator=True forces the result to a list, but is not
- # needed for this algo in NX 3.3+ which returns a dict instead of an
- # iterator. Forcing to a list does not change the benchmark timing.
- assert type(result) is list
-
-
-def bench_ancestors(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.ancestors),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is set
-
-
-def bench_average_clustering(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported by nx-cugraph
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.average_clustering),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is float
-
-
-def bench_generic_bfs_edges(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.generic_bfs_edges, exhaust_returned_iterator=True),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_bfs_edges(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.bfs_edges, exhaust_returned_iterator=True),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_bfs_layers(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.bfs_layers, exhaust_returned_iterator=True),
- args=(G,),
- kwargs=dict(
- sources=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_bfs_predecessors(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.bfs_predecessors, exhaust_returned_iterator=True),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_bfs_successors(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.bfs_successors, exhaust_returned_iterator=True),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_bfs_tree(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.bfs_tree),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- # Check that this at least appears to be some kind of NX-like Graph
- assert hasattr(result, "has_node")
-
-
-def bench_clustering(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported by nx-cugraph
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.clustering),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_core_number(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported by nx-cugraph
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.core_number),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_descendants(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.descendants),
- args=(G,),
- kwargs=dict(
- source=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is set
-
-
-def bench_descendants_at_distance(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.descendants_at_distance),
- args=(G,),
- kwargs=dict(
- source=node,
- distance=1,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is set
-
-
-def bench_is_bipartite(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.is_bipartite),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is bool
-
-
-def bench_is_strongly_connected(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.is_strongly_connected),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is bool
-
-
-def bench_is_weakly_connected(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.is_weakly_connected),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is bool
-
-
-def bench_number_strongly_connected_components(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.number_strongly_connected_components),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is int
-
-
-def bench_number_weakly_connected_components(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.number_weakly_connected_components),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is int
-
-
-def bench_overall_reciprocity(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.overall_reciprocity),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is float
-
-
-def bench_reciprocity(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.reciprocity),
- args=(G,),
- kwargs=dict(
- nodes=node,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is float
-
-
-def bench_strongly_connected_components(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(
- nx.strongly_connected_components, exhaust_returned_iterator=True
- ),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_transitivity(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported by nx-cugraph
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.transitivity),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is float
-
-
-def bench_triangles(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- # DiGraphs are not supported
- if G.is_directed():
- G = G.to_undirected()
- result = benchmark.pedantic(
- target=backend_wrapper(nx.triangles),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is dict
-
-
-def bench_weakly_connected_components(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- result = benchmark.pedantic(
- target=backend_wrapper(
- nx.weakly_connected_components, exhaust_returned_iterator=True
- ),
- args=(G,),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert type(result) is list
-
-
-def bench_ego_graph(benchmark, graph_obj, backend_wrapper):
- G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper)
- node = get_highest_degree_node(graph_obj)
- result = benchmark.pedantic(
- target=backend_wrapper(nx.ego_graph),
- args=(G,),
- kwargs=dict(
- n=node,
- radius=100,
- ),
- rounds=rounds,
- iterations=iterations,
- warmup_rounds=warmup_rounds,
- )
- assert isinstance(result, (nx.Graph, nxcg.Graph))
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_complete_bipartite_graph(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_connected_components(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_connected(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_node_connected_component(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_number_connected_components(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_isolate(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_isolates(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_number_of_isolates(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_complement(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_reverse(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_arborescence(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_branching(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_forest(benchmark, graph_obj, backend_wrapper):
- pass
-
-
-@pytest.mark.skip(reason="benchmark not implemented")
-def bench_is_tree(benchmark, graph_obj, backend_wrapper):
- pass
diff --git a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py
deleted file mode 100644
index f1cc4b06ccc..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py
+++ /dev/null
@@ -1,291 +0,0 @@
-# Copyright (c) 2024, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import re
-import pathlib
-import json
-import platform
-import psutil
-import socket
-import subprocess
-
-
-def get_formatted_time_value(time):
- res = ""
- if time < 1:
- if time < 0.001:
- units = "us"
- time *= 1e6
- else:
- units = "ms"
- time *= 1e3
- else:
- units = "s"
- return f"{time:.3f}{units}"
-
-
-def get_all_benchmark_info():
- benchmarks = {}
- # Populate benchmarks dir from .json files
- for json_file in logs_dir.glob("*.json"):
- try:
- data = json.loads(open(json_file).read())
- except json.decoder.JSONDecodeError:
- continue
-
- for benchmark_run in data["benchmarks"]:
- # example name: "bench_triangles[ds=netscience-backend=cugraph-preconverted]"
- name = benchmark_run["name"]
-
- algo_name = name.split("[")[0]
- if algo_name.startswith("bench_"):
- algo_name = algo_name[6:]
- # special case for betweenness_centrality
- match = k_patt.match(name)
- if match is not None:
- algo_name += f", k={match.group(1)}"
-
- match = dataset_patt.match(name)
- if match is None:
- raise RuntimeError(
- f"benchmark name {name} in file {json_file} has an unexpected format"
- )
- dataset = match.group(1)
- if dataset.endswith("-backend"):
- dataset = dataset[:-8]
-
- match = backend_patt.match(name)
- if match is None:
- raise RuntimeError(
- f"benchmark name {name} in file {json_file} has an unexpected format"
- )
- backend = match.group(1)
- if backend == "None":
- backend = "networkx"
-
- runtime = benchmark_run["stats"]["mean"]
- benchmarks.setdefault(algo_name, {}).setdefault(backend, {})[
- dataset
- ] = runtime
- return benchmarks
-
-
-def compute_perf_vals(cugraph_runtime, networkx_runtime):
- speedup_string = f"{networkx_runtime / cugraph_runtime:.3f}X"
- delta = networkx_runtime - cugraph_runtime
- if abs(delta) < 1:
- if abs(delta) < 0.001:
- units = "us"
- delta *= 1e6
- else:
- units = "ms"
- delta *= 1e3
- else:
- units = "s"
- delta_string = f"{delta:.3f}{units}"
-
- return (speedup_string, delta_string)
-
-
-def get_mem_info():
- return round(psutil.virtual_memory().total / (1024**3), 2)
-
-
-def get_cuda_version():
- output = subprocess.check_output("nvidia-smi", shell=True).decode()
- try:
- return next(
- line.split("CUDA Version: ")[1].split()[0]
- for line in output.splitlines()
- if "CUDA Version" in line
- )
- except subprocess.CalledProcessError:
- return "Failed to get CUDA version."
-
-
-def get_first_gpu_info():
- try:
- gpu_info = (
- subprocess.check_output(
- "nvidia-smi --query-gpu=name,memory.total,memory.free,memory.used --format=csv,noheader",
- shell=True,
- )
- .decode()
- .strip()
- )
- if gpu_info:
- gpus = gpu_info.split("\n")
- num_gpus = len(gpus)
- first_gpu = gpus[0] # Get the information for the first GPU
- gpu_name, mem_total, _, _ = first_gpu.split(",")
- return f"{num_gpus} x {gpu_name.strip()} ({round(int(mem_total.strip().split()[0]) / (1024), 2)} GB)"
- else:
- print("No GPU found or unable to query GPU details.")
- except subprocess.CalledProcessError:
- print("Failed to execute nvidia-smi. No GPU information available.")
-
-
-def get_system_info():
- print('
')
- print(f"
Hostname: {socket.gethostname()}
")
- print(
- f'
Operating System: {platform.system()} {platform.release()}
'
- )
- print(f'
Kernel Version : {platform.version()}
')
- with open("/proc/cpuinfo") as f:
- print(
- f'
CPU: {next(line.strip().split(": ")[1] for line in f if "model name" in line)} ({psutil.cpu_count(logical=False)} cores)
'
- )
- print(f'
Memory: {get_mem_info()} GB
')
- print(f"
GPU: {get_first_gpu_info()}
")
- print(f"
CUDA Version: {get_cuda_version()}
")
-
-
-if __name__ == "__main__":
- logs_dir = pathlib.Path("logs")
-
- dataset_patt = re.compile(".*ds=([\w-]+).*")
- backend_patt = re.compile(".*backend=(\w+).*")
- k_patt = re.compile(".*k=(10*).*")
-
- # Organize all benchmark runs by the following hierarchy: algo -> backend -> dataset
- benchmarks = get_all_benchmark_info()
-
- # dump HTML table
- ordered_datasets = [
- "netscience",
- "email_Eu_core",
- "cit-patents",
- "hollywood",
- "soc-livejournal1",
- ]
- # dataset, # Node, # Edge, Directed info
- dataset_meta = {
- "netscience": ["1,461", "5,484", "Yes"],
- "email_Eu_core": ["1,005", "25,571", "Yes"],
- "cit-patents": ["3,774,768", "16,518,948", "Yes"],
- "hollywood": ["1,139,905", "57,515,616", "No"],
- "soc-livejournal1": ["4,847,571", "68,993,773", "Yes"],
- }
-
- print(
- """
-
-
-
-
-
-
-
- Dataset Nodes Edges Directed | """
- )
- for ds in ordered_datasets:
- print(
- f" {ds} {dataset_meta[ds][0]} {dataset_meta[ds][1]} {dataset_meta[ds][2]}
| "
- )
- print(
- """
-
-
- """
- )
- for algo_name in sorted(benchmarks):
- algo_runs = benchmarks[algo_name]
- print(" ")
- print(f" {algo_name} | ")
- # Proceed only if any results are present for both cugraph and NX
- if "cugraph" in algo_runs and "networkx" in algo_runs:
- cugraph_algo_runs = algo_runs["cugraph"]
- networkx_algo_runs = algo_runs["networkx"]
- datasets_in_both = set(cugraph_algo_runs).intersection(networkx_algo_runs)
-
- # populate the table with speedup results for each dataset in the order
- # specified in ordered_datasets. If results for a run using a dataset
- # are not present for both cugraph and NX, output an empty cell.
- for dataset in ordered_datasets:
- if dataset in datasets_in_both:
- cugraph_runtime = cugraph_algo_runs[dataset]
- networkx_runtime = networkx_algo_runs[dataset]
- (speedup, runtime_delta) = compute_perf_vals(
- cugraph_runtime=cugraph_runtime,
- networkx_runtime=networkx_runtime,
- )
- nx_formatted = get_formatted_time_value(networkx_runtime)
- cg_formatted = get_formatted_time_value(cugraph_runtime)
- print(
- f" {nx_formatted} / {cg_formatted} {speedup} {runtime_delta} | "
- )
- else:
- print(f" | ")
-
- # If a comparison between cugraph and NX cannot be made, output empty cells
- # for each dataset
- else:
- for _ in range(len(ordered_datasets)):
- print(" | ")
- print("
")
- print(
- """
- \n
-
-
-
Table Format:
-
- - NetworkX time / nx-cugraph time
- - Speed-up of using nx-cugraph
- - Time-delta
-
-
"""
- )
- get_system_info()
- print("""
\n
\n""")
diff --git a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py b/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py
deleted file mode 100644
index 5a0a15da8ee..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2024, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""
-Checks if a particular dataset has been downloaded inside the datasets dir
-(RAPIDS_DATAEST_ROOT_DIR). If not, the file will be downloaded using the
-datasets API.
-
-Positional Arguments:
- 1) dataset name (e.g. 'email_Eu_core', 'cit-patents')
- available datasets can be found here: `python/cugraph/cugraph/datasets/__init__.py`
-"""
-
-import sys
-
-import cugraph.datasets as cgds
-
-
-if __name__ == "__main__":
- # download and store dataset (csv) by using the Datasets API
- dataset = sys.argv[1].replace("-", "_")
- dataset_obj = getattr(cgds, dataset)
-
- if not dataset_obj.get_path().exists():
- dataset_obj.get_edgelist(download=True)
diff --git a/benchmarks/nx-cugraph/pytest-based/run-2402.sh b/benchmarks/nx-cugraph/pytest-based/run-2402.sh
deleted file mode 100755
index 44ed0bda43a..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/run-2402.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2024, NVIDIA CORPORATION.
-#
-# Runs benchmarks for the 24.02 algos.
-# Pass either a or b or both. This is useful for separating batches of runs on different GPUs:
-# CUDA_VISIBLE_DEVICES=1 run-2402.sh b
-
-mkdir -p logs
-
-# benches="$benches ..." pattern is easy to comment out individual runs
-benches=
-
-while [[ $1 != "" ]]; do
- if [[ $1 == "a" ]]; then
- benches="$benches bench_ancestors"
- benches="$benches bench_average_clustering"
- benches="$benches bench_generic_bfs_edges"
- benches="$benches bench_bfs_edges"
- benches="$benches bench_bfs_layers"
- benches="$benches bench_bfs_predecessors"
- benches="$benches bench_bfs_successors"
- benches="$benches bench_bfs_tree"
- benches="$benches bench_clustering"
- benches="$benches bench_core_number"
- benches="$benches bench_descendants"
- elif [[ $1 == "b" ]]; then
- benches="$benches bench_descendants_at_distance"
- benches="$benches bench_is_bipartite"
- benches="$benches bench_is_strongly_connected"
- benches="$benches bench_is_weakly_connected"
- benches="$benches bench_number_strongly_connected_components"
- benches="$benches bench_number_weakly_connected_components"
- benches="$benches bench_overall_reciprocity"
- benches="$benches bench_reciprocity"
- benches="$benches bench_strongly_connected_components"
- benches="$benches bench_transitivity"
- benches="$benches bench_triangles"
- benches="$benches bench_weakly_connected_components"
- fi
- shift
-done
-
-for bench in $benches; do
- pytest -sv -k "soc-livejournal1" "bench_algos.py::$bench" 2>&1 | tee "logs/${bench}.log"
-done
diff --git a/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh b/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh
deleted file mode 100755
index 3059e3d4bdf..00000000000
--- a/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# location to store datasets used for benchmarking
-export RAPIDS_DATASET_ROOT_DIR=/datasets/cugraph
-mkdir -p logs
-
-# list of algos, datasets, and back-ends to use in combinations
-algos="
- pagerank
- betweenness_centrality
- louvain
- shortest_path
- weakly_connected_components
- triangles
- bfs_predecessors
-"
-datasets="
- netscience
- email_Eu_core
- cit-patents
- hollywood
- soc-livejournal
-"
-# None backend is default networkx
-# cugraph-preconvert backend is nx-cugraph
-backends="
- None
- cugraph-preconverted
-"
-# check for --cpu-only or --gpu-only args
-if [[ "$#" -eq 1 ]]; then
- case $1 in
- --cpu-only)
- backends="None"
- ;;
- --gpu-only)
- backends="cugraph-preconverted"
- ;;
- *)
- echo "Unknown option: $1"
- exit 1
- ;;
- esac
-fi
-
-for algo in $algos; do
- for dataset in $datasets; do
- # this script can be used to download benchmarking datasets by name via cugraph.datasets
- python get_graph_bench_dataset.py $dataset
- for backend in $backends; do
- name="${backend}__${algo}__${dataset}"
- echo "Running: $backend, $dataset, bench_$algo"
- # command to preproduce test
- # echo "RUNNING: \"pytest -sv -k \"$backend and $dataset and bench_$algo and not 1000\" --benchmark-json=\"logs/${name}.json\" bench_algos.py"
- pytest -sv \
- -k "$backend and $dataset and bench_$algo and not 1000" \
- --benchmark-json="logs/${name}.json" \
- bench_algos.py 2>&1 | tee "logs/${name}.out"
- done
- done
-done
diff --git a/build.sh b/build.sh
index 24ce8c08e8d..756045461dd 100755
--- a/build.sh
+++ b/build.sh
@@ -29,10 +29,6 @@ VALIDARGS="
pylibcugraph
cugraph
cugraph-service
- cugraph-pyg
- cugraph-dgl
- cugraph-equivariant
- nx-cugraph
cpp-mgtests
cpp-mtmgtests
docs
@@ -43,7 +39,6 @@ VALIDARGS="
--pydevelop
--allgpuarch
--skip_cpp_tests
- --without_cugraphops
--cmake_default_generator
--clean
-h
@@ -59,10 +54,6 @@ HELP="$0 [ ...] [ ...]
pylibcugraph - build the pylibcugraph Python package
cugraph - build the cugraph Python package
cugraph-service - build the cugraph-service_client and cugraph-service_server Python package
- cugraph-pyg - build the cugraph-pyg Python package
- cugraph-dgl - build the cugraph-dgl extensions for DGL
- cugraph-equivariant - build the cugraph-equivariant Python package
- nx-cugraph - build the nx-cugraph Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
cpp-mtmgtests - build libcugraph MTMG tests. Adds UCX as a dependency (temporary).
docs - build the docs
@@ -74,7 +65,6 @@ HELP="$0 [ ...] [ ...]
--pydevelop - install the Python packages in editable mode
--allgpuarch - build for all supported GPU architectures
--skip_cpp_tests - do not build the SG test binaries as part of the libcugraph and libcugraph_etl targets
- --without_cugraphops - do not build algos that require cugraph-ops
--cmake_default_generator - use the default cmake generator instead of ninja
--clean - clean an individual target (note: to do a complete rebuild, use the clean target described above)
-h - print this text
@@ -90,12 +80,10 @@ LIBCUGRAPH_ETL_BUILD_DIR=${LIBCUGRAPH_ETL_BUILD_DIR:=${REPODIR}/cpp/libcugraph_e
CUGRAPH_SERVICE_BUILD_DIRS="${REPODIR}/python/cugraph-service/server/build
${REPODIR}/python/cugraph-service/client/build
"
-CUGRAPH_DGL_BUILD_DIR=${REPODIR}/python/cugraph-dgl/build
BUILD_DIRS="${LIBCUGRAPH_BUILD_DIR}
${LIBCUGRAPH_ETL_BUILD_DIR}
${CUGRAPH_SERVICE_BUILD_DIRS}
- ${CUGRAPH_DGL_BUILD_DIR}
"
# Set defaults for vars modified by flags to this script
@@ -107,7 +95,6 @@ BUILD_CPP_TESTS=ON
BUILD_CPP_MG_TESTS=OFF
BUILD_CPP_MTMG_TESTS=OFF
BUILD_ALL_GPU_ARCH=0
-BUILD_WITH_CUGRAPHOPS=ON
CMAKE_GENERATOR_OPTION="-G Ninja"
PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true"
@@ -170,9 +157,6 @@ fi
if hasArg --skip_cpp_tests; then
BUILD_CPP_TESTS=OFF
fi
-if hasArg --without_cugraphops; then
- BUILD_WITH_CUGRAPHOPS=OFF
-fi
if hasArg cpp-mtmgtests; then
BUILD_CPP_MTMG_TESTS=ON
fi
@@ -217,8 +201,7 @@ if hasArg uninstall; then
# FIXME: if multiple versions of these packages are installed, this only
# removes the latest one and leaves the others installed. build.sh uninstall
# can be run multiple times to remove all of them, but that is not obvious.
- pip uninstall -y pylibcugraph cugraph cugraph-service-client cugraph-service-server \
- cugraph-dgl cugraph-pyg cugraph-equivariant nx-cugraph
+ pip uninstall -y pylibcugraph cugraph cugraph-service-client cugraph-service-server
fi
if hasArg clean; then
@@ -268,7 +251,6 @@ if buildDefault || hasArg libcugraph || hasArg all; then
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
-DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
- -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \
${CMAKE_GENERATOR_OPTION} \
${CMAKE_VERBOSE_OPTION}
cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG}
@@ -312,7 +294,7 @@ if buildDefault || hasArg pylibcugraph || hasArg all; then
if hasArg --clean; then
cleanPythonDir ${REPODIR}/python/pylibcugraph
else
- SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
+ SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph
fi
fi
@@ -322,7 +304,7 @@ if buildDefault || hasArg cugraph || hasArg all; then
if hasArg --clean; then
cleanPythonDir ${REPODIR}/python/cugraph
else
- SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
+ SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph
fi
fi
@@ -337,42 +319,6 @@ if hasArg cugraph-service || hasArg all; then
fi
fi
-# Build and install the cugraph-pyg Python package
-if hasArg cugraph-pyg || hasArg all; then
- if hasArg --clean; then
- cleanPythonDir ${REPODIR}/python/cugraph-pyg
- else
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-pyg
- fi
-fi
-
-# Install the cugraph-dgl extensions for DGL
-if hasArg cugraph-dgl || hasArg all; then
- if hasArg --clean; then
- cleanPythonDir ${REPODIR}/python/cugraph-dgl
- else
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-dgl
- fi
-fi
-
-# Build and install the cugraph-equivariant Python package
-if hasArg cugraph-equivariant || hasArg all; then
- if hasArg --clean; then
- cleanPythonDir ${REPODIR}/python/cugraph-equivariant
- else
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-equivariant
- fi
-fi
-
-# Build and install the nx-cugraph Python package
-if hasArg nx-cugraph || hasArg all; then
- if hasArg --clean; then
- cleanPythonDir ${REPODIR}/python/nx-cugraph
- else
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/nx-cugraph
- fi
-fi
-
# Build the docs
if hasArg docs || hasArg all; then
if [ ! -d ${LIBCUGRAPH_BUILD_DIR} ]; then
diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh
index 859977d76d5..93e5c680d07 100755
--- a/ci/build_cpp.sh
+++ b/ci/build_cpp.sh
@@ -17,4 +17,6 @@ rapids-logger "Begin cpp build"
RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcugraph
+sccache --show-adv-stats
+
rapids-upload-conda-to-s3 cpp
diff --git a/ci/build_docs.sh b/ci/build_docs.sh
index 01c573c96ca..2d7e90da8d0 100755
--- a/ci/build_docs.sh
+++ b/ci/build_docs.sh
@@ -48,7 +48,7 @@ rapids-mamba-retry install \
"libcugraph_etl=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibcugraphops=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibwholegraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "pytorch>=2.3,<2.4" \
+ 'pytorch>=2.3' \
"cuda-version=${CONDA_CUDA_VERSION}"
export RAPIDS_DOCS_DIR="$(mktemp -d)"
diff --git a/ci/build_python.sh b/ci/build_python.sh
index c94cc2a0fce..eab41f63da0 100755
--- a/ci/build_python.sh
+++ b/ci/build_python.sh
@@ -20,6 +20,8 @@ export RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION)
rapids-logger "Begin py build"
+sccache --zero-stats
+
# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
@@ -27,21 +29,16 @@ rapids-conda-retry mambabuild \
--channel "${CPP_CHANNEL}" \
conda/recipes/pylibcugraph
+sccache --show-adv-stats
+sccache --zero-stats
+
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cugraph
-# NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA
-# platform to ensure it is included in each set of artifacts, since test
-# scripts only install from one set of artifacts based on the CUDA version used
-# for the test run.
-rapids-conda-retry mambabuild \
- --no-test \
- --channel "${CPP_CHANNEL}" \
- --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
- conda/recipes/nx-cugraph
+sccache --show-adv-stats
# NOTE: nothing in the cugraph-service packages are CUDA-specific, but they are
# built on each CUDA platform to ensure they are included in each set of
@@ -53,32 +50,4 @@ rapids-conda-retry mambabuild \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cugraph-service
-RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
-
-if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then
- # Only CUDA 11 is supported right now due to PyTorch requirement.
- rapids-conda-retry mambabuild \
- --no-test \
- --channel "${CPP_CHANNEL}" \
- --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
- --channel pytorch \
- --channel pytorch-nightly \
- conda/recipes/cugraph-pyg
-
- # Only CUDA 11 is supported right now due to PyTorch requirement.
- rapids-conda-retry mambabuild \
- --no-test \
- --channel "${CPP_CHANNEL}" \
- --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
- --channel dglteam/label/th23_cu118 \
- --channel pytorch \
- --channel pytorch-nightly \
- conda/recipes/cugraph-dgl
-fi
-
-rapids-conda-retry mambabuild \
- --no-test \
- --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
- conda/recipes/cugraph-equivariant
-
rapids-upload-conda-to-s3 python
diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh
index f3979ab3049..9a77e6b3021 100755
--- a/ci/build_wheel.sh
+++ b/ci/build_wheel.sh
@@ -15,6 +15,10 @@ rapids-generate-version > ./VERSION
cd "${package_dir}"
+sccache --zero-stats
+
+rapids-logger "Building '${package_name}' wheel"
+
python -m pip wheel \
-w dist \
-v \
@@ -23,30 +27,24 @@ python -m pip wheel \
--extra-index-url https://pypi.nvidia.com \
.
-# pure-python packages should be marked as pure, and not have auditwheel run on them.
-if [[ ${package_name} == "nx-cugraph" ]] || \
- [[ ${package_name} == "cugraph-dgl" ]] || \
- [[ ${package_name} == "cugraph-pyg" ]] || \
- [[ ${package_name} == "cugraph-equivariant" ]]; then
- RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 dist
-else
- case "${RAPIDS_CUDA_VERSION}" in
- 12.*)
- EXCLUDE_ARGS=(
- --exclude "libcublas.so.12"
- --exclude "libcublasLt.so.12"
- --exclude "libcurand.so.10"
- --exclude "libcusolver.so.11"
- --exclude "libcusparse.so.12"
- --exclude "libnvJitLink.so.12"
- )
- ;;
- 11.*)
- EXCLUDE_ARGS=()
- ;;
- 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 final_dist
-fi
+sccache --show-adv-stats
+
+case "${RAPIDS_CUDA_VERSION}" in
+ 12.*)
+ EXCLUDE_ARGS=(
+ --exclude "libcublas.so.12"
+ --exclude "libcublasLt.so.12"
+ --exclude "libcurand.so.10"
+ --exclude "libcusolver.so.11"
+ --exclude "libcusparse.so.12"
+ --exclude "libnvJitLink.so.12"
+ )
+ ;;
+ 11.*)
+ EXCLUDE_ARGS=()
+ ;;
+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
diff --git a/ci/build_wheel_cugraph-dgl.sh b/ci/build_wheel_cugraph-dgl.sh
deleted file mode 100755
index d62f810cba4..00000000000
--- a/ci/build_wheel_cugraph-dgl.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-./ci/build_wheel.sh cugraph-dgl python/cugraph-dgl
diff --git a/ci/build_wheel_cugraph-equivariant.sh b/ci/build_wheel_cugraph-equivariant.sh
deleted file mode 100755
index fcc8e0f774c..00000000000
--- a/ci/build_wheel_cugraph-equivariant.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-./ci/build_wheel.sh cugraph-equivariant python/cugraph-equivariant
diff --git a/ci/build_wheel_cugraph-pyg.sh b/ci/build_wheel_cugraph-pyg.sh
deleted file mode 100755
index 97baa243f73..00000000000
--- a/ci/build_wheel_cugraph-pyg.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-./ci/build_wheel.sh cugraph-pyg python/cugraph-pyg
diff --git a/ci/build_wheel_cugraph.sh b/ci/build_wheel_cugraph.sh
index 20d9bf47e3e..b937fd7f6d8 100755
--- a/ci/build_wheel_cugraph.sh
+++ b/ci/build_wheel_cugraph.sh
@@ -3,6 +3,8 @@
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
@@ -31,4 +33,5 @@ esac
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/${EXTRA_CMAKE_ARGS}"
export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}"
-./ci/build_wheel.sh cugraph python/cugraph
+./ci/build_wheel.sh cugraph ${package_dir}
+./ci/validate_wheel.sh ${package_dir} final_dist
diff --git a/ci/build_wheel_nx-cugraph.sh b/ci/build_wheel_nx-cugraph.sh
deleted file mode 100755
index 4481de1283d..00000000000
--- a/ci/build_wheel_nx-cugraph.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2023, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-./ci/build_wheel.sh nx-cugraph python/nx-cugraph
diff --git a/ci/build_wheel_pylibcugraph.sh b/ci/build_wheel_pylibcugraph.sh
index fa967b0be29..928e12d2350 100755
--- a/ci/build_wheel_pylibcugraph.sh
+++ b/ci/build_wheel_pylibcugraph.sh
@@ -3,6 +3,8 @@
set -euo pipefail
+package_dir="python/pylibcugraph"
+
PARALLEL_LEVEL=$(python -c \
"from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))")
@@ -18,4 +20,5 @@ esac
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/${EXTRA_CMAKE_ARGS}"
export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}"
-./ci/build_wheel.sh pylibcugraph python/pylibcugraph
+./ci/build_wheel.sh pylibcugraph ${package_dir}
+./ci/validate_wheel.sh ${package_dir} final_dist
diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh
index 5859ebde953..961f7816caa 100755
--- a/ci/release/update-version.sh
+++ b/ci/release/update-version.sh
@@ -51,8 +51,6 @@ NEXT_UCXX_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; p
DEPENDENCIES=(
cudf
cugraph
- cugraph-dgl
- cugraph-pyg
cugraph-service-server
cugraph-service-client
cuxfilter
@@ -75,7 +73,7 @@ DEPENDENCIES=(
UCXX_DEPENDENCIES=(
ucx-py
)
-for FILE in dependencies.yaml conda/environments/*.yaml python/cugraph-{pyg,dgl}/conda/*.yaml; do
+for FILE in dependencies.yaml conda/environments/*.yaml; do
for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
done
@@ -106,8 +104,6 @@ for FILE in .github/workflows/*.yaml; do
sed_runner "s/dask-cuda.git@branch-[0-9][0-9].[0-9][0-9]/dask-cuda.git@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
done
-sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" python/nx-cugraph/README.md
-
# .devcontainer files
find .devcontainer/ -type f -name devcontainer.json -print0 | while IFS= read -r -d '' filename; do
sed_runner "s@rapidsai/devcontainers:[0-9.]*@rapidsai/devcontainers:${NEXT_SHORT_TAG}@g" "${filename}"
diff --git a/ci/run_cugraph_dgl_pytests.sh b/ci/run_cugraph_dgl_pytests.sh
deleted file mode 100755
index 83c26a57dc0..00000000000
--- a/ci/run_cugraph_dgl_pytests.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-# Support invoking run_cugraph_dgl_pytests.sh outside the script directory
-cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-dgl/tests
-
-pytest --cache-clear --ignore=mg "$@" .
diff --git a/ci/run_cugraph_equivariant_pytests.sh b/ci/run_cugraph_equivariant_pytests.sh
deleted file mode 100755
index 5d5a5fb05c2..00000000000
--- a/ci/run_cugraph_equivariant_pytests.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-# Support invoking run_cugraph_equivariant_pytests.sh outside the script directory
-cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-equivariant/cugraph_equivariant
-
-pytest --cache-clear "$@" .
diff --git a/ci/run_cugraph_pyg_pytests.sh b/ci/run_cugraph_pyg_pytests.sh
deleted file mode 100755
index fb27f16d79e..00000000000
--- a/ci/run_cugraph_pyg_pytests.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-# Support invoking run_cugraph_pyg_pytests.sh outside the script directory
-cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-pyg/cugraph_pyg
-
-pytest --cache-clear --benchmark-disable "$@" .
-
-# Used to skip certain examples in CI due to memory limitations
-export CI_RUN=1
-
-# Test examples
-for e in "$(pwd)"/examples/*.py; do
- rapids-logger "running example $e"
- (yes || true) | python $e
-done
diff --git a/ci/run_nx_cugraph_pytests.sh b/ci/run_nx_cugraph_pytests.sh
deleted file mode 100755
index 0e309d1e2d4..00000000000
--- a/ci/run_nx_cugraph_pytests.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -euo pipefail
-
-# Support invoking run_nx_cugraph_pytests.sh outside the script directory
-cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/nx-cugraph/nx_cugraph
-
-NX_CUGRAPH_USE_COMPAT_GRAPHS=False pytest --capture=no --cache-clear --benchmark-disable "$@" tests
-NX_CUGRAPH_USE_COMPAT_GRAPHS=True pytest --capture=no --cache-clear --benchmark-disable "$@" tests
diff --git a/ci/test.sh b/ci/test.sh
index 884ed7ac881..8e19b6c8c18 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -99,13 +99,6 @@ if hasArg "--run-python-tests"; then
pytest -sv -m sg -m "managedmem_on and poolallocator_on and tiny" --benchmark-disable
echo "Ran Python benchmarks for cuGraph (running as tests) : return code was: $?, test script exit code is now: $EXITCODE"
- echo "Python pytest for cugraph_pyg (single-GPU only)..."
- conda list
- cd ${CUGRAPH_ROOT}/python/cugraph-pyg/cugraph_pyg
- # rmat is not tested because of MG testing
- pytest -sv -m sg --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph-pytests.xml -v --cov-config=.coveragerc --cov=cugraph_pyg --cov-report=xml:${WORKSPACE}/python/cugraph_pyg/cugraph-coverage.xml --cov-report term --ignore=raft --benchmark-disable
- echo "Ran Python pytest for cugraph_pyg : return code was: $?, test script exit code is now: $EXITCODE"
-
echo "Python pytest for cugraph-service (single-GPU only)..."
cd ${CUGRAPH_ROOT}/python/cugraph-service
pytest -sv --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph-service-pytests.xml --benchmark-disable -k "not mg" ./tests
diff --git a/ci/test_python.sh b/ci/test_python.sh
index 29b4c7be190..646b61805cc 100755
--- a/ci/test_python.sh
+++ b/ci/test_python.sh
@@ -39,7 +39,6 @@ rapids-mamba-retry install \
"libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "nx-cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-server=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-client=${RAPIDS_VERSION_MAJOR_MINOR}.*"
@@ -91,44 +90,6 @@ rapids-logger "pytest cugraph"
rapids-logger "pytest cugraph benchmarks (run as tests)"
./ci/run_cugraph_benchmark_pytests.sh --verbose
-rapids-logger "pytest nx-cugraph"
-./ci/run_nx_cugraph_pytests.sh \
- --verbose \
- --junitxml="${RAPIDS_TESTS_DIR}/junit-nx-cugraph.xml" \
- --cov-config=../../.coveragerc \
- --cov=nx_cugraph \
- --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/nx-cugraph-coverage.xml" \
- --cov-report=term
-
-rapids-logger "pytest networkx using nx-cugraph backend"
-pushd python/nx-cugraph/nx_cugraph
-../run_nx_tests.sh
-# run_nx_tests.sh outputs coverage data, so check that total coverage is >0.0%
-# in case nx-cugraph failed to load but fallback mode allowed the run to pass.
-_coverage=$(coverage report|grep "^TOTAL")
-echo "nx-cugraph coverage from networkx tests: $_coverage"
-echo $_coverage | awk '{ if ($NF == "0.0%") exit 1 }'
-# Ensure all algorithms were called by comparing covered lines to function lines.
-# Run our tests again (they're fast enough) to add their coverage, then create coverage.json
-NX_CUGRAPH_USE_COMPAT_GRAPHS=False pytest \
- --pyargs nx_cugraph \
- --config-file=../pyproject.toml \
- --cov-config=../pyproject.toml \
- --cov=nx_cugraph \
- --cov-append \
- --cov-report=
-coverage report \
- --include="*/nx_cugraph/algorithms/*" \
- --omit=__init__.py \
- --show-missing \
- --rcfile=../pyproject.toml
-coverage json --rcfile=../pyproject.toml
-python -m nx_cugraph.tests.ensure_algos_covered
-# Exercise (and show results of) scripts that show implemented networkx algorithms
-python -m nx_cugraph.scripts.print_tree --dispatch-name --plc --incomplete --different
-python -m nx_cugraph.scripts.print_table
-popd
-
rapids-logger "pytest cugraph-service (single GPU)"
./ci/run_cugraph_service_pytests.sh \
--verbose \
@@ -139,139 +100,5 @@ rapids-logger "pytest cugraph-service (single GPU)"
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-service-coverage.xml" \
--cov-report=term
-if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
- if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
- # we are only testing in a single cuda version
- # because of pytorch and rapids compatibilty problems
- rapids-mamba-retry env create --yes -f env.yaml -n test_cugraph_dgl
-
- # activate test_cugraph_dgl environment for dgl
- set +u
- conda activate test_cugraph_dgl
- set -u
- rapids-mamba-retry install \
- --channel "${CPP_CHANNEL}" \
- --channel "${PYTHON_CHANNEL}" \
- --channel conda-forge \
- --channel dglteam/label/th23_cu118 \
- --channel nvidia \
- "libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "pylibcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "pylibcugraphops=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "cugraph-dgl=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- 'pytorch>=2.3,<2.4' \
- 'cuda-version=11.8'
-
- rapids-print-env
-
- rapids-logger "pytest cugraph_dgl (single GPU)"
- ./ci/run_cugraph_dgl_pytests.sh \
- --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-dgl.xml" \
- --cov-config=../../.coveragerc \
- --cov=cugraph_dgl \
- --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-dgl-coverage.xml" \
- --cov-report=term
-
- # Reactivate the test environment back
- set +u
- conda deactivate
- conda activate test
- set -u
- else
- rapids-logger "skipping cugraph_dgl pytest on ARM64"
- fi
-else
- rapids-logger "skipping cugraph_dgl pytest on CUDA!=11.8"
-fi
-
-if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
- if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
- rapids-mamba-retry env create --yes -f env.yaml -n test_cugraph_pyg
-
- # Temporarily allow unbound variables for conda activation.
- set +u
- conda activate test_cugraph_pyg
- set -u
-
- rapids-print-env
-
- # TODO re-enable logic once CUDA 12 is testable
- #if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
- CONDA_CUDA_VERSION="11.8"
- PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu118.html"
- #else
- # CONDA_CUDA_VERSION="12.1"
- # PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu121.html"
- #fi
-
- # Will automatically install built dependencies of cuGraph-PyG
- rapids-mamba-retry install \
- --channel "${CPP_CHANNEL}" \
- --channel "${PYTHON_CHANNEL}" \
- "cugraph-pyg=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
- "pytorch>=2.3,<2.4" \
- "ogb"
-
- rapids-print-env
-
- rapids-logger "pytest cugraph_pyg (single GPU)"
- # rmat is not tested because of multi-GPU testing
- ./ci/run_cugraph_pyg_pytests.sh \
- --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-pyg.xml" \
- --cov-config=../../.coveragerc \
- --cov=cugraph_pyg \
- --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-pyg-coverage.xml" \
- --cov-report=term
-
- # Reactivate the test environment back
- set +u
- conda deactivate
- conda activate test
- set -u
- else
- rapids-logger "skipping cugraph_pyg pytest on ARM64"
- fi
-else
- rapids-logger "skipping cugraph_pyg pytest on CUDA!=11.8"
-fi
-
-# test cugraph-equivariant
-if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
- if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
- # Reuse cugraph-dgl's test env for cugraph-equivariant
- set +u
- conda activate test_cugraph_dgl
- set -u
- rapids-mamba-retry install \
- --channel "${CPP_CHANNEL}" \
- --channel "${PYTHON_CHANNEL}" \
- --channel conda-forge \
- --channel nvidia \
- "cugraph-equivariant=${RAPIDS_VERSION_MAJOR_MINOR}.*"
- pip install e3nn==0.5.1
-
- rapids-print-env
-
- rapids-logger "pytest cugraph-equivariant"
- ./ci/run_cugraph_equivariant_pytests.sh \
- --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-equivariant.xml" \
- --cov-config=../../.coveragerc \
- --cov=cugraph_equivariant \
- --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-equivariant-coverage.xml" \
- --cov-report=term
-
- # Reactivate the test environment back
- set +u
- conda deactivate
- conda activate test
- set -u
- else
- rapids-logger "skipping cugraph-equivariant pytest on ARM64"
- fi
-else
- rapids-logger "skipping cugraph-equivariant pytest on CUDA!=11.8"
-fi
-
rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh
index e3690dfde6e..b5cd90996c7 100755
--- a/ci/test_wheel.sh
+++ b/ci/test_wheel.sh
@@ -4,19 +4,14 @@
set -eoxu pipefail
package_name=$1
-package_dir=$2
python_package_name=$(echo ${package_name}|sed 's/-/_/g')
mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
-# nx-cugraph is a pure wheel, which is part of generating the download path
-if [[ "${package_name}" == "nx-cugraph" ]]; then
- RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist
-else
- RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist
-fi
+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]
@@ -37,7 +32,6 @@ else
DASK_DISTRIBUTED__SCHEDULER__WORKER_TTL="1000s" \
DASK_DISTRIBUTED__COMM__TIMEOUTS__CONNECT="1000s" \
DASK_CUDA_WAIT_WORKERS_MIN_TIMEOUT="1000s" \
- NX_CUGRAPH_USE_COMPAT_GRAPHS=False \
python -m pytest \
-v \
--import-mode=append \
diff --git a/ci/test_wheel_cugraph-dgl.sh b/ci/test_wheel_cugraph-dgl.sh
deleted file mode 100755
index 688c58026bd..00000000000
--- a/ci/test_wheel_cugraph-dgl.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -eoxu pipefail
-
-package_name="cugraph-dgl"
-package_dir="python/cugraph-dgl"
-
-python_package_name=$(echo ${package_name}|sed 's/-/_/g')
-
-mkdir -p ./dist
-RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
-
-# Download wheels built during this job.
-RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps
-RAPIDS_PY_WHEEL_NAME="cugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps
-python -m pip install ./local-deps/*.whl
-
-# use 'ls' to expand wildcard before adding `[extra]` requires for pip
-RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist
-# pip creates wheels using python package names
-python -m pip install $(ls ./dist/${python_package_name}*.whl)[test]
-
-
-PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')"
-PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2}
-if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then
- PYTORCH_CUDA_VER="121"
-else
- PYTORCH_CUDA_VER=$PKG_CUDA_VER
-fi
-PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}"
-DGL_URL="https://data.dgl.ai/wheels/torch-2.3/cu${PYTORCH_CUDA_VER}/repo.html"
-
-rapids-logger "Installing PyTorch and DGL"
-rapids-retry python -m pip install torch==2.3.0 --index-url ${PYTORCH_URL}
-rapids-retry python -m pip install dgl==2.4.0 --find-links ${DGL_URL}
-
-python -m pytest python/cugraph-dgl/tests
diff --git a/ci/test_wheel_cugraph-equivariant.sh b/ci/test_wheel_cugraph-equivariant.sh
deleted file mode 100755
index cb952055f06..00000000000
--- a/ci/test_wheel_cugraph-equivariant.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -eoxu pipefail
-
-package_name="cugraph-equivariant"
-package_dir="python/cugraph-equivariant"
-
-python_package_name=$(echo ${package_name}|sed 's/-/_/g')
-
-mkdir -p ./dist
-RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
-
-# use 'ls' to expand wildcard before adding `[extra]` requires for pip
-RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist
-# pip creates wheels using python package names
-python -m pip install $(ls ./dist/${python_package_name}*.whl)[test]
-
-
-PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')"
-PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2}
-if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then
- PYTORCH_CUDA_VER="121"
-else
- PYTORCH_CUDA_VER=$PKG_CUDA_VER
-fi
-PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}"
-
-rapids-logger "Installing PyTorch and e3nn"
-rapids-retry python -m pip install torch --index-url ${PYTORCH_URL}
-rapids-retry python -m pip install e3nn
-
-python -m pytest python/cugraph-equivariant/cugraph_equivariant/tests
diff --git a/ci/test_wheel_cugraph-pyg.sh b/ci/test_wheel_cugraph-pyg.sh
deleted file mode 100755
index 8f4b16a2dec..00000000000
--- a/ci/test_wheel_cugraph-pyg.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-set -eoxu pipefail
-
-package_name="cugraph-pyg"
-package_dir="python/cugraph-pyg"
-
-python_package_name=$(echo ${package_name}|sed 's/-/_/g')
-
-mkdir -p ./dist
-RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
-
-# Download wheels built during this job.
-RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps
-RAPIDS_PY_WHEEL_NAME="cugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps
-python -m pip install ./local-deps/*.whl
-
-# use 'ls' to expand wildcard before adding `[extra]` requires for pip
-RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist
-# pip creates wheels using python package names
-python -m pip install $(ls ./dist/${python_package_name}*.whl)[test]
-
-# RAPIDS_DATASET_ROOT_DIR is used by test scripts
-export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
-
-# Used to skip certain examples in CI due to memory limitations
-export CI_RUN=1
-
-if [[ "${CUDA_VERSION}" == "11.8.0" ]]; then
- PYTORCH_URL="https://download.pytorch.org/whl/cu118"
- PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu118.html"
-else
- PYTORCH_URL="https://download.pytorch.org/whl/cu121"
- PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu121.html"
-fi
-rapids-logger "Installing PyTorch and PyG dependencies"
-rapids-retry python -m pip install torch==2.3.0 --index-url ${PYTORCH_URL}
-rapids-retry python -m pip install "torch-geometric>=2.5,<2.6"
-rapids-retry python -m pip install \
- ogb \
- pyg_lib \
- torch_scatter \
- torch_sparse \
- -f ${PYG_URL}
-
-rapids-logger "pytest cugraph-pyg (single GPU)"
-pushd python/cugraph-pyg/cugraph_pyg
-python -m pytest \
- --cache-clear \
- --benchmark-disable \
- tests
-# Test examples
-for e in "$(pwd)"/examples/*.py; do
- rapids-logger "running example $e"
- (yes || true) | python $e
-done
-popd
diff --git a/ci/test_wheel_cugraph.sh b/ci/test_wheel_cugraph.sh
index d351ea21624..295cec7cb10 100755
--- a/ci/test_wheel_cugraph.sh
+++ b/ci/test_wheel_cugraph.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2023, NVIDIA CORPORATION.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION.
set -eoxu pipefail
@@ -8,4 +8,4 @@ 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
-./ci/test_wheel.sh cugraph python/cugraph
+./ci/test_wheel.sh cugraph
diff --git a/ci/test_wheel_nx-cugraph.sh b/ci/test_wheel_nx-cugraph.sh
deleted file mode 100755
index b5adfbcb9d3..00000000000
--- a/ci/test_wheel_nx-cugraph.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2023-2024, NVIDIA CORPORATION.
-
-set -eoxu pipefail
-
-# Download wheels built during this job.
-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-deps
-python -m pip install ./local-deps/*.whl
-
-./ci/test_wheel.sh nx-cugraph python/nx-cugraph
diff --git a/ci/test_wheel_pylibcugraph.sh b/ci/test_wheel_pylibcugraph.sh
index d04cb358d21..ddc9976308b 100755
--- a/ci/test_wheel_pylibcugraph.sh
+++ b/ci/test_wheel_pylibcugraph.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (c) 2023, NVIDIA CORPORATION.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION.
set -eoxu pipefail
-./ci/test_wheel.sh pylibcugraph python/pylibcugraph
+./ci/test_wheel.sh pylibcugraph
diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh
new file mode 100755
index 00000000000..5ebac95a3f9
--- /dev/null
+++ b/ci/validate_wheel.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Copyright (c) 2024, NVIDIA CORPORATION.
+
+set -euo pipefail
+
+package_dir=$1
+wheel_dir_relative_path=$2
+
+RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
+
+# some packages are much larger on CUDA 11 than on CUDA 12
+if [[ "${package_dir}" == "python/cugraph" ]] || [[ "${package_dir}" == "python/pylibcugraph" ]]; then
+ if [[ "${RAPIDS_CUDA_MAJOR}" == "11" ]]; then
+ PYDISTCHECK_ARGS=(
+ --max-allowed-size-compressed '1.5G'
+ )
+ else
+ PYDISTCHECK_ARGS=(
+ --max-allowed-size-compressed '975M'
+ )
+ fi
+else
+ PYDISTCHECK_ARGS=()
+fi
+
+cd "${package_dir}"
+
+rapids-logger "validate packages with 'pydistcheck'"
+
+pydistcheck \
+ --inspect \
+ "${PYDISTCHECK_ARGS[@]}" \
+ "$(echo ${wheel_dir_relative_path}/*.whl)"
+
+rapids-logger "validate packages with 'twine'"
+
+twine check \
+ --strict \
+ "$(echo ${wheel_dir_relative_path}/*.whl)"
diff --git a/ci/wheel_smoke_test_nx-cugraph.py b/ci/wheel_smoke_test_nx-cugraph.py
deleted file mode 100644
index 10d26e3aac7..00000000000
--- a/ci/wheel_smoke_test_nx-cugraph.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2023, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import math
-
-import networkx as nx
-import nx_cugraph as nxcg
-
-
-if __name__ == "__main__":
- G = nx.Graph()
- G.add_edges_from([(0, 1), (1, 2), (2, 3)])
-
- nx_result = nx.betweenness_centrality(G)
- # nx_cugraph is intended to be called via the NetworkX dispatcher, like
- # this:
- # nxcu_result = nx.betweenness_centrality(G, backend="cugraph")
- #
- # but here it is being called directly since the NetworkX version that
- # supports the "backend" kwarg may not be available in the testing env.
- nxcu_result = nxcg.betweenness_centrality(G)
-
- nx_nodes, nxcu_nodes = nx_result.keys(), nxcu_result.keys()
- assert nxcu_nodes == nx_nodes
- for node_id in nx_nodes:
- nx_bc, nxcu_bc = nx_result[node_id], nxcu_result[node_id]
- assert math.isclose(nx_bc, nxcu_bc, rel_tol=1e-6), \
- f"bc for {node_id=} exceeds tolerance: {nx_bc=}, {nxcu_bc=}"
diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml
index af7cc33acff..23d09269a90 100644
--- a/conda/environments/all_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-118_arch-x86_64.yaml
@@ -4,37 +4,36 @@ channels:
- rapidsai
- rapidsai-nightly
- dask/label/dev
-- dglteam/label/th23_cu118
- conda-forge
- nvidia
dependencies:
- aiohttp
- breathe
- c-compiler
+- certifi
- cmake>=3.26.4,!=3.30.0
- cuda-nvtx
- cuda-version=11.8
- cudatoolkit
-- cudf==24.10.*
+- cudf==24.12.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
-- dask-cuda==24.10.*
-- dask-cudf==24.10.*
+- dask-cuda==24.12.*,>=0.0.0a0
+- dask-cudf==24.12.*,>=0.0.0a0
- doxygen
- fsspec>=0.6.0
- gcc_linux-64=11.*
- graphviz
- ipython
-- libcudf==24.10.*
-- libcugraphops==24.10.*
-- libraft-headers==24.10.*
-- libraft==24.10.*
-- librmm==24.10.*
+- libcudf==24.12.*,>=0.0.0a0
+- libcugraphops==24.12.*,>=0.0.0a0
+- libraft-headers==24.12.*,>=0.0.0a0
+- libraft==24.12.*,>=0.0.0a0
+- librmm==24.12.*,>=0.0.0a0
- nbsphinx
- nccl>=2.19
- networkx>=2.5.1
-- networkx>=3.0
- ninja
- notebook>=0.5.0
- numba>=0.57
@@ -47,22 +46,21 @@ dependencies:
- pre-commit
- pydantic
- pydata-sphinx-theme
-- pylibcugraphops==24.10.*
-- pylibraft==24.10.*
-- pylibwholegraph==24.10.*
+- pylibcugraphops==24.12.*,>=0.0.0a0
+- pylibraft==24.12.*,>=0.0.0a0
+- pylibwholegraph==24.12.*,>=0.0.0a0
- pytest
- pytest-benchmark
- pytest-cov
-- pytest-mpl
- pytest-xdist
- python-louvain
-- pytorch>=2.3,<2.4.0a0
-- raft-dask==24.10.*
+- pytorch>=2.3,<2.5a0
+- raft-dask==24.12.*,>=0.0.0a0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
-- rapids-dask-dependency==24.10.*
+- rapids-dask-dependency==24.12.*,>=0.0.0a0
- recommonmark
- requests
-- rmm==24.10.*
+- rmm==24.12.*,>=0.0.0a0
- scikit-build-core>=0.10.0
- scikit-learn>=0.23.1
- scipy
@@ -75,7 +73,7 @@ dependencies:
- torchdata
- torchmetrics
- ucx-proc=*=gpu
-- ucx-py==0.40.*
+- ucx-py==0.41.*,>=0.0.0a0
- wget
- wheel
name: all_cuda-118_arch-x86_64
diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml
index 557f9e7493d..afd4dec41c7 100644
--- a/conda/environments/all_cuda-125_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-125_arch-x86_64.yaml
@@ -4,43 +4,42 @@ channels:
- rapidsai
- rapidsai-nightly
- dask/label/dev
-- dglteam/label/th23_cu118
- conda-forge
- nvidia
dependencies:
- aiohttp
- breathe
- c-compiler
+- certifi
- cmake>=3.26.4,!=3.30.0
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
- cuda-version=12.5
-- cudf==24.10.*
+- cudf==24.12.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
-- dask-cuda==24.10.*
-- dask-cudf==24.10.*
+- dask-cuda==24.12.*,>=0.0.0a0
+- dask-cudf==24.12.*,>=0.0.0a0
- doxygen
- fsspec>=0.6.0
- gcc_linux-64=11.*
- graphviz
- ipython
- libcublas-dev
-- libcudf==24.10.*
-- libcugraphops==24.10.*
+- libcudf==24.12.*,>=0.0.0a0
+- libcugraphops==24.12.*,>=0.0.0a0
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
-- libraft-headers==24.10.*
-- libraft==24.10.*
-- librmm==24.10.*
+- libraft-headers==24.12.*,>=0.0.0a0
+- libraft==24.12.*,>=0.0.0a0
+- librmm==24.12.*,>=0.0.0a0
- nbsphinx
- nccl>=2.19
- networkx>=2.5.1
-- networkx>=3.0
- ninja
- notebook>=0.5.0
- numba>=0.57
@@ -52,22 +51,21 @@ dependencies:
- pre-commit
- pydantic
- pydata-sphinx-theme
-- pylibcugraphops==24.10.*
-- pylibraft==24.10.*
-- pylibwholegraph==24.10.*
+- pylibcugraphops==24.12.*,>=0.0.0a0
+- pylibraft==24.12.*,>=0.0.0a0
+- pylibwholegraph==24.12.*,>=0.0.0a0
- pytest
- pytest-benchmark
- pytest-cov
-- pytest-mpl
- pytest-xdist
- python-louvain
-- pytorch>=2.3,<2.4.0a0
-- raft-dask==24.10.*
+- pytorch>=2.3,<2.5a0
+- raft-dask==24.12.*,>=0.0.0a0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
-- rapids-dask-dependency==24.10.*
+- rapids-dask-dependency==24.12.*,>=0.0.0a0
- recommonmark
- requests
-- rmm==24.10.*
+- rmm==24.12.*,>=0.0.0a0
- scikit-build-core>=0.10.0
- scikit-learn>=0.23.1
- scipy
@@ -80,7 +78,7 @@ dependencies:
- torchdata
- torchmetrics
- ucx-proc=*=gpu
-- ucx-py==0.40.*
+- ucx-py==0.41.*,>=0.0.0a0
- wget
- wheel
name: all_cuda-125_arch-x86_64
diff --git a/conda/recipes/cugraph-dgl/build.sh b/conda/recipes/cugraph-dgl/build.sh
deleted file mode 100644
index 14d29b7eab9..00000000000
--- a/conda/recipes/cugraph-dgl/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2022, NVIDIA CORPORATION.
-
-# This assumes the script is executed from the root of the repo directory
-
-./build.sh cugraph-dgl
diff --git a/conda/recipes/cugraph-dgl/meta.yaml b/conda/recipes/cugraph-dgl/meta.yaml
deleted file mode 100644
index 0383fc8adf8..00000000000
--- a/conda/recipes/cugraph-dgl/meta.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (c) 2023-2024, NVIDIA CORPORATION.
-
-{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
-{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set py_version = environ['CONDA_PY'] %}
-{% set date_string = environ['RAPIDS_DATE_STRING'] %}
-
-package:
- name: cugraph-dgl
- version: {{ version }}
-
-source:
- path: ../../..
-
-build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
-
-requirements:
- host:
- - python
- - rapids-build-backend>=0.3.1,<0.4.0.dev0
- - setuptools>=61.0.0
- run:
- - cugraph ={{ version }}
- - dgl >=2.4.0.th23.cu*
- - numba >=0.57
- - numpy >=1.23,<3.0a0
- - pylibcugraphops ={{ minor_version }}
- - tensordict >=0.1.2
- - python
- - pytorch >=2.3,<2.4.0a0
- - cupy >=12.0.0
-
-tests:
- imports:
- - cugraph_dgl
-
-about:
- home: https://rapids.ai/
- dev_url: https://github.com/rapidsai/cugraph
- license: Apache-2.0
- license_file: ../../../LICENSE
- summary: cuGraph library
diff --git a/conda/recipes/cugraph-equivariant/build.sh b/conda/recipes/cugraph-equivariant/build.sh
deleted file mode 100644
index f0ff1688b55..00000000000
--- a/conda/recipes/cugraph-equivariant/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-# This assumes the script is executed from the root of the repo directory
-
-./build.sh cugraph-equivariant
diff --git a/conda/recipes/cugraph-equivariant/meta.yaml b/conda/recipes/cugraph-equivariant/meta.yaml
deleted file mode 100644
index 9dc9d51fa48..00000000000
--- a/conda/recipes/cugraph-equivariant/meta.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2024, NVIDIA CORPORATION.
-
-{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
-{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set py_version = environ['CONDA_PY'] %}
-{% set date_string = environ['RAPIDS_DATE_STRING'] %}
-
-package:
- name: cugraph-equivariant
- version: {{ version }}
-
-source:
- path: ../../..
-
-build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
-
-requirements:
- host:
- - python
- - rapids-build-backend>=0.3.1,<0.4.0.dev0
- - setuptools>=61.0.0
- run:
- - pylibcugraphops ={{ minor_version }}
- - python
-
-tests:
- imports:
- - cugraph_equivariant
-
-about:
- home: https://rapids.ai/
- dev_url: https://github.com/rapidsai/cugraph
- license: Apache-2.0
- license_file: ../../../LICENSE
- summary: GPU-accelerated equivariant convolutional layers.
diff --git a/conda/recipes/cugraph-pyg/build.sh b/conda/recipes/cugraph-pyg/build.sh
deleted file mode 100644
index ad2502985e5..00000000000
--- a/conda/recipes/cugraph-pyg/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2022, NVIDIA CORPORATION.
-
-# This assumes the script is executed from the root of the repo directory
-./build.sh cugraph-pyg --allgpuarch
diff --git a/conda/recipes/cugraph-pyg/conda_build_config.yaml b/conda/recipes/cugraph-pyg/conda_build_config.yaml
deleted file mode 100644
index 47d98b4800b..00000000000
--- a/conda/recipes/cugraph-pyg/conda_build_config.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2022, NVIDIA CORPORATION.
-
-c_compiler_version:
- - 11
-
-cxx_compiler_version:
- - 11
-
-cuda_compiler:
- - nvcc
-
-cmake_version:
- - ">=3.26.4,!=3.30.0"
-
-c_stdlib:
- - sysroot
-
-c_stdlib_version:
- - "2.17"
diff --git a/conda/recipes/cugraph-pyg/meta.yaml b/conda/recipes/cugraph-pyg/meta.yaml
deleted file mode 100644
index 7d3e503e23a..00000000000
--- a/conda/recipes/cugraph-pyg/meta.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2022-2024, NVIDIA CORPORATION.
-
-{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
-{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set py_version = environ['CONDA_PY'] %}
-{% set date_string = environ['RAPIDS_DATE_STRING'] %}
-
-package:
- name: cugraph-pyg
- version: {{ version }}
-
-source:
- path: ../../..
-
-build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
- script_env:
- - PARALLEL_LEVEL
-
-requirements:
- build:
- - {{ stdlib("c") }}
- host:
- - cython >=3.0.0
- - python
- - rapids-build-backend>=0.3.1,<0.4.0.dev0
- - setuptools>=61.0.0
- run:
- - rapids-dask-dependency ={{ minor_version }}
- - numba >=0.57
- - numpy >=1.23,<3.0a0
- - python
- - pytorch >=2.3,<2.4.0a0
- - cupy >=12.0.0
- - cugraph ={{ version }}
- - pylibcugraphops ={{ minor_version }}
- - tensordict >=0.1.2
- - pytorch_geometric >=2.5,<2.6
-
-tests:
- imports:
- - cugraph_pyg
-
-about:
- home: https://rapids.ai/
- dev_url: https://github.com/rapidsai/cugraph
- license: Apache-2.0
- license_file: ../../../LICENSE
- summary: cuGraph-pyg library
diff --git a/conda/recipes/cugraph-service/conda_build_config.yaml b/conda/recipes/cugraph-service/conda_build_config.yaml
index 2ac251ab10a..67ed3e26b0e 100644
--- a/conda/recipes/cugraph-service/conda_build_config.yaml
+++ b/conda/recipes/cugraph-service/conda_build_config.yaml
@@ -1,2 +1,2 @@
ucx_py_version:
- - "0.40.*"
+ - "0.41.*"
diff --git a/conda/recipes/cugraph/conda_build_config.yaml b/conda/recipes/cugraph/conda_build_config.yaml
index 2525441f92d..10f2e15c550 100644
--- a/conda/recipes/cugraph/conda_build_config.yaml
+++ b/conda/recipes/cugraph/conda_build_config.yaml
@@ -20,4 +20,4 @@ c_stdlib_version:
- "2.17"
ucx_py_version:
- - "0.40.*"
+ - "0.41.*"
diff --git a/conda/recipes/cugraph/meta.yaml b/conda/recipes/cugraph/meta.yaml
index 9f5a137faba..5a13ba30fd0 100644
--- a/conda/recipes/cugraph/meta.yaml
+++ b/conda/recipes/cugraph/meta.yaml
@@ -75,10 +75,10 @@ requirements:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
- - cuda-python >=11.7.1,<12.0a0
+ - cuda-python >=11.7.1,<12.0a0,<=11.8.3
{% else %}
- cuda-cudart
- - cuda-python >=12.0,<13.0a0
+ - cuda-python >=12.0,<13.0a0,<=12.6.0
{% endif %}
- cudf ={{ minor_version }}
- cupy >=12.0.0
diff --git a/conda/recipes/nx-cugraph/build.sh b/conda/recipes/nx-cugraph/build.sh
deleted file mode 100644
index 26665c1e76a..00000000000
--- a/conda/recipes/nx-cugraph/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2023, NVIDIA CORPORATION.
-
-# This assumes the script is executed from the root of the repo directory
-
-./build.sh nx-cugraph
diff --git a/conda/recipes/nx-cugraph/meta.yaml b/conda/recipes/nx-cugraph/meta.yaml
deleted file mode 100644
index 263f53d9a8f..00000000000
--- a/conda/recipes/nx-cugraph/meta.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2023-2024, NVIDIA CORPORATION.
-
-{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
-{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set py_version = environ['CONDA_PY'] %}
-{% set date_string = environ['RAPIDS_DATE_STRING'] %}
-
-package:
- name: nx-cugraph
- version: {{ version }}
-
-source:
- path: ../../..
-
-build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
-
-requirements:
- host:
- - python
- - rapids-build-backend>=0.3.1,<0.4.0.dev0
- - setuptools>=61.0.0
- run:
- - pylibcugraph ={{ version }}
- - networkx >=3.0
- - cupy >=12.0.0
- - python
-
-tests:
- imports:
- - nx_cugraph
- commands:
- - pip check
- requires:
- - pip
-
-about:
- home: https://rapids.ai/
- dev_url: https://github.com/rapidsai/cugraph
- license: Apache-2.0
- license_file: ../../../LICENSE
- summary: cuGraph backend for GPU-accelerated NetworkX
diff --git a/conda/recipes/pylibcugraph/conda_build_config.yaml b/conda/recipes/pylibcugraph/conda_build_config.yaml
index 2525441f92d..10f2e15c550 100644
--- a/conda/recipes/pylibcugraph/conda_build_config.yaml
+++ b/conda/recipes/pylibcugraph/conda_build_config.yaml
@@ -20,4 +20,4 @@ c_stdlib_version:
- "2.17"
ucx_py_version:
- - "0.40.*"
+ - "0.41.*"
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index b8eaba9d575..65772b4f5dd 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -54,17 +54,11 @@ option(BUILD_SHARED_LIBS "Build cuGraph shared libraries" ON)
option(BUILD_CUGRAPH_MG_TESTS "Build cuGraph multigpu algorithm tests" OFF)
option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF)
option(BUILD_TESTS "Configure CMake to build tests" ON)
-option(USE_CUGRAPH_OPS "Enable all functions that call cugraph-ops" ON)
option(USE_RAFT_STATIC "Build raft as a static library" OFF)
option(CUGRAPH_COMPILE_RAFT_LIB "Compile the raft library instead of using it header-only" ON)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF)
-option(CUGRAPH_USE_CUGRAPH_OPS_STATIC "Build and statically link the cugraph-ops library" OFF)
-option(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL "Exclude cugraph-ops targets from cuGraph's 'all' target" OFF)
-option(ALLOW_CLONE_CUGRAPH_OPS "Whether to attempt to clone cugraph-ops when a local version is not available" OFF)
message(VERBOSE "CUGRAPH: CUDA_STATIC_RUNTIME=${CUDA_STATIC_RUNTIME}")
-message(VERBOSE "CUGRAPH: CUGRAPH_USE_CUGRAPH_OPS_STATIC=${CUGRAPH_USE_CUGRAPH_OPS_STATIC}")
-message(VERBOSE "CUGRAPH: CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL=${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL}")
################################################################################
# - compiler options -----------------------------------------------------------
@@ -115,13 +109,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
list(APPEND CUGRAPH_CUDA_FLAGS -G -Xcompiler=-rdynamic)
endif()
-if(NOT USE_CUGRAPH_OPS)
- message(STATUS "Disabling functions that reference cugraph-ops")
- list(APPEND CUGRAPH_C_FLAGS -DNO_CUGRAPH_OPS)
- list(APPEND CUGRAPH_CXX_FLAGS -DNO_CUGRAPH_OPS)
- list(APPEND CUGRAPH_CUDA_FLAGS -DNO_CUGRAPH_OPS)
-endif()
-
###################################################################################################
# - find CPM based dependencies ------------------------------------------------------------------
@@ -151,10 +138,6 @@ include(${rapids-cmake-dir}/cpm/cuco.cmake)
rapids_cpm_cuco(BUILD_EXPORT_SET cugraph-exports INSTALL_EXPORT_SET cugraph-exports)
include(cmake/thirdparty/get_raft.cmake)
-if(USE_CUGRAPH_OPS)
- include(cmake/thirdparty/get_libcugraphops.cmake)
-endif()
-
if(BUILD_TESTS)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_gtest(BUILD_STATIC)
@@ -175,56 +158,41 @@ set(CUGRAPH_SOURCES
src/detail/permute_range_v32.cu
src/detail/permute_range_v64.cu
src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu
- src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu
src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu
src/detail/collect_local_vertex_values_sg_v32_e32.cu
- src/detail/collect_local_vertex_values_sg_v32_e64.cu
src/detail/collect_local_vertex_values_sg_v64_e64.cu
src/detail/collect_local_vertex_values_mg_v32_e32.cu
- src/detail/collect_local_vertex_values_mg_v32_e64.cu
src/detail/collect_local_vertex_values_mg_v64_e64.cu
src/detail/groupby_and_count_mg_v32_e32.cu
- src/detail/groupby_and_count_mg_v32_e64.cu
src/detail/groupby_and_count_mg_v64_e64.cu
src/detail/collect_comm_wrapper_mg_v32_e32.cu
src/detail/collect_comm_wrapper_mg_v64_e64.cu
+ src/sampling/detail/conversion_utilities.cu
src/sampling/random_walks_mg_v64_e64.cu
src/sampling/random_walks_mg_v32_e32.cu
- src/sampling/random_walks_mg_v32_e64.cu
src/community/detail/common_methods_mg_v64_e64.cu
src/community/detail/common_methods_mg_v32_e32.cu
- src/community/detail/common_methods_mg_v32_e64.cu
src/community/detail/common_methods_sg_v64_e64.cu
src/community/detail/common_methods_sg_v32_e32.cu
- src/community/detail/common_methods_sg_v32_e64.cu
src/community/detail/refine_sg_v64_e64.cu
src/community/detail/refine_sg_v32_e32.cu
- src/community/detail/refine_sg_v32_e64.cu
src/community/detail/refine_mg_v64_e64.cu
src/community/detail/refine_mg_v32_e32.cu
- src/community/detail/refine_mg_v32_e64.cu
src/community/edge_triangle_count_sg_v64_e64.cu
src/community/edge_triangle_count_sg_v32_e32.cu
- src/community/edge_triangle_count_sg_v32_e64.cu
src/community/edge_triangle_count_mg_v64_e64.cu
src/community/edge_triangle_count_mg_v32_e32.cu
- src/community/edge_triangle_count_mg_v32_e64.cu
src/community/detail/maximal_independent_moves_sg_v64_e64.cu
src/community/detail/maximal_independent_moves_sg_v32_e32.cu
- src/community/detail/maximal_independent_moves_sg_v32_e64.cu
src/community/detail/maximal_independent_moves_mg_v64_e64.cu
src/community/detail/maximal_independent_moves_mg_v32_e32.cu
- src/community/detail/maximal_independent_moves_mg_v32_e64.cu
src/detail/utility_wrappers_32.cu
src/detail/utility_wrappers_64.cu
src/structure/graph_view_mg_v64_e64.cu
src/structure/graph_view_mg_v32_e32.cu
- src/structure/graph_view_mg_v32_e64.cu
src/structure/remove_self_loops_sg_v32_e32.cu
- src/structure/remove_self_loops_sg_v32_e64.cu
src/structure/remove_self_loops_sg_v64_e64.cu
src/structure/remove_multi_edges_sg_v32_e32.cu
- src/structure/remove_multi_edges_sg_v32_e64.cu
src/structure/remove_multi_edges_sg_v64_e64.cu
src/utilities/path_retrieval_sg_v32_e32.cu
src/utilities/path_retrieval_sg_v64_e64.cu
@@ -232,127 +200,89 @@ set(CUGRAPH_SOURCES
src/linear_assignment/legacy/hungarian.cu
src/link_prediction/jaccard_sg_v64_e64.cu
src/link_prediction/jaccard_sg_v32_e32.cu
- src/link_prediction/jaccard_sg_v32_e64.cu
src/link_prediction/sorensen_sg_v64_e64.cu
src/link_prediction/sorensen_sg_v32_e32.cu
- src/link_prediction/sorensen_sg_v32_e64.cu
src/link_prediction/overlap_sg_v64_e64.cu
src/link_prediction/overlap_sg_v32_e32.cu
- src/link_prediction/overlap_sg_v32_e64.cu
src/link_prediction/cosine_sg_v64_e64.cu
src/link_prediction/cosine_sg_v32_e32.cu
- src/link_prediction/cosine_sg_v32_e64.cu
src/link_prediction/jaccard_mg_v64_e64.cu
src/link_prediction/jaccard_mg_v32_e32.cu
- src/link_prediction/jaccard_mg_v32_e64.cu
src/link_prediction/sorensen_mg_v64_e64.cu
src/link_prediction/sorensen_mg_v32_e32.cu
- src/link_prediction/sorensen_mg_v32_e64.cu
src/link_prediction/overlap_mg_v64_e64.cu
src/link_prediction/overlap_mg_v32_e32.cu
- src/link_prediction/overlap_mg_v32_e64.cu
src/link_prediction/cosine_mg_v64_e64.cu
src/link_prediction/cosine_mg_v32_e32.cu
- src/link_prediction/cosine_mg_v32_e64.cu
src/layout/legacy/force_atlas2.cu
src/converters/legacy/COOtoCSR.cu
src/community/legacy/spectral_clustering.cu
src/community/louvain_sg_v64_e64.cu
src/community/louvain_sg_v32_e32.cu
- src/community/louvain_sg_v32_e64.cu
src/community/louvain_mg_v64_e64.cu
src/community/louvain_mg_v32_e32.cu
- src/community/louvain_mg_v32_e64.cu
src/community/leiden_sg_v64_e64.cu
src/community/leiden_sg_v32_e32.cu
- src/community/leiden_sg_v32_e64.cu
src/community/leiden_mg_v64_e64.cu
src/community/leiden_mg_v32_e32.cu
- src/community/leiden_mg_v32_e64.cu
src/community/ecg_sg_v64_e64.cu
src/community/ecg_sg_v32_e32.cu
- src/community/ecg_sg_v32_e64.cu
src/community/ecg_mg_v64_e64.cu
src/community/ecg_mg_v32_e32.cu
- src/community/ecg_mg_v32_e64.cu
src/community/egonet_sg_v64_e64.cu
src/community/egonet_sg_v32_e32.cu
- src/community/egonet_sg_v32_e64.cu
src/community/egonet_mg_v64_e64.cu
src/community/egonet_mg_v32_e32.cu
- src/community/egonet_mg_v32_e64.cu
src/community/k_truss_sg_v64_e64.cu
src/community/k_truss_sg_v32_e32.cu
- src/community/k_truss_sg_v32_e64.cu
src/community/k_truss_mg_v64_e64.cu
src/community/k_truss_mg_v32_e32.cu
- src/community/k_truss_mg_v32_e64.cu
src/lookup/lookup_src_dst_mg_v32_e32.cu
- src/lookup/lookup_src_dst_mg_v32_e64.cu
src/lookup/lookup_src_dst_mg_v64_e64.cu
src/lookup/lookup_src_dst_sg_v32_e32.cu
- src/lookup/lookup_src_dst_sg_v32_e64.cu
src/lookup/lookup_src_dst_sg_v64_e64.cu
src/sampling/random_walks_old_sg_v32_e32.cu
- src/sampling/random_walks_old_sg_v32_e64.cu
src/sampling/random_walks_old_sg_v64_e64.cu
src/sampling/random_walks_sg_v64_e64.cu
src/sampling/random_walks_sg_v32_e32.cu
- src/sampling/random_walks_sg_v32_e64.cu
src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu
src/sampling/detail/prepare_next_frontier_sg_v32_e32.cu
src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu
src/sampling/detail/prepare_next_frontier_mg_v32_e32.cu
src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu
src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu
- src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu
src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu
src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu
- src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu
src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu
src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu
src/sampling/detail/check_edge_bias_values_sg_v64_e64.cu
src/sampling/detail/check_edge_bias_values_sg_v32_e32.cu
- src/sampling/detail/check_edge_bias_values_sg_v32_e64.cu
src/sampling/detail/check_edge_bias_values_mg_v64_e64.cu
src/sampling/detail/check_edge_bias_values_mg_v32_e32.cu
- src/sampling/detail/check_edge_bias_values_mg_v32_e64.cu
src/sampling/detail/sample_edges_sg_v64_e64.cu
src/sampling/detail/sample_edges_sg_v32_e32.cu
- src/sampling/detail/sample_edges_sg_v32_e64.cu
src/sampling/detail/sample_edges_mg_v64_e64.cu
src/sampling/detail/sample_edges_mg_v32_e32.cu
- src/sampling/detail/sample_edges_mg_v32_e64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu
src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu
- src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu
- src/sampling/neighbor_sampling_mg_v32_e64.cpp
- src/sampling/neighbor_sampling_mg_v32_e32.cpp
- src/sampling/neighbor_sampling_mg_v64_e64.cpp
- src/sampling/neighbor_sampling_sg_v32_e64.cpp
- src/sampling/neighbor_sampling_sg_v32_e32.cpp
- src/sampling/neighbor_sampling_sg_v64_e64.cpp
- src/sampling/negative_sampling_sg_v32_e64.cu
+ src/sampling/neighbor_sampling_mg_v32_e32.cu
+ src/sampling/neighbor_sampling_mg_v64_e64.cu
+ src/sampling/neighbor_sampling_sg_v32_e32.cu
+ src/sampling/neighbor_sampling_sg_v64_e64.cu
src/sampling/negative_sampling_sg_v32_e32.cu
src/sampling/negative_sampling_sg_v64_e64.cu
- src/sampling/negative_sampling_mg_v32_e64.cu
src/sampling/negative_sampling_mg_v32_e32.cu
src/sampling/negative_sampling_mg_v64_e64.cu
src/sampling/sampling_post_processing_sg_v64_e64.cu
src/sampling/sampling_post_processing_sg_v32_e32.cu
- src/sampling/sampling_post_processing_sg_v32_e64.cu
src/cores/core_number_sg_v64_e64.cu
src/cores/core_number_sg_v32_e32.cu
- src/cores/core_number_sg_v32_e64.cu
src/cores/core_number_mg_v64_e64.cu
src/cores/core_number_mg_v32_e32.cu
- src/cores/core_number_mg_v32_e64.cu
src/cores/k_core_sg_v64_e64.cu
src/cores/k_core_sg_v32_e32.cu
- src/cores/k_core_sg_v32_e64.cu
src/cores/k_core_mg_v64_e64.cu
src/cores/k_core_mg_v32_e32.cu
- src/cores/k_core_mg_v32_e64.cu
src/components/legacy/connectivity.cu
src/generators/generate_rmat_edgelist_sg_v32_e32.cu
src/generators/generate_rmat_edgelist_sg_v64_e64.cu
@@ -366,55 +296,38 @@ set(CUGRAPH_SOURCES
src/generators/erdos_renyi_generator_sg_v64_e64.cu
src/structure/graph_sg_v64_e64.cu
src/structure/graph_sg_v32_e32.cu
- src/structure/graph_sg_v32_e64.cu
src/structure/graph_mg_v64_e64.cu
src/structure/graph_mg_v32_e32.cu
- src/structure/graph_mg_v32_e64.cu
src/structure/graph_view_sg_v64_e64.cu
src/structure/graph_view_sg_v32_e32.cu
- src/structure/graph_view_sg_v32_e64.cu
src/structure/decompress_to_edgelist_sg_v64_e64.cu
src/structure/decompress_to_edgelist_sg_v32_e32.cu
- src/structure/decompress_to_edgelist_sg_v32_e64.cu
src/structure/decompress_to_edgelist_mg_v64_e64.cu
src/structure/decompress_to_edgelist_mg_v32_e32.cu
- src/structure/decompress_to_edgelist_mg_v32_e64.cu
src/structure/symmetrize_graph_sg_v64_e64.cu
src/structure/symmetrize_graph_sg_v32_e32.cu
- src/structure/symmetrize_graph_sg_v32_e64.cu
src/structure/symmetrize_graph_mg_v64_e64.cu
src/structure/symmetrize_graph_mg_v32_e32.cu
- src/structure/symmetrize_graph_mg_v32_e64.cu
src/structure/transpose_graph_sg_v64_e64.cu
src/structure/transpose_graph_sg_v32_e32.cu
- src/structure/transpose_graph_sg_v32_e64.cu
src/structure/transpose_graph_mg_v64_e64.cu
src/structure/transpose_graph_mg_v32_e32.cu
- src/structure/transpose_graph_mg_v32_e64.cu
src/structure/transpose_graph_storage_sg_v64_e64.cu
src/structure/transpose_graph_storage_sg_v32_e32.cu
- src/structure/transpose_graph_storage_sg_v32_e64.cu
src/structure/transpose_graph_storage_mg_v64_e64.cu
src/structure/transpose_graph_storage_mg_v32_e32.cu
- src/structure/transpose_graph_storage_mg_v32_e64.cu
src/structure/coarsen_graph_sg_v64_e64.cu
src/structure/coarsen_graph_sg_v32_e32.cu
- src/structure/coarsen_graph_sg_v32_e64.cu
src/structure/coarsen_graph_mg_v64_e64.cu
src/structure/coarsen_graph_mg_v32_e32.cu
- src/structure/coarsen_graph_mg_v32_e64.cu
src/structure/graph_weight_utils_mg_v64_e64.cu
src/structure/graph_weight_utils_mg_v32_e32.cu
- src/structure/graph_weight_utils_mg_v32_e64.cu
src/structure/graph_weight_utils_sg_v64_e64.cu
src/structure/graph_weight_utils_sg_v32_e32.cu
- src/structure/graph_weight_utils_sg_v32_e64.cu
src/structure/renumber_edgelist_sg_v64_e64.cu
src/structure/renumber_edgelist_sg_v32_e32.cu
- src/structure/renumber_edgelist_sg_v32_e64.cu
src/structure/renumber_edgelist_mg_v64_e64.cu
src/structure/renumber_edgelist_mg_v32_e32.cu
- src/structure/renumber_edgelist_mg_v32_e64.cu
src/structure/renumber_utils_sg_v64_e64.cu
src/structure/renumber_utils_sg_v32_e32.cu
src/structure/renumber_utils_mg_v64_e64.cu
@@ -425,115 +338,80 @@ set(CUGRAPH_SOURCES
src/structure/relabel_mg_v32_e32.cu
src/structure/induced_subgraph_sg_v64_e64.cu
src/structure/induced_subgraph_sg_v32_e32.cu
- src/structure/induced_subgraph_sg_v32_e64.cu
src/structure/induced_subgraph_mg_v64_e64.cu
src/structure/induced_subgraph_mg_v32_e32.cu
- src/structure/induced_subgraph_mg_v32_e64.cu
src/structure/select_random_vertices_sg_v64_e64.cu
src/structure/select_random_vertices_sg_v32_e32.cu
- src/structure/select_random_vertices_sg_v32_e64.cu
src/structure/select_random_vertices_mg_v64_e64.cu
src/structure/select_random_vertices_mg_v32_e32.cu
- src/structure/select_random_vertices_mg_v32_e64.cu
src/traversal/extract_bfs_paths_sg_v64_e64.cu
src/traversal/extract_bfs_paths_sg_v32_e32.cu
- src/traversal/extract_bfs_paths_sg_v32_e64.cu
src/traversal/extract_bfs_paths_mg_v64_e64.cu
src/traversal/extract_bfs_paths_mg_v32_e32.cu
- src/traversal/extract_bfs_paths_mg_v32_e64.cu
src/traversal/bfs_sg_v64_e64.cu
src/traversal/bfs_sg_v32_e32.cu
- src/traversal/bfs_sg_v32_e64.cu
src/traversal/bfs_mg_v64_e64.cu
src/traversal/bfs_mg_v32_e32.cu
- src/traversal/bfs_mg_v32_e64.cu
src/traversal/sssp_sg_v64_e64.cu
src/traversal/sssp_sg_v32_e32.cu
- src/traversal/sssp_sg_v32_e64.cu
src/traversal/od_shortest_distances_sg_v64_e64.cu
src/traversal/od_shortest_distances_sg_v32_e32.cu
- src/traversal/od_shortest_distances_sg_v32_e64.cu
src/traversal/sssp_mg_v64_e64.cu
src/traversal/sssp_mg_v32_e32.cu
- src/traversal/sssp_mg_v32_e64.cu
src/link_analysis/hits_sg_v64_e64.cu
src/link_analysis/hits_sg_v32_e32.cu
- src/link_analysis/hits_sg_v32_e64.cu
src/link_analysis/hits_mg_v64_e64.cu
src/link_analysis/hits_mg_v32_e32.cu
- src/link_analysis/hits_mg_v32_e64.cu
src/link_analysis/pagerank_sg_v64_e64.cu
src/link_analysis/pagerank_sg_v32_e32.cu
- src/link_analysis/pagerank_sg_v32_e64.cu
src/link_analysis/pagerank_mg_v64_e64.cu
src/link_analysis/pagerank_mg_v32_e32.cu
- src/link_analysis/pagerank_mg_v32_e64.cu
src/centrality/katz_centrality_sg_v64_e64.cu
src/centrality/katz_centrality_sg_v32_e32.cu
- src/centrality/katz_centrality_sg_v32_e64.cu
src/centrality/katz_centrality_mg_v64_e64.cu
src/centrality/katz_centrality_mg_v32_e32.cu
- src/centrality/katz_centrality_mg_v32_e64.cu
src/centrality/eigenvector_centrality_sg_v64_e64.cu
src/centrality/eigenvector_centrality_sg_v32_e32.cu
- src/centrality/eigenvector_centrality_sg_v32_e64.cu
src/centrality/eigenvector_centrality_mg_v64_e64.cu
src/centrality/eigenvector_centrality_mg_v32_e32.cu
- src/centrality/eigenvector_centrality_mg_v32_e64.cu
src/centrality/betweenness_centrality_sg_v64_e64.cu
src/centrality/betweenness_centrality_sg_v32_e32.cu
- src/centrality/betweenness_centrality_sg_v32_e64.cu
src/centrality/betweenness_centrality_mg_v64_e64.cu
src/centrality/betweenness_centrality_mg_v32_e32.cu
- src/centrality/betweenness_centrality_mg_v32_e64.cu
src/tree/legacy/mst.cu
src/from_cugraph_ops/sampling_index.cu
src/components/weakly_connected_components_sg_v64_e64.cu
src/components/weakly_connected_components_sg_v32_e32.cu
- src/components/weakly_connected_components_sg_v32_e64.cu
src/components/weakly_connected_components_mg_v64_e64.cu
src/components/weakly_connected_components_mg_v32_e32.cu
- src/components/weakly_connected_components_mg_v32_e64.cu
src/components/mis_sg_v64_e64.cu
src/components/mis_sg_v32_e32.cu
- src/components/mis_sg_v32_e64.cu
src/components/mis_mg_v64_e64.cu
src/components/mis_mg_v32_e32.cu
- src/components/mis_mg_v32_e64.cu
src/components/vertex_coloring_sg_v64_e64.cu
src/components/vertex_coloring_sg_v32_e32.cu
- src/components/vertex_coloring_sg_v32_e64.cu
src/components/vertex_coloring_mg_v64_e64.cu
src/components/vertex_coloring_mg_v32_e32.cu
- src/components/vertex_coloring_mg_v32_e64.cu
src/structure/create_graph_from_edgelist_sg_v64_e64.cu
src/structure/create_graph_from_edgelist_sg_v32_e32.cu
- src/structure/create_graph_from_edgelist_sg_v32_e64.cu
src/structure/create_graph_from_edgelist_mg_v64_e64.cu
src/structure/create_graph_from_edgelist_mg_v32_e32.cu
- src/structure/create_graph_from_edgelist_mg_v32_e64.cu
src/structure/symmetrize_edgelist_sg_v64_e64.cu
src/structure/symmetrize_edgelist_sg_v32_e32.cu
src/structure/symmetrize_edgelist_mg_v64_e64.cu
src/structure/symmetrize_edgelist_mg_v32_e32.cu
src/community/triangle_count_sg_v64_e64.cu
src/community/triangle_count_sg_v32_e32.cu
- src/community/triangle_count_sg_v32_e64.cu
src/community/triangle_count_mg_v64_e64.cu
src/community/triangle_count_mg_v32_e32.cu
- src/community/triangle_count_mg_v32_e64.cu
src/community/approx_weighted_matching_sg_v64_e64.cu
src/community/approx_weighted_matching_sg_v32_e32.cu
- src/community/approx_weighted_matching_sg_v32_e64.cu
src/community/approx_weighted_matching_mg_v64_e64.cu
src/community/approx_weighted_matching_mg_v32_e32.cu
- src/community/approx_weighted_matching_mg_v32_e64.cu
src/traversal/k_hop_nbrs_sg_v64_e64.cu
src/traversal/k_hop_nbrs_sg_v32_e32.cu
- src/traversal/k_hop_nbrs_sg_v32_e64.cu
src/traversal/k_hop_nbrs_mg_v64_e64.cu
src/traversal/k_hop_nbrs_mg_v32_e32.cu
- src/traversal/k_hop_nbrs_mg_v32_e64.cu
src/mtmg/vertex_result_sg_v32_e32.cu
src/mtmg/vertex_result_sg_v64_e64.cu
src/mtmg/vertex_result_mg_v32_e32.cu
@@ -544,12 +422,6 @@ set(CUGRAPH_SOURCES
src/mtmg/vertex_pairs_result_mg_v64_e64.cu
)
-if(USE_CUGRAPH_OPS)
- list(APPEND CUGRAPH_SOURCES
- src/sampling/neighborhood.cu
- )
-endif()
-
add_library(cugraph ${CUGRAPH_SOURCES})
set_target_properties(cugraph
@@ -666,6 +538,8 @@ add_library(cugraph_c
src/c_api/weakly_connected_components.cpp
src/c_api/strongly_connected_components.cpp
src/c_api/allgather.cpp
+ src/c_api/decompress_to_edgelist.cpp
+ src/c_api/edgelist.cpp
)
add_library(cugraph::cugraph_c ALIAS cugraph_c)
diff --git a/cpp/cmake/thirdparty/get_libcugraphops.cmake b/cpp/cmake/thirdparty/get_libcugraphops.cmake
deleted file mode 100644
index b10af300a98..00000000000
--- a/cpp/cmake/thirdparty/get_libcugraphops.cmake
+++ /dev/null
@@ -1,83 +0,0 @@
-#=============================================================================
-# Copyright (c) 2022, 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
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#=============================================================================
-
-set(CUGRAPH_MIN_VERSION_cugraph_ops "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00")
-
-if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_VERSION)
- set(CUGRAPH_CUGRAPH_OPS_VERSION "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}")
-endif()
-
-if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_BRANCH)
- set(CUGRAPH_CUGRAPH_OPS_BRANCH "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}")
-endif()
-
-if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_REPOSITORY)
- set(CUGRAPH_CUGRAPH_OPS_REPOSITORY "git@github.com:rapidsai/cugraph-ops.git")
-endif()
-
-function(find_and_configure_cugraph_ops)
-
- set(oneValueArgs VERSION REPO PINNED_TAG BUILD_STATIC EXCLUDE_FROM_ALL ALLOW_CLONE_CUGRAPH_OPS)
- cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN})
-
- if(PKG_ALLOW_CLONE_CUGRAPH_OPS)
- if(NOT PKG_PINNED_TAG STREQUAL "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}")
- message("Pinned tag found: ${PKG_PINNED_TAG}. Cloning cugraph-ops locally.")
- set(CPM_DOWNLOAD_cugraph-ops ON)
- elseif(PKG_BUILD_STATIC AND (NOT CPM_cugraph-ops_SOURCE))
- message(STATUS "CUGRAPH: Cloning cugraph-ops locally to build static libraries.")
- set(CPM_DOWNLOAD_cugraph-ops ON)
- endif()
- endif()
-
- set(CUGRAPH_OPS_BUILD_SHARED_LIBS ON)
- if(PKG_BUILD_STATIC)
- set(CUGRAPH_OPS_BUILD_SHARED_LIBS OFF)
- endif()
-
- rapids_cpm_find(cugraph-ops ${PKG_VERSION} REQUIRED
- GLOBAL_TARGETS cugraph-ops::cugraph-ops++
- BUILD_EXPORT_SET cugraph-exports
- INSTALL_EXPORT_SET cugraph-exports
- CPM_ARGS
- SOURCE_SUBDIR cpp
- GIT_REPOSITORY ${PKG_REPO}
- GIT_TAG ${PKG_PINNED_TAG}
- EXCLUDE_FROM_ALL ${PKG_EXCLUDE_FROM_ALL}
- OPTIONS
- "BUILD_CUGRAPH_OPS_CPP_TESTS OFF"
- "BUILD_SHARED_LIBS ${CUGRAPH_OPS_BUILD_SHARED_LIBS}"
- )
-endfunction()
-
-###
-# Change pinned tag and fork here to test a commit in CI
-#
-# To use a locally-built cugraph-ops package, set the CMake variable
-# `-D cugraph-ops_ROOT=/path/to/cugraph-ops/build`
-###
-find_and_configure_cugraph_ops(VERSION ${CUGRAPH_MIN_VERSION_cugraph_ops}
- REPO ${CUGRAPH_CUGRAPH_OPS_REPOSITORY}
- PINNED_TAG ${CUGRAPH_CUGRAPH_OPS_BRANCH}
- BUILD_STATIC ${CUGRAPH_USE_CUGRAPH_OPS_STATIC}
- EXCLUDE_FROM_ALL ${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL}
- # Allow cloning cugraph-ops in cases when we
- # expect the local copy of cugraph-ops to not be
- # the one that we want. Cases include static
- # linking such that we need to compile a static
- # lib or during development when using a
- # different branch of cugraph-ops.
- ALLOW_CLONE_CUGRAPH_OPS ${ALLOW_CLONE_CUGRAPH_OPS})
diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp
index 7e5af4ac686..60f4d21822f 100644
--- a/cpp/include/cugraph/algorithms.hpp
+++ b/cpp/include/cugraph/algorithms.hpp
@@ -23,16 +23,12 @@
#include
#include
-#include
-
-#ifndef NO_CUGRAPH_OPS
-#include
-#endif
-
#include
#include
#include
+#include
+
#include
#include
@@ -1678,72 +1674,6 @@ node2vec_random_walks(raft::handle_t const& handle,
weight_t p,
weight_t q);
-#ifndef NO_CUGRAPH_OPS
-/**
- * @brief generate sub-sampled graph as an adjacency list (CSR format) given input graph,
- * list of vertices and sample size per vertex. The output graph consists of the given
- * vertices with each vertex having at most `sample_size` neighbors from the original graph
- *
- * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead.
- *
- * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and
- * single-gpu).
- * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
- * handles to various CUDA libraries) to run graph algorithms.
- * @param rng_state The RngState instance holding pseudo-random number generator state.
- * @param graph Graph (view )object to sub-sample.
- * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling.
- * @param num_start_vertices = number(vertices) to use for sub-sampling.
- * @param sampling_size = max number of neighbors per output vertex.
- * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs.
- * @return std::tuple,
- * rmm::device_uvector>
- * Tuple consisting of two arrays representing the offsets and indices of
- * the sub-sampled graph.
- */
-template
-std::tuple, rmm::device_uvector>
-sample_neighbors_adjacency_list(raft::handle_t const& handle,
- raft::random::RngState& rng_state,
- graph_view_t const& graph_view,
- vertex_t const* ptr_d_start,
- size_t num_start_vertices,
- size_t sampling_size,
- ops::graph::SamplingAlgoT sampling_algo);
-
-/**
- * @brief generate sub-sampled graph as an edge list (COO format) given input graph,
- * list of vertices and sample size per vertex. The output graph consists of the given
- * vertices with each vertex having at most `sample_size` neighbors from the original graph
- *
- * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead.
- *
- * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and
- * single-gpu).
- * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
- * handles to various CUDA libraries) to run graph algorithms.
- * @param rng_state The RngState instance holding pseudo-random number generator state.
- * @param graph Graph (view )object to sub-sample.
- * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling.
- * @param num_start_vertices = number(vertices) to use for sub-sampling.
- * @param sampling_size = max number of neighbors per output vertex.
- * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs.
- * @return std::tuple,
- * rmm::device_uvector>
- * Tuple consisting of two arrays representing the source and destination nodes of
- * the sub-sampled graph.
- */
-template
-std::tuple, rmm::device_uvector> sample_neighbors_edgelist(
- raft::handle_t const& handle,
- raft::random::RngState& rng_state,
- graph_view_t const& graph_view,
- vertex_t const* ptr_d_start,
- size_t num_start_vertices,
- size_t sampling_size,
- ops::graph::SamplingAlgoT sampling_algo);
-#endif
-
/**
* @brief Finds (weakly-connected-)component IDs of each vertices in the input graph.
*
diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp
index 3d99b85556b..b1afeafd66b 100644
--- a/cpp/include/cugraph/detail/utility_wrappers.hpp
+++ b/cpp/include/cugraph/detail/utility_wrappers.hpp
@@ -65,6 +65,48 @@ void uniform_random_fill(rmm::cuda_stream_view const& stream_view,
template
void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, value_t value);
+/**
+ * @brief Sort a device span
+ *
+ * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t.
+ *
+ * @param [in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator,
+ * and handles to various CUDA libraries) to run graph algorithms.
+ * @param[out] values device span to sort
+ *
+ */
+template
+void sort_ints(raft::handle_t const& handle, raft::device_span values);
+
+/**
+ * @brief Keep unique element from a device span
+ *
+ * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t.
+ *
+ * @param [in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator,
+ * and handles to various CUDA libraries) to run graph algorithms.
+ * @param[in] values device span of unique elements.
+ * @return the number of unique elements.
+ *
+ */
+template
+size_t unique_ints(raft::handle_t const& handle, raft::device_span values);
+
+/**
+ * @brief Increment the values of a device span by a constant value
+ *
+ * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t.
+ *
+ * @param[out] values device span to update
+ * @param[in] value value to be added to each element of the buffer
+ * @param[in] stream_view stream view
+ *
+ */
+template
+void transform_increment_ints(raft::device_span values,
+ value_t value,
+ rmm::cuda_stream_view const& stream_view);
+
/**
* @brief Fill a buffer with a sequence of values
*
@@ -73,7 +115,7 @@ void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, va
*
* Similar to the function std::iota, wraps the function thrust::sequence
*
- * @tparam value_t type of the value to operate on
+ * @tparam value_t type of the value to operate on.
*
* @param[in] stream_view stream view
* @param[out] d_value device array to fill
diff --git a/cpp/include/cugraph/edge_partition_device_view.cuh b/cpp/include/cugraph/edge_partition_device_view.cuh
index 583b0a37214..628c3cc10cc 100644
--- a/cpp/include/cugraph/edge_partition_device_view.cuh
+++ b/cpp/include/cugraph/edge_partition_device_view.cuh
@@ -204,6 +204,7 @@ class edge_partition_device_view_t view)
: detail::edge_partition_device_view_base_t(view.offsets(), view.indices()),
dcs_nzd_vertices_(detail::to_thrust_optional(view.dcs_nzd_vertices())),
+ dcs_nzd_range_bitmap_(detail::to_thrust_optional(view.dcs_nzd_range_bitmap())),
major_hypersparse_first_(detail::to_thrust_optional(view.major_hypersparse_first())),
major_range_first_(view.major_range_first()),
major_range_last_(view.major_range_last()),
@@ -218,6 +219,7 @@ class edge_partition_device_view_t());
}
+ template
+ __host__ void compute_number_of_edges_async(MajorIterator major_first,
+ MajorIterator major_last,
+ raft::device_span count /* size = 1 */,
+ rmm::cuda_stream_view stream) const
+ {
+ if (thrust::distance(major_first, major_last) == 0) {
+ RAFT_CUDA_TRY(cudaMemsetAsync(count.data(), 0, sizeof(size_t), stream));
+ }
+
+ rmm::device_uvector d_tmp_storage(0, stream);
+ size_t tmp_storage_bytes{0};
+
+ if (dcs_nzd_vertices_) {
+ auto local_degree_first = thrust::make_transform_iterator(
+ major_first,
+ detail::local_degree_op_t{
+ this->offsets_, major_range_first_, *dcs_nzd_vertices_, *major_hypersparse_first_});
+ cub::DeviceReduce::Sum(static_cast(nullptr),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ d_tmp_storage.resize(tmp_storage_bytes, stream);
+ cub::DeviceReduce::Sum(d_tmp_storage.data(),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ } else {
+ auto local_degree_first = thrust::make_transform_iterator(
+ major_first,
+ detail::local_degree_op_t{
+ this->offsets_, major_range_first_, std::byte{0} /* dummy */, std::byte{0} /* dummy */});
+ cub::DeviceReduce::Sum(static_cast(nullptr),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ d_tmp_storage.resize(tmp_storage_bytes, stream);
+ cub::DeviceReduce::Sum(d_tmp_storage.data(),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ }
+ }
+
__host__ rmm::device_uvector compute_local_degrees(rmm::cuda_stream_view stream) const
{
rmm::device_uvector local_degrees(this->major_range_size(), stream);
if (dcs_nzd_vertices_) {
assert(major_hypersparse_first_);
- thrust::transform(rmm::exec_policy(stream),
+ thrust::transform(rmm::exec_policy_nosync(stream),
thrust::make_counting_iterator(this->major_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -266,7 +328,7 @@ class edge_partition_device_view_tmajor_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -284,7 +346,7 @@ class edge_partition_device_view_t local_degrees(thrust::distance(major_first, major_last), stream);
if (dcs_nzd_vertices_) {
assert(major_hypersparse_first_);
- thrust::transform(rmm::exec_policy(stream),
+ thrust::transform(rmm::exec_policy_nosync(stream),
major_first,
major_last,
local_degrees.begin(),
@@ -295,7 +357,7 @@ class edge_partition_device_view_tmajor_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -368,7 +431,7 @@ class edge_partition_device_view_tmajor_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -394,7 +457,7 @@ class edge_partition_device_view_t> for consistency (see
+ // dcs_nzd_range_bitmap())
__host__ __device__ thrust::optional dcs_nzd_vertices() const
{
return dcs_nzd_vertices_ ? thrust::optional{(*dcs_nzd_vertices_).data()}
@@ -528,10 +593,20 @@ class edge_partition_device_view_t> dcs_nzd_range_bitmap()
+ const
+ {
+ return dcs_nzd_range_bitmap_
+ ? thrust::make_optional>(
+ (*dcs_nzd_range_bitmap_).data(), (*dcs_nzd_range_bitmap_).size())
+ : thrust::nullopt;
+ }
+
private:
// should be trivially copyable to device
thrust::optional> dcs_nzd_vertices_{thrust::nullopt};
+ thrust::optional> dcs_nzd_range_bitmap_{thrust::nullopt};
thrust::optional major_hypersparse_first_{thrust::nullopt};
vertex_t major_range_first_{0};
@@ -558,6 +633,7 @@ class edge_partition_device_view_t());
}
+ template
+ __host__ void compute_number_of_edges_async(MajorIterator major_first,
+ MajorIterator major_last,
+ raft::device_span count /* size = 1 */,
+ rmm::cuda_stream_view stream) const
+ {
+ if (thrust::distance(major_first, major_last) == 0) {
+ RAFT_CUDA_TRY(cudaMemsetAsync(count.data(), 0, sizeof(size_t), stream));
+ }
+
+ rmm::device_uvector d_tmp_storage(0, stream);
+ size_t tmp_storage_bytes{0};
+
+ auto local_degree_first = thrust::make_transform_iterator(
+ major_first,
+ detail::local_degree_op_t{this->offsets_,
+ std::byte{0} /* dummy */,
+ std::byte{0} /* dummy */,
+ std::byte{0} /* dummy */});
+ cub::DeviceReduce::Sum(static_cast(nullptr),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ d_tmp_storage.resize(tmp_storage_bytes, stream);
+ cub::DeviceReduce::Sum(d_tmp_storage.data(),
+ tmp_storage_bytes,
+ local_degree_first,
+ count.data(),
+ thrust::distance(major_first, major_last),
+ stream);
+ }
+
__host__ rmm::device_uvector compute_local_degrees(rmm::cuda_stream_view stream) const
{
rmm::device_uvector local_degrees(this->major_range_size(), stream);
- thrust::transform(rmm::exec_policy(stream),
+ thrust::transform(rmm::exec_policy_nosync(stream),
thrust::make_counting_iterator(this->major_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -595,7 +709,7 @@ class edge_partition_device_view_t local_degrees(thrust::distance(major_first, major_last), stream);
- thrust::transform(rmm::exec_policy(stream),
+ thrust::transform(rmm::exec_policy_nosync(stream),
major_first,
major_last,
local_degrees.begin(),
@@ -613,6 +727,7 @@ class edge_partition_device_view_t local_degrees(this->major_range_size(), stream);
thrust::transform(
- rmm::exec_policy(stream),
+ rmm::exec_policy_nosync(stream),
thrust::make_counting_iterator(this->major_range_first()),
thrust::make_counting_iterator(this->major_range_last()),
local_degrees.begin(),
@@ -660,7 +775,7 @@ class edge_partition_device_view_t local_degrees(thrust::distance(major_first, major_last), stream);
thrust::transform(
- rmm::exec_policy(stream),
+ rmm::exec_policy_nosync(stream),
major_first,
major_last,
local_degrees.begin(),
diff --git a/cpp/include/cugraph/edge_partition_view.hpp b/cpp/include/cugraph/edge_partition_view.hpp
index 42465273718..27c5705dfcc 100644
--- a/cpp/include/cugraph/edge_partition_view.hpp
+++ b/cpp/include/cugraph/edge_partition_view.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2022, NVIDIA CORPORATION.
+ * Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@ class edge_partition_view_t offsets,
raft::device_span indices,
std::optional> dcs_nzd_vertices,
+ std::optional> dcs_nzd_range_bitmap,
std::optional major_hypersparse_first,
vertex_t major_range_first,
vertex_t major_range_last,
@@ -64,6 +65,7 @@ class edge_partition_view_t(offsets, indices),
dcs_nzd_vertices_(dcs_nzd_vertices),
+ dcs_nzd_range_bitmap_(dcs_nzd_range_bitmap),
major_hypersparse_first_(major_hypersparse_first),
major_range_first_(major_range_first),
major_range_last_(major_range_last),
@@ -78,6 +80,11 @@ class edge_partition_view_t> dcs_nzd_range_bitmap() const
+ {
+ return dcs_nzd_range_bitmap_;
+ }
+
std::optional major_hypersparse_first() const { return major_hypersparse_first_; }
vertex_t major_range_first() const { return major_range_first_; }
@@ -90,6 +97,7 @@ class edge_partition_view_t> dcs_nzd_vertices_{std::nullopt};
+ std::optional> dcs_nzd_range_bitmap_{std::nullopt};
std::optional major_hypersparse_first_{std::nullopt};
vertex_t major_range_first_{0};
diff --git a/cpp/include/cugraph/graph.hpp b/cpp/include/cugraph/graph.hpp
index 0607b39153d..290f4b3c4db 100644
--- a/cpp/include/cugraph/graph.hpp
+++ b/cpp/include/cugraph/graph.hpp
@@ -48,6 +48,7 @@ struct graph_meta_t> {
partition_t partition{};
std::vector edge_partition_segment_offsets{};
+ std::optional> edge_partition_hypersparse_degree_offsets{};
vertex_t num_local_unique_edge_srcs{};
vertex_t num_local_unique_edge_dsts{};
@@ -61,6 +62,7 @@ struct graph_meta_t> {
// segment offsets based on vertex degree, relevant only if vertex IDs are renumbered
std::optional> segment_offsets{std::nullopt};
+ std::optional> hypersparse_degree_offsets{std::nullopt};
};
// graph_t is an owning graph class (note that graph_view_t is a non-owning graph class)
@@ -101,6 +103,11 @@ class graph_t>>(
(*edge_partition_dcs_nzd_vertices_).size())
: std::nullopt;
+ auto dcs_nzd_range_bitmaps =
+ edge_partition_dcs_nzd_range_bitmaps_
+ ? std::make_optional>>(
+ (*edge_partition_dcs_nzd_range_bitmaps_).size())
+ : std::nullopt;
for (size_t i = 0; i < offsets.size(); ++i) {
offsets[i] = raft::device_span(edge_partition_offsets_[i].data(),
edge_partition_offsets_[i].size());
@@ -111,6 +118,11 @@ class graph_t((*edge_partition_dcs_nzd_vertices_)[i].data(),
(*edge_partition_dcs_nzd_vertices_)[i].size());
}
+ if (dcs_nzd_range_bitmaps) {
+ (*dcs_nzd_range_bitmaps)[i] =
+ raft::device_span((*edge_partition_dcs_nzd_range_bitmaps_)[i].data(),
+ (*edge_partition_dcs_nzd_range_bitmaps_)[i].size());
+ }
}
std::conditional_t{
this->number_of_vertices(),
this->number_of_edges(),
this->properties_,
partition_,
edge_partition_segment_offsets_,
+ edge_partition_hypersparse_degree_offsets_,
local_sorted_unique_edge_srcs,
local_sorted_unique_edge_src_chunk_start_offsets,
local_sorted_unique_edge_src_chunk_size_,
@@ -224,10 +238,13 @@ class graph_t>> edge_partition_dcs_nzd_vertices_{
std::nullopt};
+ std::optional>> edge_partition_dcs_nzd_range_bitmaps_{
+ std::nullopt};
partition_t partition_{};
// segment offsets within the vertex partition based on vertex degree
std::vector edge_partition_segment_offsets_{};
+ std::optional> edge_partition_hypersparse_degree_offsets_{};
// if valid, store row/column properties in key/value pairs (this saves memory if # unique edge
// sources/destinations << V / major_comm_size|minor_comm_size).
@@ -290,7 +307,11 @@ class graph_t(offsets_.data(), offsets_.size()),
raft::device_span(indices_.data(), indices_.size()),
graph_view_meta_t{
- this->number_of_vertices(), this->number_of_edges(), this->properties_, segment_offsets_});
+ this->number_of_vertices(),
+ this->number_of_edges(),
+ this->properties_,
+ segment_offsets_,
+ hypersparse_degree_offsets_});
}
private:
@@ -299,6 +320,7 @@ class graph_t> segment_offsets_{};
+ std::optional> hypersparse_degree_offsets_{};
};
template
diff --git a/cpp/include/cugraph/graph_functions.hpp b/cpp/include/cugraph/graph_functions.hpp
index 866ab16ee97..6a03b9a6454 100644
--- a/cpp/include/cugraph/graph_functions.hpp
+++ b/cpp/include/cugraph/graph_functions.hpp
@@ -41,11 +41,13 @@ struct renumber_meta_t>
edge_t number_of_edges{};
partition_t partition{};
std::vector edge_partition_segment_offsets{};
+ std::optional> edge_partition_hypersparse_degree_offsets{};
};
template
struct renumber_meta_t> {
std::vector segment_offsets{};
+ std::optional> hypersparse_degree_offsets{};
};
/**
@@ -244,7 +246,7 @@ void unrenumber_int_vertices(raft::handle_t const& handle,
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -284,7 +286,7 @@ std::enable_if_t unrenumber_local_int_edges(
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -346,7 +348,7 @@ void renumber_local_ext_vertices(raft::handle_t const& handle,
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam edge_type_t Type of edge types. Needs to be an integral type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -388,7 +390,7 @@ decompress_to_edgelist(
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -421,7 +423,7 @@ symmetrize_edgelist(raft::handle_t const& handle,
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -463,7 +465,7 @@ symmetrize_graph(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -505,7 +507,7 @@ transpose_graph(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -549,7 +551,7 @@ transpose_graph_storage(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -625,7 +627,7 @@ void relabel(raft::handle_t const& handle,
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -678,7 +680,7 @@ extract_induced_subgraphs(
* @tparam edge_type_t Type of edge type. Needs to be an integral type, currently only int32_t is
* supported
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -743,7 +745,7 @@ create_graph_from_edgelist(raft::handle_t const& handle,
* @tparam edge_type_t Type of edge type. Needs to be an integral type, currently only int32_t is
* supported
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -807,7 +809,7 @@ create_graph_from_edgelist(
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -829,7 +831,7 @@ std::tuple, rmm::device_uvector> get_two
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -856,7 +858,7 @@ rmm::device_uvector compute_in_weight_sums(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -883,7 +885,7 @@ rmm::device_uvector compute_out_weight_sums(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -910,7 +912,7 @@ weight_t compute_max_in_weight_sum(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -937,7 +939,7 @@ weight_t compute_max_out_weight_sum(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -963,7 +965,7 @@ weight_t compute_total_edge_weight(
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if
- * true) as major indices in storing edges using a 2D sparse matrix. transposed.
+ * true) as major indices in storing edges using a 2D sparse matrix.
* @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
* or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
@@ -1114,7 +1116,8 @@ shuffle_external_vertex_value_pairs(raft::handle_t const& handle,
* @param edge_ids Optional list of edge ids
* @param edge_types Optional list of edge types
* @return Tuple of vectors storing edge sources, destinations, optional weights,
- * optional edge ids, optional edge types mapped to this GPU.
+ * optional edge ids, optional edge types mapped to this GPU and a vector storing the
+ * number of edges received from each GPU.
*/
template
std::tuple,
diff --git a/cpp/include/cugraph/graph_view.hpp b/cpp/include/cugraph/graph_view.hpp
index a2ff3166fa4..d109fbdac95 100644
--- a/cpp/include/cugraph/graph_view.hpp
+++ b/cpp/include/cugraph/graph_view.hpp
@@ -165,7 +165,12 @@ class partition_t {
return vertex_partition_range_last(partition_idx) - vertex_partition_range_first(partition_idx);
}
- size_t number_of_local_edge_partitions() const { return minor_comm_size_; }
+ size_t number_of_local_edge_partitions() const { return static_cast(minor_comm_size_); }
+ size_t coinciding_local_edge_partition_idx() const
+ {
+ return static_cast(minor_comm_rank_);
+ } // the major range of coinciding_local_edge_partition_idx()'th local edge partition coincides
+ // with the local vertex partition range
// major: source of the edge partition (if not transposed) or destination of the edge partition
// (if transposed).
@@ -249,9 +254,13 @@ double constexpr edge_partition_src_dst_property_values_kv_pair_fill_ratio_thres
// use the hypersparse format (currently, DCSR or DCSC) for the vertices with their degrees smaller
// than minor_comm_size * hypersparse_threshold_ratio, should be less than 1.0
double constexpr hypersparse_threshold_ratio = 0.5;
-size_t constexpr low_degree_threshold{raft::warp_size()};
-size_t constexpr mid_degree_threshold{1024};
-size_t constexpr num_sparse_segments_per_vertex_partition{3};
+size_t constexpr low_degree_threshold{
+ raft::warp_size()}; // belongs to the low degree segment if the global degree is smaller than
+ // this value.
+size_t constexpr mid_degree_threshold{
+ 1024}; // belongs to the medium degree segment if the global degree is smaller than this value,
+ // otherwise, belongs to the high degree segment.
+size_t constexpr num_sparse_segments_per_vertex_partition{3}; // high, mid, low
// Common for both graph_view_t & graph_t and both single-GPU & multi-GPU versions
template
@@ -313,6 +322,7 @@ struct graph_view_meta_t edge_partition_segment_offsets{};
+ std::optional> edge_partition_hypersparse_degree_offsets{};
std::conditional_t>,
@@ -356,6 +366,7 @@ struct graph_view_meta_t> segment_offsets{std::nullopt};
+ std::optional> hypersparse_degree_offsets{std::nullopt};
};
// graph_view_t is a non-owning graph class (note that graph_t is an owning graph class)
@@ -380,6 +391,8 @@ class graph_view_t> const& edge_partition_indices,
std::optional>> const&
edge_partition_dcs_nzd_vertices,
+ std::optional>> const&
+ edge_partition_dcs_nzd_range_bitmaps,
graph_view_meta_t meta);
std::vector vertex_partition_range_offsets() const
@@ -552,6 +565,12 @@ class graph_view_t> local_vertex_partition_segment_offsets() const
+ {
+ auto partition_idx = partition_.coinciding_local_edge_partition_idx();
+ return local_edge_partition_segment_offsets(partition_idx);
+ }
+
std::optional> local_edge_partition_segment_offsets(
size_t partition_idx) const
{
@@ -563,6 +582,28 @@ class graph_view_t> local_vertex_partition_hypersparse_degree_offsets() const
+ {
+ auto partition_idx = partition_.coinciding_local_edge_partition_idx();
+ return local_edge_partition_hypersparse_degree_offsets(partition_idx);
+ }
+
+ std::optional> local_edge_partition_hypersparse_degree_offsets(
+ size_t partition_idx) const
+ {
+ auto num_degrees_per_vertex_partition =
+ edge_partition_hypersparse_degree_offsets_
+ ? ((*edge_partition_hypersparse_degree_offsets_).size() / edge_partition_offsets_.size())
+ : size_t{0};
+ return edge_partition_hypersparse_degree_offsets_
+ ? std::make_optional>(
+ (*edge_partition_hypersparse_degree_offsets_).begin() +
+ partition_idx * num_degrees_per_vertex_partition,
+ (*edge_partition_hypersparse_degree_offsets_).begin() +
+ (partition_idx + 1) * num_degrees_per_vertex_partition)
+ : std::nullopt;
+ }
+
vertex_partition_view_t local_vertex_partition_view() const
{
return vertex_partition_view_t(this->number_of_vertices(),
@@ -605,6 +646,9 @@ class graph_view_t>> edge_partition_dcs_nzd_vertices_{};
+ std::optional>>
+ edge_partition_dcs_nzd_range_bitmaps_{};
partition_t partition_{};
// segment offsets based on vertex degree
std::vector edge_partition_segment_offsets_{};
+ std::optional> edge_partition_hypersparse_degree_offsets_{};
// if valid, store source/destination property values in key/value pairs (this saves memory if #
// unique edge sources/destinations << V / major_comm_size|minor_comm_size).
@@ -903,6 +950,11 @@ class graph_view_t> local_vertex_partition_segment_offsets() const
+ {
+ return local_edge_partition_segment_offsets(size_t{0});
+ }
+
std::optional> local_edge_partition_segment_offsets(
size_t partition_idx = 0) const
{
@@ -910,6 +962,18 @@ class graph_view_t> local_vertex_partition_hypersparse_degree_offsets() const
+ {
+ return local_edge_partition_hypersparse_degree_offsets(size_t{0});
+ }
+
+ std::optional> local_edge_partition_hypersparse_degree_offsets(
+ size_t partition_idx = 0) const
+ {
+ assert(partition_idx == 0);
+ return hypersparse_degree_offsets_;
+ }
+
vertex_partition_view_t local_vertex_partition_view() const
{
return vertex_partition_view_t(this->number_of_vertices());
@@ -1050,6 +1114,7 @@ class graph_view_t> segment_offsets_{std::nullopt};
+ std::optional> hypersparse_degree_offsets_{std::nullopt};
std::optional> edge_mask_view_{std::nullopt};
};
diff --git a/cpp/include/cugraph/partition_manager.hpp b/cpp/include/cugraph/partition_manager.hpp
index 309b169e646..2eb210fb7cd 100644
--- a/cpp/include/cugraph/partition_manager.hpp
+++ b/cpp/include/cugraph/partition_manager.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023, NVIDIA CORPORATION.
+ * Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,6 +71,30 @@ class partition_manager {
: (major_comm_rank * minor_comm_size + minor_comm_rank);
}
+#ifdef __CUDACC__
+ __host__ __device__
+#endif
+ static int
+ compute_major_comm_rank_from_global_comm_rank(int major_comm_size,
+ int minor_comm_size,
+ int comm_rank)
+ {
+ return map_major_comm_to_gpu_row_comm ? comm_rank % major_comm_size
+ : comm_rank / minor_comm_size;
+ }
+
+#ifdef __CUDACC__
+ __host__ __device__
+#endif
+ static int
+ compute_minor_comm_rank_from_global_comm_rank(int major_comm_size,
+ int minor_comm_size,
+ int comm_rank)
+ {
+ return map_major_comm_to_gpu_row_comm ? comm_rank / major_comm_size
+ : comm_rank % minor_comm_size;
+ }
+
#ifdef __CUDACC__
__host__ __device__
#endif
diff --git a/cpp/include/cugraph/sampling_functions.hpp b/cpp/include/cugraph/sampling_functions.hpp
index 783cd3a7e2b..981c42135f6 100644
--- a/cpp/include/cugraph/sampling_functions.hpp
+++ b/cpp/include/cugraph/sampling_functions.hpp
@@ -43,6 +43,8 @@ enum class prior_sources_behavior_t { DEFAULT = 0, CARRY_OVER, EXCLUDE };
/**
* @brief Uniform Neighborhood Sampling.
*
+ * @deprecated Replaced with homogeneous_uniform_neighbor_sample
+ *
* This function traverses from a set of starting vertices, traversing outgoing edges and
* randomly selects from these outgoing neighbors to extract a subgraph.
*
@@ -53,19 +55,20 @@ enum class prior_sources_behavior_t { DEFAULT = 0, CARRY_OVER, EXCLUDE };
* encountered in. The label output (optional) identifes the vertex label. The offsets array
* (optional) will be described below and is dependent upon the input parameters.
*
- * If @p starting_vertex_labels is not specified then no organization is applied to the output, the
- * label and offsets values in the return set will be std::nullopt.
+ * If @p starting_vertex_label_offsets is not specified then no organization is applied to the
+ * output, the label and offsets values in the return set will be std::nullopt.
*
- * If @p starting_vertex_labels is specified and @p label_to_output_comm_rank is not specified then
- * the label output has values. This will also result in the output being sorted by vertex label.
- * The offsets array in the return will be a CSR-style offsets array to identify the beginning of
- * each label range in the data. `labels.size() == (offsets.size() - 1)`.
+ * If @p starting_vertex_label_offsets is specified and @p label_to_output_comm_rank is not
+ * specified then the label output has values. This will also result in the output being sorted by
+ * vertex label. The offsets array in the return will be a CSR-style offsets array to identify the
+ * beginning of each label range in the data. `labels.size() == (offsets.size() - 1)`.
*
- * If @p starting_vertex_labels is specified and @p label_to_output_comm_rank is specified then the
- * label output has values. This will also result in the output being sorted by vertex label. The
- * offsets array in the return will be a CSR-style offsets array to identify the beginning of each
- * label range in the data. `labels.size() == (offsets.size() - 1)`. Additionally, the data will
- * be shuffled so that all data with a particular label will be on the specified rank.
+ * If @p starting_vertex_label_offsets is specified and @p label_to_output_comm_rank is specified
+ * then the label output has values. This will also result in the output being sorted by vertex
+ * label. The offsets array in the return will be a CSR-style offsets array to identify the
+ * beginning of each label range in the data. `labels.size() == (offsets.size() - 1)`.
+ * Additionally, the data will be shuffled so that all data with a particular label will be on the
+ * specified rank.
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
@@ -83,8 +86,8 @@ enum class prior_sources_behavior_t { DEFAULT = 0, CARRY_OVER, EXCLUDE };
* @param edge_type_view Optional view object holding edge types for @p graph_view.
* @param starting_vertices Device span of starting vertex IDs for the sampling.
* In a multi-gpu context the starting vertices should be local to this GPU.
- * @param starting_vertex_labels Optional device span of labels associted with each starting vertex
- * for the sampling.
+ * @param starting_vertex_label_offsets Optional device span of labels associated with each starting
+ * vertex for the sampling.
* @param label_to_output_comm_rank Optional tuple of device spans mapping label to a particular
* output rank. Element 0 of the tuple identifes the label, Element 1 of the tuple identifies the
* output rank. The label span must be sorted in ascending order.
@@ -126,7 +129,7 @@ uniform_neighbor_sample(
std::optional> edge_id_view,
std::optional> edge_type_view,
raft::device_span starting_vertices,
- std::optional> starting_vertex_labels,
+ std::optional> starting_vertex_label_offsets,
std::optional, raft::device_span>>
label_to_output_comm_rank,
raft::host_span fan_out,
@@ -140,6 +143,8 @@ uniform_neighbor_sample(
/**
* @brief Biased Neighborhood Sampling.
*
+ * @deprecated Replaced with homogeneous_biased_neighbor_sample
+ *
* This function traverses from a set of starting vertices, traversing outgoing edges and
* randomly selects (with edge biases) from these outgoing neighbors to extract a subgraph.
*
@@ -150,24 +155,26 @@ uniform_neighbor_sample(
* encountered in. The label output (optional) identifes the vertex label. The offsets array
* (optional) will be described below and is dependent upon the input parameters.
*
- * If @p starting_vertex_labels is not specified then no organization is applied to the output, the
- * label and offsets values in the return set will be std::nullopt.
+ * If @p starting_vertex_label_offsets is not specified then no organization is applied to the
+ * output, the label and offsets values in the return set will be std::nullopt.
*
- * If @p starting_vertex_labels is specified and @p label_to_output_comm_rank is not specified then
- * the label output has values. This will also result in the output being sorted by vertex label.
- * The offsets array in the return will be a CSR-style offsets array to identify the beginning of
- * each label range in the data. `labels.size() == (offsets.size() - 1)`.
+ * If @p starting_vertex_label_offsets is specified and @p label_to_output_comm_rank is not
+ * specified then the label output has values. This will also result in the output being sorted by
+ * vertex label. The offsets array in the return will be a CSR-style offsets array to identify the
+ * beginning of each label range in the data. `labels.size() == (offsets.size() - 1)`.
*
- * If @p starting_vertex_labels is specified and @p label_to_output_comm_rank is specified then the
- * label output has values. This will also result in the output being sorted by vertex label. The
- * offsets array in the return will be a CSR-style offsets array to identify the beginning of each
- * label range in the data. `labels.size() == (offsets.size() - 1)`. Additionally, the data will
- * be shuffled so that all data with a particular label will be on the specified rank.
+ * If @p starting_vertex_label_offsets is specified and @p label_to_output_comm_rank is specified
+ * then the label output has values. This will also result in the output being sorted by vertex
+ * label. The offsets array in the return will be a CSR-style offsets array to identify the
+ * beginning of each label range in the data. `labels.size() == (offsets.size() - 1)`.
+ * Additionally, the data will be shuffled so that all data with a particular label will be on the
+ * specified rank.
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam edge_type_t Type of edge type. Needs to be an integral type.
+ * @tparam bias_t Type of bias. Needs to be an integral type.
* @tparam label_t Type of label. Needs to be an integral type.
* @tparam store_transposed Flag indicating whether sources (if false) or destinations (if
* true) are major indices
@@ -184,8 +191,8 @@ uniform_neighbor_sample(
* corresponding edge can never be selected.
* @param starting_vertices Device span of starting vertex IDs for the sampling.
* In a multi-gpu context the starting vertices should be local to this GPU.
- * @param starting_vertex_labels Optional device span of labels associted with each starting vertex
- * for the sampling.
+ * @param starting_vertex_label_offsets Optional device span of labels associated with each starting
+ * vertex for the sampling.
* @param label_to_output_comm_rank Optional tuple of device spans mapping label to a particular
* output rank. Element 0 of the tuple identifes the label, Element 1 of the tuple identifies the
* output rank. The label span must be sorted in ascending order.
@@ -229,7 +236,7 @@ biased_neighbor_sample(
std::optional> edge_type_view,
edge_property_view_t edge_bias_view,
raft::device_span starting_vertices,
- std::optional> starting_vertex_labels,
+ std::optional> starting_vertex_label_offsets,
std::optional, raft::device_span>>
label_to_output_comm_rank,
raft::host_span fan_out,
@@ -240,6 +247,349 @@ biased_neighbor_sample(
bool dedupe_sources = false,
bool do_expensive_check = false);
+struct sampling_flags_t {
+ /**
+ * Specifies how to handle prior sources. Default is DEFAULT.
+ */
+ prior_sources_behavior_t prior_sources_behavior{};
+
+ /**
+ * Specifies if the hop information should be returned. Default is false.
+ */
+ bool return_hops{false};
+
+ /**
+ * If true then if a vertex v appears as a destination in hop X multiple times
+ * with the same label, it will only be passed once (for each label) as a source
+ * for the next hop. Default is false.
+ */
+ bool dedupe_sources{false};
+
+ /**
+ * Specifies if random sampling is done with replacement
+ * (true) or without replacement (false). Default is true.
+ */
+ bool with_replacement{true};
+};
+
+/**
+ * @brief Homogeneous Uniform Neighborhood Sampling.
+ *
+ * This function traverses from a set of starting vertices, traversing outgoing edges and
+ * randomly selects (uniformly) from these outgoing neighbors to extract a subgraph.
+ * The branching out to select outgoing neighbors is performed with homogeneous fanouts
+ *
+ * Output from this function is a tuple of vectors (src, dst, weight, edge_id, edge_type, hop,
+ * offsets), identifying the randomly selected edges where the size of src, dst, weight, edge_id,
+ * edge_type and hop is the number of sampled edges while the size of the offsets vector is the
+ * number of labels + 1. src is the source vertex, dst is the destination vertex, weight
+ * (optional) is the edge weight, edge_id (optional) identifies the edge id, edge_type (optional)
+ * identifies the edge type, hop identifies which hop the edge was encountered in.
+ * The offsets array (optional) identifies the offset for each label.
+ *
+ * If @p label_to_output_comm_rank is specified then the data will be shuffled so that all entries
+ * for a particular label are returned on the specified rank.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam edge_type_t Type of edge type. Needs to be an integral type.
+ * @tparam store_transposed Flag indicating whether sources (if false) or destinations (if
+ * true) are major indices
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms.
+ * @param rng_state A pre-initialized raft::RngState object for generating random numbers
+ * @param graph_view Graph View object to generate NBR Sampling on.
+ * @param edge_weight_view Optional view object holding edge weights for @p graph_view.
+ * @param edge_id_view Optional view object holding edge ids for @p graph_view.
+ * @param edge_type_view Optional view object holding edge types for @p graph_view.
+ * @param starting_vertices Device span of starting vertex IDs for the sampling.
+ * In a multi-gpu context the starting vertices should be local to this GPU.
+ * @param starting_vertex_labels Optional device span of labels associated with each starting
+ * vertex for the sampling.
+ * @param label_to_output_comm_rank Optional device span identifying which rank should get sampling
+ * outputs of each vertex label. This should be the same on each rank.
+ * @param fan_out Host span defining branching out (fan-out) degree per source vertex for each
+ * level.
+ * @param flags A set of flags indicating which sampling features should be used.
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ * @return tuple device vectors (vertex_t source_vertex, vertex_t destination_vertex,
+ * optional weight_t weight, optional edge_t edge id, optional edge_type_t edge type,
+ * optional int32_t hop, optional label_t label, optional size_t offsets)
+ */
+
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>>
+homogeneous_uniform_neighbor_sample(
+ raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
+ graph_view_t const& graph_view,
+ std::optional> edge_weight_view,
+ std::optional> edge_id_view,
+ std::optional> edge_type_view,
+ raft::device_span starting_vertices,
+ std::optional> starting_vertex_labels,
+ std::optional> label_to_output_comm_rank,
+ raft::host_span fan_out,
+ sampling_flags_t sampling_flags,
+ bool do_expensive_check = false);
+
+/**
+ * @brief Homogeneous Biased Neighborhood Sampling.
+ *
+ * This function traverses from a set of starting vertices, traversing outgoing edges and
+ * randomly selects (with edge biases) from these outgoing neighbors to extract a subgraph.
+ * The branching out to select outgoing neighbors is performed with homogeneous fanouts
+ *
+ * Output from this function is a tuple of vectors (src, dst, weight, edge_id, edge_type, hop,
+ * offsets), identifying the randomly selected edges where the size of src, dst, weight, edge_id,
+ * edge_type and hop is the number of sampled edges while the size of the offsets vector is the
+ * number of labels + 1. src is the source vertex, dst is the destination vertex, weight
+ * (optional) is the edge weight, edge_id (optional) identifies the edge id, edge_type (optional)
+ * identifies the edge type, hop identifies which hop the edge was encountered in.
+ * The offsets array (optional) identifies the offset for each label.
+ *
+ * If @p label_to_output_comm_rank is specified then the data will be shuffled so that all entries
+ * for a particular label are returned on the specified rank.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam edge_type_t Type of edge type. Needs to be an integral type.
+ * @tparam bias_t Type of bias. Needs to be an integral type.
+ * @tparam store_transposed Flag indicating whether sources (if false) or destinations (if
+ * true) are major indices
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms.
+ * @param rng_state A pre-initialized raft::RngState object for generating random numbers
+ * @param graph_view Graph View object to generate NBR Sampling on.
+ * @param edge_weight_view Optional view object holding edge weights for @p graph_view.
+ * @param edge_id_view Optional view object holding edge ids for @p graph_view.
+ * @param edge_type_view Optional view object holding edge types for @p graph_view.
+ * @param edge_bias_view View object holding edge biases (to be used in biased sampling) for @p
+ * graph_view. Bias values should be non-negative and the sum of edge bias values from any vertex
+ * should not exceed std::numeric_limits::max(). 0 bias value indicates that the
+ * corresponding edge can never be selected.
+ * @param starting_vertices Device span of starting vertex IDs for the sampling.
+ * In a multi-gpu context the starting vertices should be local to this GPU.
+ * @param starting_vertex_labels Optional device span of labels associated with each starting
+ * vertex for the sampling.
+ * @param label_to_output_comm_rank Optional device span identifying which rank should get sampling
+ * outputs of each vertex label. This should be the same on each rank.
+ * @param fan_out Host span defining branching out (fan-out) degree per source vertex for each
+ * level.
+ * @param flags A set of flags indicating which sampling features should be used.
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ * @return tuple device vectors (vertex_t source_vertex, vertex_t destination_vertex,
+ * optional weight_t weight, optional edge_t edge id, optional edge_type_t edge type,
+ * optional int32_t hop, optional label_t label, optional size_t offsets)
+ */
+
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>>
+homogeneous_biased_neighbor_sample(
+ raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
+ graph_view_t const& graph_view,
+ std::optional> edge_weight_view,
+ std::optional> edge_id_view,
+ std::optional> edge_type_view,
+ edge_property_view_t edge_bias_view,
+ raft::device_span starting_vertices,
+ std::optional> starting_vertex_labels,
+ std::optional> label_to_output_comm_rank,
+ raft::host_span fan_out,
+ sampling_flags_t sampling_flags,
+ bool do_expensive_check = false);
+
+/**
+ * @brief Heterogeneous Uniform Neighborhood Sampling.
+ *
+ * This function traverses from a set of starting vertices, traversing outgoing edges and
+ * randomly selects (uniformly) from these outgoing neighbors to extract a subgraph.
+ * The branching out to select outgoing neighbors is performed with heterogeneous fanouts
+ * where the number of edge types is bigger than 1.
+ *
+ * Output from this function is a tuple of vectors (src, dst, weight, edge_id, edge_type, hop,
+ * offsets), identifying the randomly selected edges where the size of src, dst, weight, edge_id,
+ * edge_type and hop is the number of sampled edges while the size of the offsets vector is the
+ * number of labels + 1. src is the source vertex, dst is the destination vertex, weight
+ * (optional) is the edge weight, edge_id (optional) identifies the edge id, edge_type (optional)
+ * identifies the edge type, hop identifies which hop the edge was encountered in.
+ * The offsets array (optional) identifies the offset for each label.
+ *
+ * If @p label_to_output_comm_rank is specified then the data will be shuffled so that all entries
+ * for a particular label are returned on the specified rank.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam edge_type_t Type of edge type. Needs to be an integral type.
+ * @tparam store_transposed Flag indicating whether sources (if false) or destinations (if
+ * true) are major indices
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms.
+ * @param rng_state A pre-initialized raft::RngState object for generating random numbers
+ * @param graph_view Graph View object to generate NBR Sampling on.
+ * @param edge_weight_view Optional view object holding edge weights for @p graph_view.
+ * @param edge_id_view Optional view object holding edge ids for @p graph_view.
+ * @param edge_type_view Optional view object holding edge types for @p graph_view.
+ * @param starting_vertices Device span of starting vertex IDs for the sampling.
+ * In a multi-gpu context the starting vertices should be local to this GPU.
+ * @param starting_vertex_labels Optional device span of labels associated with each starting
+ * vertex for the sampling.
+ * @param label_to_output_comm_rank Optional device span identifying which rank should get sampling
+ * outputs of each vertex label. This should be the same on each rank.
+ * @param fan_out Host span defining branching out (fan-out) degree per source vertex for each
+ * level. The fanout value at hop x is given by the expression 'fanout[x*num_edge_types +
+ * edge_type_id]'
+ * @param num_edge_types Number of edge types where a value of 1 translates to homogeneous neighbor
+ * sample whereas a value greater than 1 translates to heterogeneous neighbor sample.
+ * @param flags A set of flags indicating which sampling features should be used.
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ * @return tuple device vectors (vertex_t source_vertex, vertex_t destination_vertex,
+ * optional weight_t weight, optional edge_t edge id, optional edge_type_t edge type,
+ * optional int32_t hop, optional label_t label, optional size_t offsets)
+ */
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>>
+heterogeneous_uniform_neighbor_sample(
+ raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
+ graph_view_t const& graph_view,
+ std::optional> edge_weight_view,
+ std::optional> edge_id_view,
+ std::optional> edge_type_view,
+ raft::device_span starting_vertices,
+ std::optional> starting_vertex_labels,
+ std::optional> label_to_output_comm_rank,
+ raft::host_span fan_out,
+ edge_type_t num_edge_types,
+ sampling_flags_t sampling_flags,
+ bool do_expensive_check = false);
+
+/**
+ * @brief Heterogeneous Biased Neighborhood Sampling.
+ *
+ * This function traverses from a set of starting vertices, traversing outgoing edges and
+ * randomly selects (with edge biases) from these outgoing neighbors to extract a subgraph.
+ * The branching out to select outgoing neighbors is performed with heterogeneous fanouts
+ * where the number of edge types is bigger than 1.
+ *
+ * Output from this function is a tuple of vectors (src, dst, weight, edge_id, edge_type, hop,
+ * offsets), identifying the randomly selected edges where the size of src, dst, weight, edge_id,
+ * edge_type and hop is the number of sampled edges while the size of the offsets vector is the
+ * number of labels + 1. src is the source vertex, dst is the destination vertex, weight
+ * (optional) is the edge weight, edge_id (optional) identifies the edge id, edge_type (optional)
+ * identifies the edge type, hop identifies which hop the edge was encountered in.
+ * The offsets array (optional) identifies the offset for each label.
+ *
+ * If @p label_to_output_comm_rank is specified then the data will be shuffled so that all entries
+ * for a particular label are returned on the specified rank.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam edge_type_t Type of edge type. Needs to be an integral type.
+ * @tparam bias_t Type of bias. Needs to be an integral type.
+ * @tparam store_transposed Flag indicating whether sources (if false) or destinations (if
+ * true) are major indices
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms.
+ * @param rng_state A pre-initialized raft::RngState object for generating random numbers
+ * @param graph_view Graph View object to generate NBR Sampling on.
+ * @param edge_weight_view Optional view object holding edge weights for @p graph_view.
+ * @param edge_id_view Optional view object holding edge ids for @p graph_view.
+ * @param edge_type_view Optional view object holding edge types for @p graph_view.
+ * @param edge_bias_view View object holding edge biases (to be used in biased sampling) for @p
+ * graph_view. Bias values should be non-negative and the sum of edge bias values from any vertex
+ * should not exceed std::numeric_limits::max(). 0 bias value indicates that the
+ * corresponding edge can never be selected.
+ * @param starting_vertices Device span of starting vertex IDs for the sampling.
+ * In a multi-gpu context the starting vertices should be local to this GPU.
+ * @param starting_vertex_labels Optional device span of labels associated with each starting
+ * vertex for the sampling.
+ * @param label_to_output_comm_rank Optional device span identifying which rank should get sampling
+ * outputs of each vertex label. This should be the same on each rank.
+ * @param fan_out Host span defining branching out (fan-out) degree per source vertex for each
+ * level. The fanout value at hop x is given by the expression 'fanout[x*num_edge_types +
+ * edge_type_id]'
+ * @param num_edge_types Number of edge types where a value of 1 translates to homogeneous neighbor
+ * sample whereas a value greater than 1 translates to heterogeneous neighbor sample.
+ * @param flags A set of flags indicating which sampling features should be used.
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ * @return tuple device vectors (vertex_t source_vertex, vertex_t destination_vertex,
+ * optional weight_t weight, optional edge_t edge id, optional edge_type_t edge type,
+ * optional int32_t hop, optional label_t label, optional size_t offsets)
+ */
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>,
+ std::optional>>
+heterogeneous_biased_neighbor_sample(
+ raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
+ graph_view_t const& graph_view,
+ std::optional> edge_weight_view,
+ std::optional> edge_id_view,
+ std::optional> edge_type_view,
+ edge_property_view_t edge_bias_view,
+ raft::device_span starting_vertices,
+ std::optional> starting_vertex_labels,
+ std::optional> label_to_output_comm_rank,
+ raft::host_span fan_out,
+ edge_type_t num_edge_types,
+ sampling_flags_t sampling_flags,
+ bool do_expensive_check = false);
+
/*
* @brief renumber sampled edge list and compress to the (D)CSR|(D)CSC format.
*
diff --git a/cpp/include/cugraph/utilities/dataframe_buffer.hpp b/cpp/include/cugraph/utilities/dataframe_buffer.hpp
index a20613c65ef..6d47ec540da 100644
--- a/cpp/include/cugraph/utilities/dataframe_buffer.hpp
+++ b/cpp/include/cugraph/utilities/dataframe_buffer.hpp
@@ -82,6 +82,53 @@ auto allocate_dataframe_buffer(size_t buffer_size, rmm::cuda_stream_view stream_
std::make_index_sequence(), buffer_size, stream_view);
}
+template
+struct dataframe_buffer_type {
+ using type = decltype(allocate_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{}));
+};
+
+template
+using dataframe_buffer_type_t = typename dataframe_buffer_type::type;
+
+template
+std::optional> try_allocate_dataframe_buffer(
+ size_t buffer_size, rmm::cuda_stream_view stream_view)
+{
+ try {
+ return allocate_dataframe_buffer(buffer_size, stream_view);
+ } catch (std::exception const& e) {
+ return std::nullopt;
+ }
+}
+
+template
+struct dataframe_buffer_iterator_type {
+ using type = typename rmm::device_uvector::iterator;
+};
+
+template
+struct dataframe_buffer_iterator_type> {
+ using type = thrust::zip_iterator::iterator...>>;
+};
+
+template
+using dataframe_buffer_iterator_type_t = typename dataframe_buffer_iterator_type::type;
+
+template
+struct dataframe_buffer_const_iterator_type {
+ using type = typename rmm::device_uvector::const_iterator;
+};
+
+template