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..b272fb43e35 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,12 +101,12 @@ 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 }}
@@ -116,7 +116,7 @@ jobs:
wheel-build-nx-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 }}
@@ -126,7 +126,7 @@ jobs:
wheel-publish-nx-cugraph:
needs: wheel-build-nx-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 }}
@@ -136,7 +136,7 @@ jobs:
wheel-build-cugraph-dgl:
needs: wheel-publish-cugraph
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 }}
@@ -146,7 +146,7 @@ jobs:
wheel-publish-cugraph-dgl:
needs: wheel-build-cugraph-dgl
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 }}
@@ -156,7 +156,7 @@ jobs:
wheel-build-cugraph-pyg:
needs: wheel-publish-cugraph
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 }}
@@ -166,7 +166,7 @@ jobs:
wheel-publish-cugraph-pyg:
needs: wheel-build-cugraph-pyg
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 }}
@@ -175,7 +175,7 @@ jobs:
package-name: cugraph-pyg
wheel-build-cugraph-equivariant:
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 }}
@@ -185,7 +185,7 @@ jobs:
wheel-publish-cugraph-equivariant:
needs: wheel-build-cugraph-equivariant
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 }}
diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index dacd9a93399..b0a1308237e 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -12,6 +12,7 @@ concurrency:
jobs:
pr-builder:
needs:
+ - changed-files
- checks
- conda-cpp-build
- conda-cpp-tests
@@ -34,29 +35,69 @@ jobs:
- wheel-tests-cugraph-equivariant
- 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) }}
+ changed-files:
+ secrets: inherit
+ 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/**'
+ # TODO: Remove this before merging
+ - '!.github/**'
+ test_notebooks:
+ - '**'
+ - '!.devcontainers/**'
+ - '!CONTRIBUTING.md'
+ - '!README.md'
+ - '!docs/**'
+ # TODO: Remove this before merging
+ - '!.github/**'
+ test_python:
+ - '**'
+ - '!.devcontainers/**'
+ - '!CONTRIBUTING.md'
+ - '!README.md'
+ - '!docs/**'
+ - '!img/**'
+ - '!notebooks/**'
+ # TODO: Remove this before merging
+ - '!.github/**'
checks:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12
with:
enable_check_generated_files: false
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 +105,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 +129,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,63 +139,67 @@ 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
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: pull-request
script: ci/build_wheel_nx-cugraph.sh
wheel-tests-nx-cugraph:
- needs: wheel-build-nx-cugraph
+ needs: [wheel-build-nx-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_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
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: pull-request
script: ci/build_wheel_cugraph-dgl.sh
wheel-tests-cugraph-dgl:
- needs: wheel-build-cugraph-dgl
+ needs: [wheel-build-cugraph-dgl, 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-dgl.sh
@@ -160,35 +207,37 @@ jobs:
wheel-build-cugraph-pyg:
needs: wheel-tests-cugraph
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-pyg.sh
wheel-tests-cugraph-pyg:
- needs: wheel-build-cugraph-pyg
+ needs: [wheel-build-cugraph-pyg, 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-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
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: pull-request
script: ci/build_wheel_cugraph-equivariant.sh
wheel-tests-cugraph-equivariant:
- needs: wheel-build-cugraph-equivariant
+ needs: [wheel-build-cugraph-equivariant, 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-equivariant.sh
matrix_filter: map(select(.ARCH == "amd64"))
devcontainer:
secrets: inherit
- uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.10
+ uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12
with:
arch: '["amd64"]'
cuda: '["12.5"]'
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 957d29ce72b..5fbdd276bd6 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,7 +51,7 @@ 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 }}
@@ -60,7 +60,7 @@ jobs:
script: ci/test_wheel_cugraph.sh
wheel-tests-nx-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 }}
@@ -69,7 +69,7 @@ jobs:
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
+ uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
@@ -79,7 +79,7 @@ jobs:
matrix_filter: map(select(.ARCH == "amd64"))
wheel-tests-cugraph-pyg:
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 }}
@@ -89,7 +89,7 @@ jobs:
matrix_filter: map(select(.ARCH == "amd64"))
wheel-tests-cugraph-equivariant:
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 }}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 36c5fa84166..8ff284210b7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -17,11 +17,11 @@ repos:
hooks:
- id: black
language_version: python3
- args: [--target-version=py39]
+ args: [--target-version=py310]
files: ^(python/.*|benchmarks/.*)$
exclude: ^python/nx-cugraph/
- repo: https://github.com/PyCQA/flake8
- rev: 6.0.0
+ rev: 7.1.1
hooks:
- id: flake8
args: ["--config=.flake8"]
@@ -34,7 +34,7 @@ repos:
hooks:
- id: yesqa
additional_dependencies:
- - flake8==6.0.0
+ - flake8==7.1.1
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
@@ -42,7 +42,7 @@ repos:
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: https://github.com/rapidsai/pre-commit-hooks
- rev: v0.2.0
+ rev: v0.4.0
hooks:
- id: verify-copyright
files: |
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f85c7d03f03..689a214751f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,88 @@
+# cugraph 24.08.00 (7 Aug 2024)
+
+## 🚨 Breaking Changes
+
+- Use MNMG version of ECG in python layer instead, and remove legacy ECG and Louvain ([#4514](https://github.com/rapidsai/cugraph/pull/4514)) [@naimnv](https://github.com/naimnv)
+
+## 🐛 Bug Fixes
+
+- add setuptools to host requirements for conda packages that need it ([#4582](https://github.com/rapidsai/cugraph/pull/4582)) [@jameslamb](https://github.com/jameslamb)
+- Add pylibcugraph dependency on pylibraft. ([#4570](https://github.com/rapidsai/cugraph/pull/4570)) [@bdice](https://github.com/bdice)
+- Fix build error with NO_CUGRAPH_OPS ([#4563](https://github.com/rapidsai/cugraph/pull/4563)) [@seunghwak](https://github.com/seunghwak)
+- [BUG] Fix Failing WholeGraph Tests ([#4560](https://github.com/rapidsai/cugraph/pull/4560)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Temporarily Disable Feature Store Tests with WholeGraph ([#4559](https://github.com/rapidsai/cugraph/pull/4559)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Fix MG `katz_centrality`: Check if DataFrame Arg is Not None ([#4555](https://github.com/rapidsai/cugraph/pull/4555)) [@nv-rliu](https://github.com/nv-rliu)
+- nx-cugraph: fix `from_pandas_edgekey` given edgekey but not edgeattr ([#4550](https://github.com/rapidsai/cugraph/pull/4550)) [@eriknw](https://github.com/eriknw)
+- Fix triangle count test bug ([#4549](https://github.com/rapidsai/cugraph/pull/4549)) [@jnke2016](https://github.com/jnke2016)
+- [BUG] Use the Correct WG Communicator ([#4548](https://github.com/rapidsai/cugraph/pull/4548)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Add Additional Check For SSSP Source Vertex & Fix SSSP Benchmark ([#4541](https://github.com/rapidsai/cugraph/pull/4541)) [@nv-rliu](https://github.com/nv-rliu)
+- Fix OOM Bug for Jaccard, Sorensen, and Overlap benchmarks ([#4524](https://github.com/rapidsai/cugraph/pull/4524)) [@nv-rliu](https://github.com/nv-rliu)
+- Distribute start_list across ranks ([#4519](https://github.com/rapidsai/cugraph/pull/4519)) [@jnke2016](https://github.com/jnke2016)
+- [FIX] Skip Distributed Sampler Tests if PyTorch with CUDA is not Available ([#4518](https://github.com/rapidsai/cugraph/pull/4518)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- [BUG] Fix a hang issue in MG triangle counts (when invoked with a small number of vertices to update triangle counts) ([#4517](https://github.com/rapidsai/cugraph/pull/4517)) [@seunghwak](https://github.com/seunghwak)
+- Update MG Benchmark List ([#4516](https://github.com/rapidsai/cugraph/pull/4516)) [@nv-rliu](https://github.com/nv-rliu)
+- Fix TensorProductConv test and improve docs ([#4480](https://github.com/rapidsai/cugraph/pull/4480)) [@tingyu66](https://github.com/tingyu66)
+- Test nx-cugraph package instead of editable install ([#4442](https://github.com/rapidsai/cugraph/pull/4442)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+
+## 📖 Documentation
+
+- DOC: typo in nx_transition.rst ([#4491](https://github.com/rapidsai/cugraph/pull/4491)) [@raybellwaves](https://github.com/raybellwaves)
+- Doc cleanup for nx-cugraph: fixed typos, cleaned up various descriptions, renamed notebook to match naming convetion. ([#4478](https://github.com/rapidsai/cugraph/pull/4478)) [@rlratzel](https://github.com/rlratzel)
+- [DOC] Minor Improvements to cuGraph-PyG Documentation ([#4460](https://github.com/rapidsai/cugraph/pull/4460)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+
+## 🚀 New Features
+
+- Use MNMG version of ECG in python layer instead, and remove legacy ECG and Louvain ([#4514](https://github.com/rapidsai/cugraph/pull/4514)) [@naimnv](https://github.com/naimnv)
+- c_api and plc binding for lookup src dst using edge ids and type(s) ([#4494](https://github.com/rapidsai/cugraph/pull/4494)) [@naimnv](https://github.com/naimnv)
+- Forward merge branch-24.06 into branch-24.08 ([#4489](https://github.com/rapidsai/cugraph/pull/4489)) [@nv-rliu](https://github.com/nv-rliu)
+- [FEA] New Graph Interface and Loaders for Distributed Sampling in DGL ([#4486](https://github.com/rapidsai/cugraph/pull/4486)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- compute cosine similarity for vertex pairs ([#4482](https://github.com/rapidsai/cugraph/pull/4482)) [@naimnv](https://github.com/naimnv)
+- Define heterogeneous renumbering API ([#4463](https://github.com/rapidsai/cugraph/pull/4463)) [@seunghwak](https://github.com/seunghwak)
+- Lookup edge src dst using edge id and type ([#4449](https://github.com/rapidsai/cugraph/pull/4449)) [@naimnv](https://github.com/naimnv)
+- Biased sampling ([#4443](https://github.com/rapidsai/cugraph/pull/4443)) [@seunghwak](https://github.com/seunghwak)
+
+## 🛠️ Improvements
+
+- nx-cugraph: check networkx version ([#4571](https://github.com/rapidsai/cugraph/pull/4571)) [@eriknw](https://github.com/eriknw)
+- nx-cugraph: add `G.__networkx_cache__` to enable graph conversion caching ([#4567](https://github.com/rapidsai/cugraph/pull/4567)) [@eriknw](https://github.com/eriknw)
+- split up CUDA-suffixed dependencies in dependencies.yaml ([#4552](https://github.com/rapidsai/cugraph/pull/4552)) [@jameslamb](https://github.com/jameslamb)
+- Use workflow branch 24.08 again ([#4544](https://github.com/rapidsai/cugraph/pull/4544)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+- Support non p2p configuration when initializing the comms ([#4543](https://github.com/rapidsai/cugraph/pull/4543)) [@jnke2016](https://github.com/jnke2016)
+- Fix Warning from `simpleDistributedGraph.py` ([#4540](https://github.com/rapidsai/cugraph/pull/4540)) [@nv-rliu](https://github.com/nv-rliu)
+- Create a graph from the edge list in multiple chunks ([#4539](https://github.com/rapidsai/cugraph/pull/4539)) [@seunghwak](https://github.com/seunghwak)
+- nx-cugraph: add dijkstra sssp functions ([#4538](https://github.com/rapidsai/cugraph/pull/4538)) [@eriknw](https://github.com/eriknw)
+- nx-cugraph: add `from_dict_of_lists` and `to_dict_of_lists` ([#4537](https://github.com/rapidsai/cugraph/pull/4537)) [@eriknw](https://github.com/eriknw)
+- Ensure `get_test_data.sh` doesn't re-download datasets ([#4536](https://github.com/rapidsai/cugraph/pull/4536)) [@trxcllnt](https://github.com/trxcllnt)
+- Define and Implement C API for biased sampling ([#4535](https://github.com/rapidsai/cugraph/pull/4535)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Build and test with CUDA 12.5.1 ([#4534](https://github.com/rapidsai/cugraph/pull/4534)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+- Refactor C++ unit tests to allow finer grained filtering ([#4533](https://github.com/rapidsai/cugraph/pull/4533)) [@ChuckHastings](https://github.com/ChuckHastings)
+- [IMP] Set the Default WG Memory Type to 'distributed' for the MNMG PyG Example ([#4532](https://github.com/rapidsai/cugraph/pull/4532)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- nx-cugraph: add `relabel_nodes` and `convert_node_labels_to_integers` ([#4531](https://github.com/rapidsai/cugraph/pull/4531)) [@eriknw](https://github.com/eriknw)
+- Add `-cuXX` suffixed versions of cugraph-service-client dependency to pyproject.toml's project.dependencies list ([#4530](https://github.com/rapidsai/cugraph/pull/4530)) [@trxcllnt](https://github.com/trxcllnt)
+- Further optimize `from_pandas_edgelist` with cudf ([#4528](https://github.com/rapidsai/cugraph/pull/4528)) [@eriknw](https://github.com/eriknw)
+- Performance optimize BFS (including direction optimizing BFS implementation, mainly for single-GPU) ([#4527](https://github.com/rapidsai/cugraph/pull/4527)) [@seunghwak](https://github.com/seunghwak)
+- Add CUDA_STATIC_MATH_LIBRARIES ([#4526](https://github.com/rapidsai/cugraph/pull/4526)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+- Better handle cudf.pandas in `from_pandas_edgelist` ([#4525](https://github.com/rapidsai/cugraph/pull/4525)) [@eriknw](https://github.com/eriknw)
+- Skip the benchmark ctests within CI ([#4522](https://github.com/rapidsai/cugraph/pull/4522)) [@ChuckHastings](https://github.com/ChuckHastings)
+- remove thriftpy2 ceiling ([#4521](https://github.com/rapidsai/cugraph/pull/4521)) [@jameslamb](https://github.com/jameslamb)
+- Avoid --find-links in wheel jobs ([#4509](https://github.com/rapidsai/cugraph/pull/4509)) [@jameslamb](https://github.com/jameslamb)
+- Refactor code base to reduce memory requirement for building libcugraph ([#4506](https://github.com/rapidsai/cugraph/pull/4506)) [@naimnv](https://github.com/naimnv)
+- Tweak rmm configuration for C++ unit tests ([#4503](https://github.com/rapidsai/cugraph/pull/4503)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Expose new all-pairs Similarity algorithms ([#4502](https://github.com/rapidsai/cugraph/pull/4502)) [@jnke2016](https://github.com/jnke2016)
+- remove openmpi ceiling ([#4496](https://github.com/rapidsai/cugraph/pull/4496)) [@jameslamb](https://github.com/jameslamb)
+- Cut peak memory footprint in per_v_transform_reduce_dst_key_aggregated_outgoing_e ([#4484](https://github.com/rapidsai/cugraph/pull/4484)) [@seunghwak](https://github.com/seunghwak)
+- Skip MG `dgl_uniform_sampler` test in nightlies ([#4479](https://github.com/rapidsai/cugraph/pull/4479)) [@nv-rliu](https://github.com/nv-rliu)
+- Remove text builds of documentation ([#4468](https://github.com/rapidsai/cugraph/pull/4468)) [@vyasr](https://github.com/vyasr)
+- [IMP] Limit the Test Data Size when Running CI in `gcn_dist_sg.py` ([#4461](https://github.com/rapidsai/cugraph/pull/4461)) [@alexbarghi-nv](https://github.com/alexbarghi-nv)
+- Forward Merge branch-24.06 into branch-24.08 ([#4454](https://github.com/rapidsai/cugraph/pull/4454)) [@nv-rliu](https://github.com/nv-rliu)
+- Properly clean up python directories ([#4453](https://github.com/rapidsai/cugraph/pull/4453)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Fixes for On-Going MG Test Failures ([#4450](https://github.com/rapidsai/cugraph/pull/4450)) [@nv-rliu](https://github.com/nv-rliu)
+- remove unnecessary 'setuptools' and 'wheel' dependencies ([#4448](https://github.com/rapidsai/cugraph/pull/4448)) [@jameslamb](https://github.com/jameslamb)
+- MG Implementation K-Truss ([#4438](https://github.com/rapidsai/cugraph/pull/4438)) [@jnke2016](https://github.com/jnke2016)
+- Overhaul ops-codeowners ([#4409](https://github.com/rapidsai/cugraph/pull/4409)) [@raydouglass](https://github.com/raydouglass)
+- Use rapids-build-backend ([#4393](https://github.com/rapidsai/cugraph/pull/4393)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA)
+- Optimize K-Truss ([#4375](https://github.com/rapidsai/cugraph/pull/4375)) [@jnke2016](https://github.com/jnke2016)
+
# cugraph 24.06.00 (5 Jun 2024)
## 🚨 Breaking Changes
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/cugraph-dgl/notebooks/get_node_storage.ipynb b/benchmarks/cugraph-dgl/notebooks/get_node_storage.ipynb
index 95b456c7812..4681c8ec825 100644
--- a/benchmarks/cugraph-dgl/notebooks/get_node_storage.ipynb
+++ b/benchmarks/cugraph-dgl/notebooks/get_node_storage.ipynb
@@ -18,7 +18,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
diff --git a/benchmarks/cugraph-dgl/notebooks/heterogeneous_dataloader_benchmark.ipynb b/benchmarks/cugraph-dgl/notebooks/heterogeneous_dataloader_benchmark.ipynb
index d3b054bb0ee..2c4a934827a 100644
--- a/benchmarks/cugraph-dgl/notebooks/heterogeneous_dataloader_benchmark.ipynb
+++ b/benchmarks/cugraph-dgl/notebooks/heterogeneous_dataloader_benchmark.ipynb
@@ -176,7 +176,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/dgl/dataloading/dataloader.py:859: DGLWarning: Dataloader CPU affinity opt is not enabled, consider switching it on (see enable_cpu_affinity() or CPU best practices for DGL [https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html])\n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/dgl/dataloading/dataloader.py:859: DGLWarning: Dataloader CPU affinity opt is not enabled, consider switching it on (see enable_cpu_affinity() or CPU best practices for DGL [https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html])\n",
" dgl_warning(f'Dataloader CPU affinity opt is not enabled, consider switching it on '\n"
]
},
diff --git a/benchmarks/cugraph-dgl/notebooks/homogenous_dataloader_benchmark.ipynb b/benchmarks/cugraph-dgl/notebooks/homogenous_dataloader_benchmark.ipynb
index ea1e9b34965..ecd111dabdf 100644
--- a/benchmarks/cugraph-dgl/notebooks/homogenous_dataloader_benchmark.ipynb
+++ b/benchmarks/cugraph-dgl/notebooks/homogenous_dataloader_benchmark.ipynb
@@ -26,7 +26,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
@@ -190,7 +190,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/dgl/dataloading/dataloader.py:859: DGLWarning: Dataloader CPU affinity opt is not enabled, consider switching it on (see enable_cpu_affinity() or CPU best practices for DGL [https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html])\n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/dgl/dataloading/dataloader.py:859: DGLWarning: Dataloader CPU affinity opt is not enabled, consider switching it on (see enable_cpu_affinity() or CPU best practices for DGL [https://docs.dgl.ai/tutorials/cpu/cpu_best_practises.html])\n",
" dgl_warning(f'Dataloader CPU affinity opt is not enabled, consider switching it on '\n"
]
},
@@ -278,7 +278,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/distributed/worker.py:2988: UserWarning: Large object of size 1.42 MiB detected in task graph: \n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/distributed/worker.py:2988: UserWarning: Large object of size 1.42 MiB detected in task graph: \n",
" [b'\\xad\\xd1\\xe3\\x9c\\x96\\x83O\\xb3\\xba1\\x86\\x94\\xb6\\ ... =int32), False]\n",
"Consider scattering large objects ahead of time\n",
"with client.scatter to reduce scheduler burden and \n",
diff --git a/benchmarks/cugraph-dgl/python-script/ogbn_mag_benchmark.py b/benchmarks/cugraph-dgl/python-script/ogbn_mag_benchmark.py
index 539fe333b1e..55ff0043e30 100644
--- a/benchmarks/cugraph-dgl/python-script/ogbn_mag_benchmark.py
+++ b/benchmarks/cugraph-dgl/python-script/ogbn_mag_benchmark.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2022-2023, NVIDIA CORPORATION.
+# Copyright (c) 2022-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
@@ -126,4 +126,4 @@ def sampling_func(g, seed_nodes, labels, train_loader):
st = time.time()
sampling_func(g, subset_split_idx["train"], labels, train_loader)
et = time.time()
- print(f"Sampling time taken = {et-st} s")
+ print(f"Sampling time taken = {et - st} s")
diff --git a/benchmarks/cugraph/notebooks/feature_storage.ipynb b/benchmarks/cugraph/notebooks/feature_storage.ipynb
index 7413ac00cde..440d76fbdb4 100644
--- a/benchmarks/cugraph/notebooks/feature_storage.ipynb
+++ b/benchmarks/cugraph/notebooks/feature_storage.ipynb
@@ -18,7 +18,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/datasets/vjawa/miniconda3/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
+ "/datasets/vjawa/miniforge/envs/all_cuda-115_arch-x86_64/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
diff --git a/benchmarks/cugraph/pytest-based/bench_cugraph_uniform_neighbor_sample.py b/benchmarks/cugraph/pytest-based/bench_cugraph_uniform_neighbor_sample.py
index 8c46095a7da..083acdde2f4 100644
--- a/benchmarks/cugraph/pytest-based/bench_cugraph_uniform_neighbor_sample.py
+++ b/benchmarks/cugraph/pytest-based/bench_cugraph_uniform_neighbor_sample.py
@@ -266,7 +266,7 @@ def uns_func(*args, **kwargs):
@pytest.mark.managedmem_off
@pytest.mark.poolallocator_on
@pytest.mark.parametrize("batch_size", params.batch_sizes.values())
-@pytest.mark.parametrize("fanout", [params.fanout_10_25, params.fanout_5_10_15])
+@pytest.mark.parametrize("fanout", [params.fanout_10_25])
@pytest.mark.parametrize(
"with_replacement", [False], ids=lambda v: f"with_replacement={v}"
)
@@ -287,6 +287,8 @@ def bench_cugraph_uniform_neighbor_sample(
start_list=uns_args["start_list"],
fanout_vals=uns_args["fanout"],
with_replacement=uns_args["with_replacement"],
+ use_legacy_names=False,
+ with_edge_properties=True,
)
"""
dtmap = {"int32": 32 // 8, "int64": 64 // 8}
diff --git a/benchmarks/nx-cugraph/pytest-based/README.md b/benchmarks/nx-cugraph/pytest-based/README.md
new file mode 100644
index 00000000000..781550fa560
--- /dev/null
+++ b/benchmarks/nx-cugraph/pytest-based/README.md
@@ -0,0 +1,54 @@
+## `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
index d40b5130827..f88d93c3f17 100644
--- a/benchmarks/nx-cugraph/pytest-based/bench_algos.py
+++ b/benchmarks/nx-cugraph/pytest-based/bench_algos.py
@@ -271,9 +271,8 @@ def bench_from_networkx(benchmark, graph_obj):
# normalized_param_values = [True, False]
-# k_param_values = [10, 100]
normalized_param_values = [True]
-k_param_values = [10]
+k_param_values = [10, 100, 1000]
@pytest.mark.parametrize(
@@ -282,6 +281,10 @@ def bench_from_networkx(benchmark, graph_obj):
@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,),
@@ -305,6 +308,10 @@ 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,),
@@ -473,6 +480,26 @@ def bench_pagerank_personalized(benchmark, graph_obj, backend_wrapper):
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)
diff --git a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py
new file mode 100644
index 00000000000..f1cc4b06ccc
--- /dev/null
+++ b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py
@@ -0,0 +1,291 @@
+# 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
new file mode 100644
index 00000000000..5a0a15da8ee
--- /dev/null
+++ b/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py
@@ -0,0 +1,35 @@
+# 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-main-benchmarks.sh b/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh
new file mode 100755
index 00000000000..3059e3d4bdf
--- /dev/null
+++ b/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh
@@ -0,0 +1,74 @@
+#!/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/benchmarks/pytest.ini b/benchmarks/pytest.ini
index fe7fc31b6d6..d692b78de37 100644
--- a/benchmarks/pytest.ini
+++ b/benchmarks/pytest.ini
@@ -8,6 +8,7 @@ testpaths =
addopts =
--benchmark-columns="min, max, mean, stddev, outliers"
+ --tb=native
markers =
managedmem_on: RMM managed memory enabled
diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh
index 707c61e4d3e..f3979ab3049 100755
--- a/ci/build_wheel.sh
+++ b/ci/build_wheel.sh
@@ -17,7 +17,7 @@ cd "${package_dir}"
python -m pip wheel \
-w dist \
- -vvv \
+ -v \
--no-deps \
--disable-pip-version-check \
--extra-index-url https://pypi.nvidia.com \
@@ -30,7 +30,23 @@ if [[ ${package_name} == "nx-cugraph" ]] || \
[[ ${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 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
diff --git a/ci/build_wheel_cugraph.sh b/ci/build_wheel_cugraph.sh
index 6f1b23923ff..20d9bf47e3e 100755
--- a/ci/build_wheel_cugraph.sh
+++ b/ci/build_wheel_cugraph.sh
@@ -19,8 +19,16 @@ export PIP_CONSTRAINT="${PWD}/constraints.txt"
PARALLEL_LEVEL=$(python -c \
"from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))")
+case "${RAPIDS_CUDA_VERSION}" in
+ 12.*)
+ EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=ON"
+ ;;
+ 11.*)
+ EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=OFF"
+ ;;
+esac
-export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"
+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
diff --git a/ci/build_wheel_pylibcugraph.sh b/ci/build_wheel_pylibcugraph.sh
index ee33ab4a82d..fa967b0be29 100755
--- a/ci/build_wheel_pylibcugraph.sh
+++ b/ci/build_wheel_pylibcugraph.sh
@@ -6,7 +6,16 @@ set -euo pipefail
PARALLEL_LEVEL=$(python -c \
"from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))")
-export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"
+case "${RAPIDS_CUDA_VERSION}" in
+ 12.*)
+ EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=ON"
+ ;;
+ 11.*)
+ EXTRA_CMAKE_ARGS=";-DUSE_CUDA_MATH_WHEELS=OFF"
+ ;;
+esac
+
+export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-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
diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh
index 08c22fca02e..5859ebde953 100755
--- a/ci/release/update-version.sh
+++ b/ci/release/update-version.sh
@@ -30,7 +30,7 @@ CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}
NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}')
NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
-NEXT_UCX_PY_VERSION="$(curl -sL https://version.gpuci.io/rapids/${NEXT_SHORT_TAG})"
+NEXT_UCXX_SHORT_TAG="$(curl -sL https://version.gpuci.io/rapids/${NEXT_SHORT_TAG})"
echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"
@@ -45,7 +45,8 @@ function sed_runner() {
echo "${NEXT_FULL_TAG}" > VERSION
# Need to distutils-normalize the original version
-NEXT_SHORT_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_SHORT_TAG}'))")
+NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_SHORT_TAG}'))")
+NEXT_UCXX_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_UCXX_SHORT_TAG}'))")
DEPENDENCIES=(
cudf
@@ -71,23 +72,30 @@ DEPENDENCIES=(
rmm
rapids-dask-dependency
)
+UCXX_DEPENDENCIES=(
+ ucx-py
+)
for FILE in dependencies.yaml conda/environments/*.yaml python/cugraph-{pyg,dgl}/conda/*.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
- sed_runner "/-.* ucx-py\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_UCX_PY_VERSION}.*,>=0.0.0a0/g" "${FILE}"
+ for DEP in "${UCXX_DEPENDENCIES[@]}"; do
+ sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_UCXX_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
+ done
done
for FILE in python/**/pyproject.toml python/**/**/pyproject.toml; 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
- sed_runner "/\"ucx-py\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*\"/==${NEXT_UCX_PY_VERSION}.*,>=0.0.0a0\"/g" "${FILE}"
+ for DEP in "${UCXX_DEPENDENCIES[@]}"; do
+ sed_runner "/\"${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*\"/==${NEXT_UCXX_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" "${FILE}"
+ done
done
# ucx-py version
-sed_runner "/^ucx_py_version:$/ {n;s/.*/ - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/cugraph/conda_build_config.yaml
-sed_runner "/^ucx_py_version:$/ {n;s/.*/ - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/cugraph-service/conda_build_config.yaml
-sed_runner "/^ucx_py_version:$/ {n;s/.*/ - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/pylibcugraph/conda_build_config.yaml
+for FILE in conda/recipes/*/conda_build_config.yaml; do
+ sed_runner "/^ucx_py_version:$/ {n;s/.*/ - \"${NEXT_UCXX_SHORT_TAG_PEP440}.*\"/}" "${FILE}"
+done
# CI files
for FILE in .github/workflows/*.yaml; do
diff --git a/ci/run_nx_cugraph_pytests.sh b/ci/run_nx_cugraph_pytests.sh
index b0caffd0a0f..0e309d1e2d4 100755
--- a/ci/run_nx_cugraph_pytests.sh
+++ b/ci/run_nx_cugraph_pytests.sh
@@ -6,4 +6,5 @@ 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
-pytest --capture=no --cache-clear --benchmark-disable "$@" tests
+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_cpp.sh b/ci/test_cpp.sh
index ba106d34a46..6c14870164e 100755
--- a/ci/test_cpp.sh
+++ b/ci/test_cpp.sh
@@ -38,7 +38,7 @@ nvidia-smi
# RAPIDS_DATASET_ROOT_DIR is used by test scripts
export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
pushd "${RAPIDS_DATASET_ROOT_DIR}"
-./get_test_data.sh --subset
+./get_test_data.sh --cpp_ci_subset
popd
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/
diff --git a/ci/test_python.sh b/ci/test_python.sh
index e8c8272e8d6..f21a06cf061 100755
--- a/ci/test_python.sh
+++ b/ci/test_python.sh
@@ -108,7 +108,7 @@ 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
-pytest \
+NX_CUGRAPH_USE_COMPAT_GRAPHS=False pytest \
--pyargs nx_cugraph \
--config-file=../pyproject.toml \
--cov-config=../pyproject.toml \
@@ -159,7 +159,7 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
cugraph \
cugraph-dgl \
'dgl>=1.1.0.cu*,<=2.0.0.cu*' \
- 'pytorch>=2.0' \
+ 'pytorch>=2.3,<2.4' \
'cuda-version=11.8'
rapids-print-env
@@ -198,10 +198,10 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
# 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.1.0+cu118.html"
+ 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.1.0+cu121.html"
+ # PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu121.html"
#fi
# Will automatically install built dependencies of cuGraph-PyG
diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh
index 158704e08d1..e3690dfde6e 100755
--- a/ci/test_wheel.sh
+++ b/ci/test_wheel.sh
@@ -37,6 +37,7 @@ 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
index 564b46cb07e..9b79cb17fe4 100755
--- a/ci/test_wheel_cugraph-dgl.sh
+++ b/ci/test_wheel_cugraph-dgl.sh
@@ -32,18 +32,8 @@ fi
PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}"
DGL_URL="https://data.dgl.ai/wheels/cu${PYTORCH_CUDA_VER}/repo.html"
-# Starting from 2.2, PyTorch wheels depend on nvidia-nccl-cuxx>=2.19 wheel and
-# dynamically link to NCCL. RAPIDS CUDA 11 CI images have an older NCCL version that
-# might shadow the newer NCCL required by PyTorch during import (when importing
-# `cupy` before `torch`).
-if [[ "${NCCL_VERSION}" < "2.19" ]]; then
- PYTORCH_VER="2.1.0"
-else
- PYTORCH_VER="2.3.0"
-fi
-
rapids-logger "Installing PyTorch and DGL"
-rapids-retry python -m pip install "torch==${PYTORCH_VER}" --index-url ${PYTORCH_URL}
+rapids-retry python -m pip install torch==2.3.0 --index-url ${PYTORCH_URL}
rapids-retry python -m pip install dgl==2.0.0 --find-links ${DGL_URL}
python -m pytest python/cugraph-dgl/tests
diff --git a/ci/test_wheel_cugraph-pyg.sh b/ci/test_wheel_cugraph-pyg.sh
index c55ae033344..8f4b16a2dec 100755
--- a/ci/test_wheel_cugraph-pyg.sh
+++ b/ci/test_wheel_cugraph-pyg.sh
@@ -29,13 +29,13 @@ 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.1.0+cu118.html"
+ 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.1.0+cu121.html"
+ 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.1.0 --index-url ${PYTORCH_URL}
+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 \
diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml
index f0b86c791f8..a23c2395646 100644
--- a/conda/environments/all_cuda-118_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-118_arch-x86_64.yaml
@@ -16,55 +16,55 @@ dependencies:
- cuda-nvtx
- cuda-version=11.8
- cudatoolkit
-- cudf==24.10.*,>=0.0.0a0
+- cudf==24.12.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
-- dask-cuda==24.10.*,>=0.0.0a0
-- dask-cudf==24.10.*,>=0.0.0a0
+- 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.*,>=0.0.0a0
-- libcugraphops==24.10.*,>=0.0.0a0
-- libraft-headers==24.10.*,>=0.0.0a0
-- libraft==24.10.*,>=0.0.0a0
-- librmm==24.10.*,>=0.0.0a0
+- 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.9.9
+- nccl>=2.19
- networkx>=2.5.1
- networkx>=3.0
- ninja
- notebook>=0.5.0
- numba>=0.57
-- numpy>=1.23,<2.0a0
+- numpy>=1.23,<3.0a0
- numpydoc
- nvcc_linux-64=11.8
+- ogb
- openmpi
-- packaging>=21
- pandas
- pre-commit
- pydantic
- pydata-sphinx-theme
-- pylibcugraphops==24.10.*,>=0.0.0a0
-- pylibraft==24.10.*,>=0.0.0a0
-- pylibwholegraph==24.10.*,>=0.0.0a0
+- 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.0,<2.2.0a0
-- raft-dask==24.10.*,>=0.0.0a0
+- pytorch>=2.3,<2.4.0a0
+- raft-dask==24.12.*,>=0.0.0a0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
-- rapids-dask-dependency==24.10.*,>=0.0.0a0
+- rapids-dask-dependency==24.12.*,>=0.0.0a0
- recommonmark
- requests
-- rmm==24.10.*,>=0.0.0a0
-- scikit-build-core>=0.7.0
+- rmm==24.12.*,>=0.0.0a0
+- scikit-build-core>=0.10.0
- scikit-learn>=0.23.1
- scipy
- setuptools>=61.0.0
@@ -74,8 +74,9 @@ dependencies:
- sphinxcontrib-websupport
- thriftpy2!=0.5.0,!=0.5.1
- torchdata
+- torchmetrics
- ucx-proc=*=gpu
-- ucx-py==0.40.*,>=0.0.0a0
+- 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 ebded3eec92..eca10584304 100644
--- a/conda/environments/all_cuda-125_arch-x86_64.yaml
+++ b/conda/environments/all_cuda-125_arch-x86_64.yaml
@@ -18,58 +18,58 @@ dependencies:
- cuda-nvtx-dev
- cuda-profiler-api
- cuda-version=12.5
-- cudf==24.10.*,>=0.0.0a0
+- cudf==24.12.*,>=0.0.0a0
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
-- dask-cuda==24.10.*,>=0.0.0a0
-- dask-cudf==24.10.*,>=0.0.0a0
+- 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.*,>=0.0.0a0
-- libcugraphops==24.10.*,>=0.0.0a0
+- libcudf==24.12.*,>=0.0.0a0
+- libcugraphops==24.12.*,>=0.0.0a0
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
-- libraft-headers==24.10.*,>=0.0.0a0
-- libraft==24.10.*,>=0.0.0a0
-- librmm==24.10.*,>=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.9.9
+- nccl>=2.19
- networkx>=2.5.1
- networkx>=3.0
- ninja
- notebook>=0.5.0
- numba>=0.57
-- numpy>=1.23,<2.0a0
+- numpy>=1.23,<3.0a0
- numpydoc
+- ogb
- openmpi
-- packaging>=21
- pandas
- pre-commit
- pydantic
- pydata-sphinx-theme
-- pylibcugraphops==24.10.*,>=0.0.0a0
-- pylibraft==24.10.*,>=0.0.0a0
-- pylibwholegraph==24.10.*,>=0.0.0a0
+- 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.0,<2.2.0a0
-- raft-dask==24.10.*,>=0.0.0a0
+- pytorch>=2.3,<2.4.0a0
+- raft-dask==24.12.*,>=0.0.0a0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
-- rapids-dask-dependency==24.10.*,>=0.0.0a0
+- rapids-dask-dependency==24.12.*,>=0.0.0a0
- recommonmark
- requests
-- rmm==24.10.*,>=0.0.0a0
-- scikit-build-core>=0.7.0
+- rmm==24.12.*,>=0.0.0a0
+- scikit-build-core>=0.10.0
- scikit-learn>=0.23.1
- scipy
- setuptools>=61.0.0
@@ -79,8 +79,9 @@ dependencies:
- sphinxcontrib-websupport
- thriftpy2!=0.5.0,!=0.5.1
- torchdata
+- torchmetrics
- ucx-proc=*=gpu
-- ucx-py==0.40.*,>=0.0.0a0
+- ucx-py==0.41.*,>=0.0.0a0
- wget
- wheel
name: all_cuda-125_arch-x86_64
diff --git a/conda/recipes/cugraph-dgl/meta.yaml b/conda/recipes/cugraph-dgl/meta.yaml
index d1cf6fcd9e9..c80ca6890a8 100644
--- a/conda/recipes/cugraph-dgl/meta.yaml
+++ b/conda/recipes/cugraph-dgl/meta.yaml
@@ -27,11 +27,11 @@ requirements:
- cugraph ={{ version }}
- dgl >=1.1.0.cu*
- numba >=0.57
- - numpy >=1.23,<2.0a0
+ - numpy >=1.23,<3.0a0
- pylibcugraphops ={{ minor_version }}
- tensordict >=0.1.2
- python
- - pytorch >=2.0
+ - pytorch >=2.3,<2.4.0a0
- cupy >=12.0.0
tests:
diff --git a/conda/recipes/cugraph-pyg/meta.yaml b/conda/recipes/cugraph-pyg/meta.yaml
index 2e1788ac0c6..38d4a3d7d15 100644
--- a/conda/recipes/cugraph-pyg/meta.yaml
+++ b/conda/recipes/cugraph-pyg/meta.yaml
@@ -29,9 +29,9 @@ requirements:
run:
- rapids-dask-dependency ={{ minor_version }}
- numba >=0.57
- - numpy >=1.23,<2.0a0
+ - numpy >=1.23,<3.0a0
- python
- - pytorch >=2.0
+ - pytorch >=2.3,<2.4.0a0
- cupy >=12.0.0
- cugraph ={{ version }}
- pylibcugraphops ={{ minor_version }}
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-service/meta.yaml b/conda/recipes/cugraph-service/meta.yaml
index c1027582c78..7df7573e2d0 100644
--- a/conda/recipes/cugraph-service/meta.yaml
+++ b/conda/recipes/cugraph-service/meta.yaml
@@ -63,7 +63,7 @@ outputs:
- dask-cuda ={{ minor_version }}
- dask-cudf ={{ minor_version }}
- numba >=0.57
- - numpy >=1.23,<2.0a0
+ - numpy >=1.23,<3.0a0
- python
- rapids-dask-dependency ={{ minor_version }}
- thriftpy2 >=0.4.15,!=0.5.0,!=0.5.1
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 fccc3a208d6..9f5a137faba 100644
--- a/conda/recipes/cugraph/meta.yaml
+++ b/conda/recipes/cugraph/meta.yaml
@@ -68,7 +68,7 @@ requirements:
- python
- raft-dask ={{ minor_version }}
- rmm ={{ minor_version }}
- - scikit-build-core >=0.7.0
+ - scikit-build-core >=0.10.0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
run:
- aiohttp
diff --git a/conda/recipes/libcugraph/conda_build_config.yaml b/conda/recipes/libcugraph/conda_build_config.yaml
index 26aa428d7f5..55bd635c330 100644
--- a/conda/recipes/libcugraph/conda_build_config.yaml
+++ b/conda/recipes/libcugraph/conda_build_config.yaml
@@ -17,7 +17,7 @@ doxygen_version:
- ">=1.8.11"
nccl_version:
- - ">=2.9.9"
+ - ">=2.19"
c_stdlib:
- sysroot
diff --git a/conda/recipes/nx-cugraph/meta.yaml b/conda/recipes/nx-cugraph/meta.yaml
index d67287be757..263f53d9a8f 100644
--- a/conda/recipes/nx-cugraph/meta.yaml
+++ b/conda/recipes/nx-cugraph/meta.yaml
@@ -14,9 +14,7 @@ source:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
- build:
- number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
+ string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
requirements:
host:
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/conda/recipes/pylibcugraph/meta.yaml b/conda/recipes/pylibcugraph/meta.yaml
index 15632cfcc0e..54d29a68d91 100644
--- a/conda/recipes/pylibcugraph/meta.yaml
+++ b/conda/recipes/pylibcugraph/meta.yaml
@@ -65,7 +65,7 @@ requirements:
- libcugraph ={{ version }}
- pylibraft ={{ minor_version }}
- python
- - scikit-build-core >=0.7.0
+ - scikit-build-core >=0.10.0
- rapids-build-backend>=0.3.1,<0.4.0.dev0
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 441627cabce..b8eaba9d575 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -332,8 +332,12 @@ set(CUGRAPH_SOURCES
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/renumber_sampled_edgelist_sg_v64_e64.cu
- src/sampling/renumber_sampled_edgelist_sg_v32_e32.cu
+ src/sampling/negative_sampling_sg_v32_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
@@ -483,6 +487,7 @@ set(CUGRAPH_SOURCES
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
@@ -656,6 +661,7 @@ add_library(cugraph_c
src/c_api/louvain.cpp
src/c_api/triangle_count.cpp
src/c_api/neighbor_sampling.cpp
+ src/c_api/negative_sampling.cpp
src/c_api/labeling_result.cpp
src/c_api/weakly_connected_components.cpp
src/c_api/strongly_connected_components.cpp
diff --git a/cpp/examples/developers/graph_operations/graph_operations.cu b/cpp/examples/developers/graph_operations/graph_operations.cu
index 014cedcab7e..912f9f1fd46 100644
--- a/cpp/examples/developers/graph_operations/graph_operations.cu
+++ b/cpp/examples/developers/graph_operations/graph_operations.cu
@@ -131,7 +131,7 @@ create_graph(raft::handle_t const& handle,
//
if (multi_gpu) {
- std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) =
+ std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) =
cugraph::shuffle_external_edges(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
@@ -215,10 +215,10 @@ void perform_example_graph_operations(
graph_view);
cugraph::update_edge_src_property(
- handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache);
+ handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache.mutable_view());
cugraph::update_edge_dst_property(
- handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache);
+ handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache.mutable_view());
rmm::device_uvector weighted_averages(
size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream());
@@ -259,10 +259,10 @@ void perform_example_graph_operations(
graph_view);
cugraph::update_edge_src_property(
- handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache);
+ handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache.mutable_view());
cugraph::update_edge_dst_property(
- handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache);
+ handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache.mutable_view());
rmm::device_uvector weighted_averages(
size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream());
diff --git a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu
index ce02e3b2639..c261ff6d843 100644
--- a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu
+++ b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu
@@ -127,7 +127,7 @@ create_graph(raft::handle_t const& handle,
//
if (multi_gpu) {
- std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) =
+ std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) =
cugraph::shuffle_external_edges(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
diff --git a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp
index a9e2a170208..db629117604 100644
--- a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp
+++ b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp
@@ -123,7 +123,7 @@ create_graph(raft::handle_t const& handle,
//
if (multi_gpu) {
- std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) =
+ std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) =
cugraph::shuffle_external_edges(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
@@ -248,9 +248,8 @@ void run_graph_algorithms(
std::cout);
}
-int main(int argc, char** argv)
+void run_tests()
{
- initialize_mpi_and_set_device(argc, argv);
std::unique_ptr handle = initialize_mg_handle();
//
@@ -279,6 +278,7 @@ int main(int argc, char** argv)
std::move(std::make_optional(edge_wgts)),
renumber,
is_symmetric);
+
// Non-owning view of the graph object
auto graph_view = graph.view();
@@ -292,5 +292,14 @@ int main(int argc, char** argv)
run_graph_algorithms(
*handle, graph_view, edge_weight_view);
+ handle.release();
+}
+
+int main(int argc, char** argv)
+{
+ initialize_mpi_and_set_device(argc, argv);
+
+ run_tests();
+
RAFT_MPI_TRY(MPI_Finalize());
}
diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp
index 8ba39fa2328..7e5af4ac686 100644
--- a/cpp/include/cugraph/algorithms.hpp
+++ b/cpp/include/cugraph/algorithms.hpp
@@ -1579,11 +1579,11 @@ std::
template
std::tuple, std::optional>>
uniform_random_walks(raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
graph_view_t const& graph_view,
std::optional> edge_weight_view,
raft::device_span start_vertices,
- size_t max_length,
- uint64_t seed = std::numeric_limits::max());
+ size_t max_length);
/**
* @brief returns biased random walks from starting sources, where each path is of given
@@ -1623,11 +1623,11 @@ uniform_random_walks(raft::handle_t const& handle,
template
std::tuple, std::optional>>
biased_random_walks(raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
graph_view_t const& graph_view,
edge_property_view_t edge_weight_view,
raft::device_span start_vertices,
- size_t max_length,
- uint64_t seed = std::numeric_limits::max());
+ size_t max_length);
/**
* @brief returns biased random walks with node2vec biases from starting sources,
@@ -1670,13 +1670,13 @@ biased_random_walks(raft::handle_t const& handle,
template
std::tuple, std::optional>>
node2vec_random_walks(raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
graph_view_t const& graph_view,
std::optional> edge_weight_view,
raft::device_span start_vertices,
size_t max_length,
weight_t p,
- weight_t q,
- uint64_t seed = std::numeric_limits::max());
+ weight_t q);
#ifndef NO_CUGRAPH_OPS
/**
@@ -1684,6 +1684,8 @@ node2vec_random_walks(raft::handle_t const& handle,
* 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
@@ -1714,6 +1716,8 @@ sample_neighbors_adjacency_list(raft::handle_t const& handle,
* 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
@@ -1869,12 +1873,16 @@ void triangle_count(raft::handle_t const& handle,
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param graph_view Graph view object.
+ * * @param do_expensive_check A flag to run expensive checks for input arguments (if set to
+ * `true`).
*
* @return edge_property_t containing the edge triangle count
*/
template
edge_property_t, edge_t> edge_triangle_count(
- raft::handle_t const& handle, graph_view_t const& graph_view);
+ raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ bool do_expensive_check = false);
/*
* @brief Compute K-Truss.
diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp
index 61ac1bd2804..3d99b85556b 100644
--- a/cpp/include/cugraph/detail/utility_wrappers.hpp
+++ b/cpp/include/cugraph/detail/utility_wrappers.hpp
@@ -87,6 +87,28 @@ void sequence_fill(rmm::cuda_stream_view const& stream_view,
size_t size,
value_t start_value);
+/**
+ * @brief Fill a buffer with a sequence of values with the input stride
+ *
+ * Fills the buffer with the sequence with the input stride:
+ * {start_value, start_value+stride, start_value+stride*2, ..., start_value+stride*(size-1)}
+ *
+ * @tparam value_t type of the value to operate on
+ *
+ * @param[in] stream_view stream view
+ * @param[out] d_value device array to fill
+ * @param[in] size number of elements in array
+ * @param[in] start_value starting value for sequence
+ * @param[in] stride input stride
+ *
+ */
+template
+void stride_fill(rmm::cuda_stream_view const& stream_view,
+ value_t* d_value,
+ size_t size,
+ value_t start_value,
+ value_t stride);
+
/**
* @brief Compute the maximum vertex id of an edge list
*
diff --git a/cpp/include/cugraph/graph_functions.hpp b/cpp/include/cugraph/graph_functions.hpp
index e1364f69991..866ab16ee97 100644
--- a/cpp/include/cugraph/graph_functions.hpp
+++ b/cpp/include/cugraph/graph_functions.hpp
@@ -988,63 +988,6 @@ rmm::device_uvector select_random_vertices(
bool sort_vertices,
bool do_expensive_check = false);
-/**
- * @brief renumber sampling output
- *
- * @deprecated This API will be deprecated and will be replaced by the
- * renumber_and_compress_sampled_edgelist and renumber_and_sort_sampled_edgelist functions in
- * sampling_functions.hpp.
- *
- * This function renumbers sampling function (e.g. uniform_neighbor_sample) outputs satisfying the
- * following requirements.
- *
- * 1. If @p edgelist_hops is valid, we can consider (vertex ID, flag=src, hop) triplets for each
- * vertex ID in @p edgelist_srcs and (vertex ID, flag=dst, hop) triplets for each vertex ID in @p
- * edgelist_dsts. From these triplets, we can find the minimum (hop, flag) pairs for every unique
- * vertex ID (hop is the primary key and flag is the secondary key, flag=src is considered smaller
- * than flag=dst if hop numbers are same). Vertex IDs with smaller (hop, flag) pairs precede vertex
- * IDs with larger (hop, flag) pairs in renumbering. Ordering can be arbitrary among the vertices
- * with the same (hop, flag) pairs.
- * 2. If @p edgelist_hops is invalid, unique vertex IDs in @p edgelist_srcs precede vertex IDs that
- * appear only in @p edgelist_dsts.
- * 3. If label_offsets.has_value() is ture, edge lists for different labels will be renumbered
- * separately.
- *
- * This function is single-GPU only (we are not aware of any practical multi-GPU use cases).
- *
- * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
- * @tparam label_t Type of labels. Needs to be an integral type.
- * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
- * handles to various CUDA libraries) to run graph algorithms.
- * @param edgelist_srcs A vector storing original edgelist source vertices.
- * @param edgelist_dsts A vector storing original edgelist destination vertices (size = @p
- * edgelist_srcs.size()).
- * @param edgelist_hops An optional pointer to the array storing hops for each edge list (source,
- * destination) pairs (size = @p edgelist_srcs.size() if valid).
- * @param label_offsets An optional tuple of unique labels and the input edge list (@p
- * edgelist_srcs, @p edgelist_hops, and @p edgelist_dsts) offsets for the labels (siez = # unique
- * labels + 1).
- * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
- * @return Tuple of vectors storing renumbered edge sources (size = @p edgelist_srcs.size()) ,
- * renumbered edge destinations (size = @p edgelist_dsts.size()), renumber_map to query original
- * verties (size = # unique vertices or aggregate # unique vertices for every label), and
- * renumber_map offsets (size = std::get<0>(*label_offsets).size() + 1, valid only if @p
- * label_offsets.has_value() is true).
- */
-template
-std::tuple,
- rmm::device_uvector,
- rmm::device_uvector,
- std::optional>>
-renumber_sampled_edgelist(
- raft::handle_t const& handle,
- rmm::device_uvector&& edgelist_srcs,
- rmm::device_uvector&& edgelist_dsts,
- std::optional> edgelist_hops,
- std::optional, raft::device_span>>
- label_offsets,
- bool do_expensive_check = false);
-
/**
* @brief Remove self loops from an edge list
*
@@ -1178,7 +1121,8 @@ std::tuple,
rmm::device_uvector,
std::optional>,
std::optional>,
- std::optional>>
+ std::optional>,
+ std::vector>
shuffle_external_edges(raft::handle_t const& handle,
rmm::device_uvector&& edge_srcs,
rmm::device_uvector&& edge_dsts,
diff --git a/cpp/include/cugraph/graph_view.hpp b/cpp/include/cugraph/graph_view.hpp
index cbb52ef3b1e..a2ff3166fa4 100644
--- a/cpp/include/cugraph/graph_view.hpp
+++ b/cpp/include/cugraph/graph_view.hpp
@@ -636,7 +636,7 @@ class graph_view_t edge_srcs,
raft::device_span edge_dsts,
- bool do_expensive_check = false);
+ bool do_expensive_check = false) const;
rmm::device_uvector compute_multiplicity(
raft::handle_t const& handle,
@@ -945,7 +945,7 @@ class graph_view_t has_edge(raft::handle_t const& handle,
raft::device_span edge_srcs,
raft::device_span edge_dsts,
- bool do_expensive_check = false);
+ bool do_expensive_check = false) const;
rmm::device_uvector compute_multiplicity(raft::handle_t const& handle,
raft::device_span edge_srcs,
diff --git a/cpp/include/cugraph/mtmg/instance_manager.hpp b/cpp/include/cugraph/mtmg/instance_manager.hpp
index a2111804997..759635b4a34 100644
--- a/cpp/include/cugraph/mtmg/instance_manager.hpp
+++ b/cpp/include/cugraph/mtmg/instance_manager.hpp
@@ -20,6 +20,8 @@
#include
+#include
+
#include
namespace cugraph {
diff --git a/cpp/include/cugraph/mtmg/resource_manager.hpp b/cpp/include/cugraph/mtmg/resource_manager.hpp
index a9e4b81f894..e9d25c4576b 100644
--- a/cpp/include/cugraph/mtmg/resource_manager.hpp
+++ b/cpp/include/cugraph/mtmg/resource_manager.hpp
@@ -27,6 +27,8 @@
#include
#include
+#include
+
#include
namespace cugraph {
diff --git a/cpp/include/cugraph/sampling_functions.hpp b/cpp/include/cugraph/sampling_functions.hpp
index fec1a07604e..783cd3a7e2b 100644
--- a/cpp/include/cugraph/sampling_functions.hpp
+++ b/cpp/include/cugraph/sampling_functions.hpp
@@ -476,12 +476,12 @@ renumber_and_sort_sampled_edgelist(
* 1. If @p edgelist_hops is valid, we can consider (vertex ID, hop, flag=major) triplets for each
* vertex ID in edge majors (@p edgelist_srcs if @p src_is_major is true, @p edgelist_dsts if false)
* and (vertex ID, hop, flag=minor) triplets for each vertex ID in edge minors. From these triplets,
- * we can find the minimum (hop, flag) pairs for every unique vertex ID (hop is the primary key and
+ * we can find the minimum (hop, flag) pair for every unique vertex ID (hop is the primary key and
* flag is the secondary key, flag=major is considered smaller than flag=minor if hop numbers are
* same). Vertex IDs with smaller (hop, flag) pairs precede vertex IDs with larger (hop, flag) pairs
* in renumbering (if their vertex types are same, vertices with different types are renumbered
* separately). Ordering can be arbitrary among the vertices with the same (vertex type, hop, flag)
- * triplets. If @p seed_vertices.has-value() is true, we assume (hop=0, flag=major) for every vertex
+ * triplets. If @p seed_vertices.has_value() is true, we assume (hop=0, flag=major) for every vertex
* in @p *seed_vertices in renumbering (this is relevant when there are seed vertices with no
* neighbors).
* 2. If @p edgelist_hops is invalid, unique vertex IDs in edge majors precede vertex IDs that
@@ -495,11 +495,15 @@ renumber_and_sort_sampled_edgelist(
* Edge IDs are renumbered fulfilling the following requirements (This is relevant only when @p
* edgelist_edge_ids.has_value() is true).
*
- * 1. If @p edgelist_edge_types.has_value() is true, unique (edge type, edge ID) pairs are
- * renumbered to consecutive integers starting from 0 for each edge type. If @p
- * edgelist_edge_types.has_value() is true, unique edge IDs are renumbered to consecutive inetgers
- * starting from 0.
- * 2. If edgelist_label_offsets.has_value() is true, edge lists for different labels will be
+ * 1. If @p edgelist_hops is valid, we can consider (edge ID, hop) pairs. From these pairs, we can
+ * find the minimum hop value for every unique edge ID. Edge IDs with smaller hop values precede
+ * edge IDs with larger hop values in renumbering (if their edge types are same, edges with
+ * different edge types are renumbered separately). Ordering can be arbitrary among the edge IDs
+ * with the same (edge type, hop) pairs.
+ * 2. If @p edgelist_edge_hops.has_value() is false, unique edge IDs (for each edge type is @p
+ * edgelist_edge_types.has_value() is true) are mapped to consecutive integers starting from 0. The
+ * ordering can be arbitrary.
+ * 3. If edgelist_label_offsets.has_value() is true, edge lists for different labels will be
* renumbered separately.
*
* The renumbered edges are sorted based on the following rules.
@@ -510,6 +514,11 @@ renumber_and_sort_sampled_edgelist(
* true.
* 2. Edges in each label are sorted independently if @p edgelist_label_offsets.has_value() is true.
*
+ * This function assumes that there is a single edge source vertex type and a single edge
+ * destination vertex type for each edge. If @p edgelist_edge_types.has_value() is false (i.e. there
+ * is only one edge type), there should be only one edge source vertex type and only one edge
+ * destination vertex type; the source & destination vertex types may or may not coincide.
+ *
* This function is single-GPU only (we are not aware of any practical multi-GPU use cases).
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
@@ -530,19 +539,16 @@ renumber_and_sort_sampled_edgelist(
* edgelist_srcs.size() if valid).
* @param edgelist_hops An optional vector storing edge list hop numbers (size = @p
* edgelist_srcs.size() if valid). @p edgelist_hops should be valid if @p num_hops >= 2.
- * @param edgelist_label_offsets An optional pointer to the array storing label offsets to the input
- * edges (size = @p num_labels + 1). @p edgelist_label_offsets should be valid if @p num_labels
- * >= 2.
* @param seed_vertices An optional pointer to the array storing seed vertices in hop 0.
* @param seed_vertex_label_offsets An optional pointer to the array storing label offsets to the
* seed vertices (size = @p num_labels + 1). @p seed_vertex_label_offsets should be valid if @p
* num_labels >= 2 and @p seed_vertices is valid and invalid otherwise.
- * ext_vertices A pointer to the array storing external vertex IDs for the local internal vertices.
- * The local internal vertex range can be obatined bgy invoking a graph_view_t object's
- * local_vertex_partition_range() function. ext_vertex_type offsets A pointer to the array storing
- * vertex type offsets for the entire external vertex ID range (array size = @p num_vertex_types +
- * 1). For example, if the array stores [0, 100, 200], external vertex IDs [0, 100) has vertex type
- * 0 and external vertex IDs [100, 200) has vertex type 1.
+ * @param edgelist_label_offsets An optional pointer to the array storing label offsets to the input
+ * edges (size = @p num_labels + 1). @p edgelist_label_offsets should be valid if @p num_labels
+ * >= 2.
+ * @param vertex_type offsets A pointer to the array storing vertex type offsets for the entire
+ * vertex ID range (array size = @p num_vertex_types + 1). For example, if the array stores [0, 100,
+ * 200], vertex IDs [0, 100) has vertex type 0 and vertex IDs [100, 200) has vertex type 1.
* @param num_labels Number of labels. Labels are considered if @p num_labels >=2 and ignored if @p
* num_labels = 1.
* @param num_hops Number of hops. Hop numbers are considered if @p num_hops >=2 and ignored if @p
@@ -552,31 +558,36 @@ renumber_and_sort_sampled_edgelist(
* @param src_is_major A flag to determine whether to use the source or destination as the
* major key in renumbering and sorting.
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
- * @return Tuple of vectors storing edge sources, edge destinations, optional edge weights (valid
- * only if @p edgelist_weights.has_value() is true), optional edge IDs (valid only if @p
- * edgelist_edge_ids.has_value() is true), optional edge types (valid only if @p
- * edgelist_edge_types.has_value() is true), optional (label, hop) offset values to the renumbered
- * and sorted edges (size = @p num_labels * @p num_hops + 1, valid only when @p
- * edgelist_hops.has_value() or @p edgelist_label_offsetes.has_value() is true), renumber_map to
- * query original vertices (size = # unique or aggregate # unique vertices for each label), and
- * label offsets to the renumber map (size = @p num_labels + 1, valid only if @p
- * edgelist_label_offsets.has_value() is true).
+ * @return Tuple of vectors storing renumbered edge sources, renumbered edge destinations, optional
+ * edge weights (valid only if @p edgelist_weights.has_value() is true), optional renumbered edge
+ * IDs (valid only if @p edgelist_edge_ids.has_value() is true), optional (label, edge type, hop)
+ * offset values to the renumbered and sorted edges (size = @p num_labels * @p num_edge_types * @p
+ * num_hops + 1, valid only when @p edgelist_edge_types.has_value(), @p edgelist_hops.has_value(),
+ * or @p edgelist_label_offsetes.has_value() is true), renumber_map to query original vertices (size
+ * = # unique or aggregate # unique vertices for each label), (label, vertex type) offsets to the
+ * vertex renumber map (size = @p num_labels * @p num_vertex_types + 1), optional renumber_map to
+ * query original edge IDs (size = # unique (edge_type, edge ID) pairs, valid only if @p
+ * edgelist_edge_ids.has_value() is true), and optional (label, edge type) offsets to the edge ID
+ * renumber map (size = @p num_labels + @p num_edge_types + 1, valid only if @p
+ * edgelist_edge_ids.has_value() is true). We do not explicitly return edge source & destination
+ * vertex types as we assume that source & destination vertex type are implicilty determined for a
+ * given edge type.
*/
template
std::tuple<
- rmm::device_uvector, // srcs
- rmm::device_uvector, // dsts
- std::optional>, // weights
- std::optional>, // edge IDs
- std::optional>, // edge types
- std::optional>, // (label, edge type, hop) offsets to the edges
- rmm::device_uvector, // vertex renumber map
- std::optional>, // (label, type) offsets to the vertex renumber map
+ rmm::device_uvector, // srcs
+ rmm::device_uvector, // dsts
+ std::optional>, // weights
+ std::optional>, // edge IDs
+ std::optional>, // (label, edge type, hop) offsets to the edges
+ rmm::device_uvector, // vertex renumber map
+ rmm::device_uvector, // (label, vertex type) offsets to the vertex renumber map
std::optional>, // edge ID renumber map
- std::optional>> // (label, type) offsets to the edge ID renumber map
+ std::optional<
+ rmm::device_uvector>> // (label, edge type) offsets to the edge ID renumber map
heterogeneous_renumber_and_sort_sampled_edgelist(
raft::handle_t const& handle,
rmm::device_uvector&& edgelist_srcs,
@@ -585,11 +596,10 @@ heterogeneous_renumber_and_sort_sampled_edgelist(
std::optional>&& edgelist_edge_ids,
std::optional>&& edgelist_edge_types,
std::optional>&& edgelist_hops,
- std::optional> edgelist_label_offsets,
std::optional> seed_vertices,
std::optional> seed_vertex_label_offsets,
- raft::device_span ext_vertices,
- raft::device_span ext_vertex_type_offsets,
+ std::optional> edgelist_label_offsets,
+ raft::device_span vertex_type_offsets,
size_t num_labels,
size_t num_hops,
size_t num_vertex_types,
@@ -743,4 +753,61 @@ lookup_endpoints_from_edge_ids_and_types(
raft::device_span edge_ids_to_lookup,
raft::device_span edge_types_to_lookup);
+/**
+ * @brief Negative Sampling
+ *
+ * This function generates negative samples for graph.
+ *
+ * Negative sampling is done by generating a random graph according to the specified
+ * parameters and optionally removing samples that represent actual edges in the graph
+ *
+ * Sampling occurs by creating a list of source vertex ids from biased samping
+ * of the source vertex space, and destination vertex ids from biased sampling of the
+ * destination vertex space, and using this as the putative list of edges. We
+ * then can optionally remove duplicates and remove actual edges in the graph to generate
+ * the final list. If necessary we will repeat the process to end with a resulting
+ * edge list of the appropriate size.
+ *
+ * @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 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 graph_view Graph View object to generate NBR Sampling for
+ * @param rng_state RNG state
+ * @param src_biases Optional bias for randomly selecting source vertices. If std::nullopt vertices
+ * will be selected uniformly. In multi-GPU environment the biases should be partitioned based
+ * on the vertex partitions.
+ * @param dst_biases Optional bias for randomly selecting destination vertices. If std::nullopt
+ * vertices will be selected uniformly. In multi-GPU environment the biases should be partitioned
+ * based on the vertex partitions.
+ * @param num_samples Number of negative samples to generate
+ * @param remove_duplicates If true, remove duplicate samples
+ * @param remove_existing_edges If true, remove samples that are actually edges in the graph
+ * @param exact_number_of_samples If true, repeat generation until we get the exact number of
+ * negative samples
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ *
+ * @return tuple containing source vertex ids and destination vertex ids for the negative samples
+ */
+template
+std::tuple, rmm::device_uvector> negative_sampling(
+ raft::handle_t const& handle,
+ raft::random::RngState& rng_state,
+ graph_view_t const& graph_view,
+ std::optional> src_biases,
+ std::optional> dst_biases,
+ size_t num_samples,
+ bool remove_duplicates,
+ bool remove_existing_edges,
+ bool exact_number_of_samples,
+ bool do_expensive_check);
+
} // namespace cugraph
diff --git a/cpp/include/cugraph_c/coo.h b/cpp/include/cugraph_c/coo.h
new file mode 100644
index 00000000000..ef746c6ed6a
--- /dev/null
+++ b/cpp/include/cugraph_c/coo.h
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Opaque COO definition
+ */
+typedef struct {
+ int32_t align_;
+} cugraph_coo_t;
+
+/**
+ * @brief Opaque COO list definition
+ */
+typedef struct {
+ int32_t align_;
+} cugraph_coo_list_t;
+
+/**
+ * @brief Get the source vertex ids
+ *
+ * @param [in] coo Opaque pointer to COO
+ * @return type erased array view of source vertex ids
+ */
+cugraph_type_erased_device_array_view_t* cugraph_coo_get_sources(cugraph_coo_t* coo);
+
+/**
+ * @brief Get the destination vertex ids
+ *
+ * @param [in] coo Opaque pointer to COO
+ * @return type erased array view of destination vertex ids
+ */
+cugraph_type_erased_device_array_view_t* cugraph_coo_get_destinations(cugraph_coo_t* coo);
+
+/**
+ * @brief Get the edge weights
+ *
+ * @param [in] coo Opaque pointer to COO
+ * @return type erased array view of edge weights, NULL if no edge weights in COO
+ */
+cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_weights(cugraph_coo_t* coo);
+
+/**
+ * @brief Get the edge id
+ *
+ * @param [in] coo Opaque pointer to COO
+ * @return type erased array view of edge id, NULL if no edge ids in COO
+ */
+cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_id(cugraph_coo_t* coo);
+
+/**
+ * @brief Get the edge type
+ *
+ * @param [in] coo Opaque pointer to COO
+ * @return type erased array view of edge type, NULL if no edge types in COO
+ */
+cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_type(cugraph_coo_t* coo);
+
+/**
+ * @brief Get the number of coo object in the list
+ *
+ * @param [in] coo_list Opaque pointer to COO list
+ * @return number of elements
+ */
+size_t cugraph_coo_list_size(const cugraph_coo_list_t* coo_list);
+
+/**
+ * @brief Get a COO from the list
+ *
+ * @param [in] coo_list Opaque pointer to COO list
+ * @param [in] index Index of desired COO from list
+ * @return a cugraph_coo_t* object from the list
+ */
+cugraph_coo_t* cugraph_coo_list_element(cugraph_coo_list_t* coo_list, size_t index);
+
+/**
+ * @brief Free coo object
+ *
+ * @param [in] coo Opaque pointer to COO
+ */
+void cugraph_coo_free(cugraph_coo_t* coo);
+
+/**
+ * @brief Free coo list
+ *
+ * @param [in] coo_list Opaque pointer to list of COO objects
+ */
+void cugraph_coo_list_free(cugraph_coo_list_t* coo_list);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cpp/include/cugraph_c/graph_generators.h b/cpp/include/cugraph_c/graph_generators.h
index 272131d2aab..553be530e95 100644
--- a/cpp/include/cugraph_c/graph_generators.h
+++ b/cpp/include/cugraph_c/graph_generators.h
@@ -17,6 +17,7 @@
#pragma once
#include
+#include
#include
#include
#include
@@ -27,91 +28,6 @@ extern "C" {
typedef enum { POWER_LAW = 0, UNIFORM } cugraph_generator_distribution_t;
-/**
- * @brief Opaque COO definition
- */
-typedef struct {
- int32_t align_;
-} cugraph_coo_t;
-
-/**
- * @brief Opaque COO list definition
- */
-typedef struct {
- int32_t align_;
-} cugraph_coo_list_t;
-
-/**
- * @brief Get the source vertex ids
- *
- * @param [in] coo Opaque pointer to COO
- * @return type erased array view of source vertex ids
- */
-cugraph_type_erased_device_array_view_t* cugraph_coo_get_sources(cugraph_coo_t* coo);
-
-/**
- * @brief Get the destination vertex ids
- *
- * @param [in] coo Opaque pointer to COO
- * @return type erased array view of destination vertex ids
- */
-cugraph_type_erased_device_array_view_t* cugraph_coo_get_destinations(cugraph_coo_t* coo);
-
-/**
- * @brief Get the edge weights
- *
- * @param [in] coo Opaque pointer to COO
- * @return type erased array view of edge weights, NULL if no edge weights in COO
- */
-cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_weights(cugraph_coo_t* coo);
-
-/**
- * @brief Get the edge id
- *
- * @param [in] coo Opaque pointer to COO
- * @return type erased array view of edge id, NULL if no edge ids in COO
- */
-cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_id(cugraph_coo_t* coo);
-
-/**
- * @brief Get the edge type
- *
- * @param [in] coo Opaque pointer to COO
- * @return type erased array view of edge type, NULL if no edge types in COO
- */
-cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_type(cugraph_coo_t* coo);
-
-/**
- * @brief Get the number of coo object in the list
- *
- * @param [in] coo_list Opaque pointer to COO list
- * @return number of elements
- */
-size_t cugraph_coo_list_size(const cugraph_coo_list_t* coo_list);
-
-/**
- * @brief Get a COO from the list
- *
- * @param [in] coo_list Opaque pointer to COO list
- * @param [in] index Index of desired COO from list
- * @return a cugraph_coo_t* object from the list
- */
-cugraph_coo_t* cugraph_coo_list_element(cugraph_coo_list_t* coo_list, size_t index);
-
-/**
- * @brief Free coo object
- *
- * @param [in] coo Opaque pointer to COO
- */
-void cugraph_coo_free(cugraph_coo_t* coo);
-
-/**
- * @brief Free coo list
- *
- * @param [in] coo_list Opaque pointer to list of COO objects
- */
-void cugraph_coo_list_free(cugraph_coo_list_t* coo_list);
-
/**
* @brief Generate RMAT edge list
*
diff --git a/cpp/include/cugraph_c/sampling_algorithms.h b/cpp/include/cugraph_c/sampling_algorithms.h
index 1a3d20b9339..bb26e577915 100644
--- a/cpp/include/cugraph_c/sampling_algorithms.h
+++ b/cpp/include/cugraph_c/sampling_algorithms.h
@@ -16,6 +16,7 @@
#pragma once
+#include
#include
#include
#include
@@ -674,6 +675,57 @@ cugraph_error_code_t cugraph_select_random_vertices(const cugraph_resource_handl
cugraph_type_erased_device_array_t** vertices,
cugraph_error_t** error);
+/**
+ * @ingroup samplingC
+ * @brief Perform negative sampling
+ *
+ * Negative sampling generates a COO structure defining edges according to the specified parameters
+ *
+ * @param [in] handle Handle for accessing resources
+ * @param [in,out] rng_state State of the random number generator, updated with each
+ * call
+ * @param [in] graph Pointer to graph
+ * @param [in] vertices Vertex ids for the source biases. If @p src_bias and
+ * @p dst_bias are not specified this is ignored. If
+ * @p vertices is specified then vertices[i] is the vertex
+ * id of src_biases[i] and dst_biases[i]. If @p vertices
+ * is not specified then i is the vertex id if src_biases[i]
+ * and dst_biases[i]
+ * @param [in] src_biases Bias for selecting source vertices. If NULL, do uniform
+ * sampling, if provided probability of vertex i will be
+ * src_bias[i] / (sum of all source biases)
+ * @param [in] dst_biases Bias for selecting destination vertices. If NULL, do
+ * uniform sampling, if provided probability of vertex i
+ * will be dst_bias[i] / (sum of all destination biases)
+ * @param [in] num_samples Number of negative samples to generate
+ * @param [in] remove_duplicates If true, remove duplicates from sampled edges
+ * @param [in] remove_existing_edges If true, remove sampled edges that actually exist in
+ * the graph
+ * @param [in] exact_number_of_samples If true, result should contain exactly @p num_samples. If
+ * false the code will generate @p num_samples and then do
+ * any filtering as specified
+ * @param [in] do_expensive_check A flag to run expensive checks for input arguments (if
+ * set to true)
+ * @param [out] result Opaque pointer to generated coo list
+ * @param [out] error Pointer to an error object storing details of any error.
+ * Will be populated if error code is not CUGRAPH_SUCCESS
+ * @return error code
+ */
+cugraph_error_code_t cugraph_negative_sampling(
+ const cugraph_resource_handle_t* handle,
+ cugraph_rng_state_t* rng_state,
+ cugraph_graph_t* graph,
+ const cugraph_type_erased_device_array_view_t* vertices,
+ const cugraph_type_erased_device_array_view_t* src_biases,
+ const cugraph_type_erased_device_array_view_t* dst_biases,
+ size_t num_samples,
+ bool_t remove_duplicates,
+ bool_t remove_existing_edges,
+ bool_t exact_number_of_samples,
+ bool_t do_expensive_check,
+ cugraph_coo_t** result,
+ cugraph_error_t** error);
+
#ifdef __cplusplus
}
#endif
diff --git a/cpp/src/c_api/coo.hpp b/cpp/src/c_api/coo.hpp
new file mode 100644
index 00000000000..a83a3af375a
--- /dev/null
+++ b/cpp/src/c_api/coo.hpp
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#include "c_api/array.hpp"
+
+#include
+
+namespace cugraph {
+namespace c_api {
+
+struct cugraph_coo_t {
+ std::unique_ptr src_{};
+ std::unique_ptr dst_{};
+ std::unique_ptr wgt_{};
+ std::unique_ptr id_{};
+ std::unique_ptr type_{};
+};
+
+struct cugraph_coo_list_t {
+ std::vector> list_;
+};
+
+} // namespace c_api
+} // namespace cugraph
diff --git a/cpp/src/c_api/graph_generators.cpp b/cpp/src/c_api/graph_generators.cpp
index ef478e57098..a58a4d5db35 100644
--- a/cpp/src/c_api/graph_generators.cpp
+++ b/cpp/src/c_api/graph_generators.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
#include "c_api/array.hpp"
+#include "c_api/coo.hpp"
#include "c_api/error.hpp"
#include "c_api/random.hpp"
#include "c_api/resource_handle.hpp"
@@ -26,24 +27,6 @@
#include
-namespace cugraph {
-namespace c_api {
-
-struct cugraph_coo_t {
- std::unique_ptr src_{};
- std::unique_ptr dst_{};
- std::unique_ptr wgt_{};
- std::unique_ptr id_{};
- std::unique_ptr type_{};
-};
-
-struct cugraph_coo_list_t {
- std::vector> list_;
-};
-
-} // namespace c_api
-} // namespace cugraph
-
namespace {
template
@@ -141,32 +124,41 @@ cugraph_error_code_t cugraph_generate_rmat_edgelists(
extern "C" cugraph_type_erased_device_array_view_t* cugraph_coo_get_sources(cugraph_coo_t* coo)
{
auto internal_pointer = reinterpret_cast(coo);
- return reinterpret_cast(internal_pointer->src_->view());
+ return (internal_pointer->src_) ? reinterpret_cast(
+ internal_pointer->src_->view())
+ : nullptr;
}
extern "C" cugraph_type_erased_device_array_view_t* cugraph_coo_get_destinations(cugraph_coo_t* coo)
{
auto internal_pointer = reinterpret_cast(coo);
- return reinterpret_cast(internal_pointer->dst_->view());
+ return (internal_pointer->dst_) ? reinterpret_cast(
+ internal_pointer->dst_->view())
+ : nullptr;
}
extern "C" cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_weights(cugraph_coo_t* coo)
{
auto internal_pointer = reinterpret_cast(coo);
- return reinterpret_cast(internal_pointer->wgt_->view());
+ return (internal_pointer->wgt_) ? reinterpret_cast(
+ internal_pointer->wgt_->view())
+ : nullptr;
}
extern "C" cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_id(cugraph_coo_t* coo)
{
auto internal_pointer = reinterpret_cast(coo);
- return reinterpret_cast(internal_pointer->id_->view());
+ return (internal_pointer->id_) ? reinterpret_cast(
+ internal_pointer->id_->view())
+ : nullptr;
}
extern "C" cugraph_type_erased_device_array_view_t* cugraph_coo_get_edge_type(cugraph_coo_t* coo)
{
auto internal_pointer = reinterpret_cast(coo);
- return reinterpret_cast(
- internal_pointer->type_->view());
+ return (internal_pointer->type_) ? reinterpret_cast(
+ internal_pointer->type_->view())
+ : nullptr;
}
extern "C" size_t cugraph_coo_list_size(const cugraph_coo_list_t* coo_list)
diff --git a/cpp/src/c_api/negative_sampling.cpp b/cpp/src/c_api/negative_sampling.cpp
new file mode 100644
index 00000000000..54f465d67b4
--- /dev/null
+++ b/cpp/src/c_api/negative_sampling.cpp
@@ -0,0 +1,228 @@
+/*
+ * 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.
+ */
+
+#include "c_api/abstract_functor.hpp"
+#include "c_api/coo.hpp"
+#include "c_api/graph.hpp"
+#include "c_api/random.hpp"
+#include "c_api/resource_handle.hpp"
+#include "c_api/utils.hpp"
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+
+namespace {
+
+struct negative_sampling_functor : public cugraph::c_api::abstract_functor {
+ raft::handle_t const& handle_;
+ cugraph::c_api::cugraph_rng_state_t* rng_state_{nullptr};
+ cugraph::c_api::cugraph_graph_t* graph_{nullptr};
+ cugraph::c_api::cugraph_type_erased_device_array_view_t const* vertices_{nullptr};
+ cugraph::c_api::cugraph_type_erased_device_array_view_t const* src_biases_{nullptr};
+ cugraph::c_api::cugraph_type_erased_device_array_view_t const* dst_biases_{nullptr};
+ size_t num_samples_;
+ bool remove_duplicates_{false};
+ bool remove_existing_edges_{false};
+ bool exact_number_of_samples_{false};
+ bool do_expensive_check_{false};
+ cugraph::c_api::cugraph_coo_t* result_{nullptr};
+
+ negative_sampling_functor(const cugraph_resource_handle_t* handle,
+ cugraph_rng_state_t* rng_state,
+ cugraph_graph_t* graph,
+ const cugraph_type_erased_device_array_view_t* vertices,
+ const cugraph_type_erased_device_array_view_t* src_biases,
+ const cugraph_type_erased_device_array_view_t* dst_biases,
+ size_t num_samples,
+ bool_t remove_duplicates,
+ bool_t remove_existing_edges,
+ bool_t exact_number_of_samples,
+ bool_t do_expensive_check)
+ : abstract_functor(),
+ handle_(*reinterpret_cast(handle)->handle_),
+ rng_state_(reinterpret_cast(rng_state)),
+ graph_(reinterpret_cast(graph)),
+ vertices_(
+ reinterpret_cast(vertices)),
+ src_biases_(reinterpret_cast(
+ src_biases)),
+ dst_biases_(reinterpret_cast(
+ dst_biases)),
+ num_samples_(num_samples),
+ remove_duplicates_(remove_duplicates),
+ remove_existing_edges_(remove_existing_edges),
+ exact_number_of_samples_(exact_number_of_samples),
+ do_expensive_check_(do_expensive_check)
+ {
+ }
+
+ template
+ void operator()()
+ {
+ // FIXME: Think about how to handle SG vice MG
+ if constexpr (!cugraph::is_candidate::value) {
+ unsupported();
+ } else {
+ // negative_sampling expects store_transposed == false
+ if constexpr (store_transposed) {
+ error_code_ = cugraph::c_api::
+ transpose_storage(
+ handle_, graph_, error_.get());
+ if (error_code_ != CUGRAPH_SUCCESS) return;
+ }
+
+ auto graph =
+ reinterpret_cast*>(graph_->graph_);
+
+ auto graph_view = graph->view();
+
+ auto number_map = reinterpret_cast*>(graph_->number_map_);
+
+ rmm::device_uvector vertices(0, handle_.get_stream());
+ rmm::device_uvector src_biases(0, handle_.get_stream());
+ rmm::device_uvector dst_biases(0, handle_.get_stream());
+
+ if (src_biases_ != nullptr) {
+ vertices.resize(vertices_->size_, handle_.get_stream());
+ src_biases.resize(src_biases_->size_, handle_.get_stream());
+
+ raft::copy(
+ vertices.data(), vertices_->as_type(), vertices.size(), handle_.get_stream());
+ raft::copy(src_biases.data(),
+ src_biases_->as_type(),
+ src_biases.size(),
+ handle_.get_stream());
+
+ src_biases = cugraph::detail::
+ collect_local_vertex_values_from_ext_vertex_value_pairs(
+ handle_,
+ std::move(vertices),
+ std::move(src_biases),
+ *number_map,
+ graph_view.local_vertex_partition_range_first(),
+ graph_view.local_vertex_partition_range_last(),
+ weight_t{0},
+ do_expensive_check_);
+ }
+
+ if (dst_biases_ != nullptr) {
+ vertices.resize(vertices_->size_, handle_.get_stream());
+ dst_biases.resize(dst_biases_->size_, handle_.get_stream());
+
+ raft::copy(
+ vertices.data(), vertices_->as_type(), vertices.size(), handle_.get_stream());
+ raft::copy(dst_biases.data(),
+ dst_biases_->as_type(),
+ dst_biases.size(),
+ handle_.get_stream());
+
+ dst_biases = cugraph::detail::
+ collect_local_vertex_values_from_ext_vertex_value_pairs(
+ handle_,
+ std::move(vertices),
+ std::move(dst_biases),
+ *number_map,
+ graph_view.local_vertex_partition_range_first(),
+ graph_view.local_vertex_partition_range_last(),
+ weight_t{0},
+ do_expensive_check_);
+ }
+
+ auto&& [src, dst] = cugraph::negative_sampling(
+ handle_,
+ rng_state_->rng_state_,
+ graph_view,
+ (src_biases_ != nullptr) ? std::make_optional(raft::device_span{
+ src_biases.data(), src_biases.size()})
+ : std::nullopt,
+ (dst_biases_ != nullptr) ? std::make_optional(raft::device_span{
+ dst_biases.data(), dst_biases.size()})
+ : std::nullopt,
+ num_samples_,
+ remove_duplicates_,
+ remove_existing_edges_,
+ exact_number_of_samples_,
+ do_expensive_check_);
+
+ std::vector vertex_partition_lasts = graph_view.vertex_partition_range_lasts();
+
+ cugraph::unrenumber_int_vertices(handle_,
+ src.data(),
+ src.size(),
+ number_map->data(),
+ vertex_partition_lasts,
+ do_expensive_check_);
+
+ cugraph::unrenumber_int_vertices(handle_,
+ dst.data(),
+ dst.size(),
+ number_map->data(),
+ vertex_partition_lasts,
+ do_expensive_check_);
+
+ result_ = new cugraph::c_api::cugraph_coo_t{
+ std::make_unique(src,
+ graph_->vertex_type_),
+ std::make_unique(dst,
+ graph_->vertex_type_),
+ nullptr,
+ nullptr,
+ nullptr};
+ }
+ }
+};
+
+} // namespace
+
+cugraph_error_code_t cugraph_negative_sampling(
+ const cugraph_resource_handle_t* handle,
+ cugraph_rng_state_t* rng_state,
+ cugraph_graph_t* graph,
+ const cugraph_type_erased_device_array_view_t* vertices,
+ const cugraph_type_erased_device_array_view_t* src_biases,
+ const cugraph_type_erased_device_array_view_t* dst_biases,
+ size_t num_samples,
+ bool_t remove_duplicates,
+ bool_t remove_existing_edges,
+ bool_t exact_number_of_samples,
+ bool_t do_expensive_check,
+ cugraph_coo_t** result,
+ cugraph_error_t** error)
+{
+ negative_sampling_functor functor{handle,
+ rng_state,
+ graph,
+ vertices,
+ src_biases,
+ dst_biases,
+ num_samples,
+ remove_duplicates,
+ remove_existing_edges,
+ exact_number_of_samples,
+ do_expensive_check};
+ return cugraph::c_api::run_algorithm(graph, functor, result, error);
+}
diff --git a/cpp/src/c_api/random_walks.cpp b/cpp/src/c_api/random_walks.cpp
index b9a2c8e4f60..705d2108437 100644
--- a/cpp/src/c_api/random_walks.cpp
+++ b/cpp/src/c_api/random_walks.cpp
@@ -16,6 +16,7 @@
#include "c_api/abstract_functor.hpp"
#include "c_api/graph.hpp"
+#include "c_api/random.hpp"
#include "c_api/resource_handle.hpp"
#include "c_api/utils.hpp"
@@ -153,10 +154,11 @@ namespace {
struct uniform_random_walks_functor : public cugraph::c_api::abstract_functor {
raft::handle_t const& handle_;
+ // FIXME: rng_state_ should be passed as a parameter
+ cugraph::c_api::cugraph_rng_state_t* rng_state_{nullptr};
cugraph::c_api::cugraph_graph_t* graph_{nullptr};
cugraph::c_api::cugraph_type_erased_device_array_view_t const* start_vertices_{nullptr};
size_t max_length_{0};
- size_t seed_{0};
cugraph::c_api::cugraph_random_walk_result_t* result_{nullptr};
uniform_random_walks_functor(cugraph_resource_handle_t const* handle,
@@ -222,13 +224,17 @@ struct uniform_random_walks_functor : public cugraph::c_api::abstract_functor {
graph_view.local_vertex_partition_range_last(),
false);
+ // FIXME: remove once rng_state passed as parameter
+ rng_state_ = reinterpret_cast(
+ new cugraph::c_api::cugraph_rng_state_t{raft::random::RngState{0}});
+
auto [paths, weights] = cugraph::uniform_random_walks(
handle_,
+ rng_state_->rng_state_,
graph_view,
(edge_weights != nullptr) ? std::make_optional(edge_weights->view()) : std::nullopt,
raft::device_span{start_vertices.data(), start_vertices.size()},
- max_length_,
- seed_);
+ max_length_);
//
// Need to unrenumber the vertices in the resulting paths
@@ -255,11 +261,12 @@ struct uniform_random_walks_functor : public cugraph::c_api::abstract_functor {
struct biased_random_walks_functor : public cugraph::c_api::abstract_functor {
raft::handle_t const& handle_;
+ // FIXME: rng_state_ should be passed as a parameter
+ cugraph::c_api::cugraph_rng_state_t* rng_state_{nullptr};
cugraph::c_api::cugraph_graph_t* graph_{nullptr};
cugraph::c_api::cugraph_type_erased_device_array_view_t const* start_vertices_{nullptr};
size_t max_length_{0};
cugraph::c_api::cugraph_random_walk_result_t* result_{nullptr};
- uint64_t seed_{0};
biased_random_walks_functor(cugraph_resource_handle_t const* handle,
cugraph_graph_t* graph,
@@ -326,13 +333,17 @@ struct biased_random_walks_functor : public cugraph::c_api::abstract_functor {
graph_view.local_vertex_partition_range_last(),
false);
+ // FIXME: remove once rng_state passed as parameter
+ rng_state_ = reinterpret_cast(
+ new cugraph::c_api::cugraph_rng_state_t{raft::random::RngState{0}});
+
auto [paths, weights] = cugraph::biased_random_walks(
handle_,
+ rng_state_->rng_state_,
graph_view,
edge_weights->view(),
raft::device_span{start_vertices.data(), start_vertices.size()},
- max_length_,
- seed_);
+ max_length_);
//
// Need to unrenumber the vertices in the resulting paths
@@ -354,12 +365,13 @@ struct biased_random_walks_functor : public cugraph::c_api::abstract_functor {
struct node2vec_random_walks_functor : public cugraph::c_api::abstract_functor {
raft::handle_t const& handle_;
+ // FIXME: rng_state_ should be passed as a parameter
+ cugraph::c_api::cugraph_rng_state_t* rng_state_{nullptr};
cugraph::c_api::cugraph_graph_t* graph_{nullptr};
cugraph::c_api::cugraph_type_erased_device_array_view_t const* start_vertices_{nullptr};
size_t max_length_{0};
double p_{0};
double q_{0};
- uint64_t seed_{0};
cugraph::c_api::cugraph_random_walk_result_t* result_{nullptr};
node2vec_random_walks_functor(cugraph_resource_handle_t const* handle,
@@ -431,15 +443,19 @@ struct node2vec_random_walks_functor : public cugraph::c_api::abstract_functor {
graph_view.local_vertex_partition_range_last(),
false);
+ // FIXME: remove once rng_state passed as parameter
+ rng_state_ = reinterpret_cast(
+ new cugraph::c_api::cugraph_rng_state_t{raft::random::RngState{0}});
+
auto [paths, weights] = cugraph::node2vec_random_walks(
handle_,
+ rng_state_->rng_state_,
graph_view,
(edge_weights != nullptr) ? std::make_optional(edge_weights->view()) : std::nullopt,
raft::device_span{start_vertices.data(), start_vertices.size()},
max_length_,
static_cast(p_),
- static_cast(q_),
- seed_);
+ static_cast(q_));
// FIXME: Need to fix invalid_vtx issue here. We can't unrenumber max_vertex_id+1
// properly...
diff --git a/cpp/src/community/edge_triangle_count_impl.cuh b/cpp/src/community/edge_triangle_count_impl.cuh
index 225687c4cf0..e3501065008 100644
--- a/cpp/src/community/edge_triangle_count_impl.cuh
+++ b/cpp/src/community/edge_triangle_count_impl.cuh
@@ -18,8 +18,8 @@
#include "detail/graph_partition_utils.cuh"
#include "prims/edge_bucket.cuh"
+#include "prims/per_v_pair_dst_nbr_intersection.cuh"
#include "prims/transform_e.cuh"
-#include "prims/transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v.cuh"
#include
#include
@@ -124,7 +124,8 @@ struct extract_q_r {
template
edge_property_t, edge_t> edge_triangle_count_impl(
raft::handle_t const& handle,
- graph_view_t const& graph_view)
+ graph_view_t const& graph_view,
+ bool do_expensive_check)
{
using weight_t = float;
rmm::device_uvector edgelist_srcs(0, handle.get_stream());
@@ -158,14 +159,11 @@ edge_property_t, edge_t> edge_t
num_remaining_edges -= chunk_size;
// Perform 'nbr_intersection' in chunks to reduce peak memory.
auto [intersection_offsets, intersection_indices] =
- detail::nbr_intersection(handle,
- graph_view,
- cugraph::edge_dummy_property_t{}.view(),
- edge_first + prev_chunk_size,
- edge_first + prev_chunk_size + chunk_size,
- std::array{true, true},
- false /*FIXME: pass 'do_expensive_check' as argument*/);
-
+ per_v_pair_dst_nbr_intersection(handle,
+ graph_view,
+ edge_first + prev_chunk_size,
+ edge_first + prev_chunk_size + chunk_size,
+ do_expensive_check);
// Update the number of triangles of each (p, q) edges by looking at their intersection
// size
thrust::for_each(
@@ -365,9 +363,11 @@ edge_property_t, edge_t> edge_t
template
edge_property_t, edge_t> edge_triangle_count(
- raft::handle_t const& handle, graph_view_t const& graph_view)
+ raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ bool do_expensive_check)
{
- return detail::edge_triangle_count_impl(handle, graph_view);
+ return detail::edge_triangle_count_impl(handle, graph_view, do_expensive_check);
}
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_mg_v32_e32.cu b/cpp/src/community/edge_triangle_count_mg_v32_e32.cu
index 1212a13323b..5e333139ddf 100644
--- a/cpp/src/community/edge_triangle_count_mg_v32_e32.cu
+++ b/cpp/src/community/edge_triangle_count_mg_v32_e32.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int32_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_mg_v32_e64.cu b/cpp/src/community/edge_triangle_count_mg_v32_e64.cu
index 64ee195c7ee..adab2d1fede 100644
--- a/cpp/src/community/edge_triangle_count_mg_v32_e64.cu
+++ b/cpp/src/community/edge_triangle_count_mg_v32_e64.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int64_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_mg_v64_e64.cu b/cpp/src/community/edge_triangle_count_mg_v64_e64.cu
index 67c19e5ac52..1f321b2149f 100644
--- a/cpp/src/community/edge_triangle_count_mg_v64_e64.cu
+++ b/cpp/src/community/edge_triangle_count_mg_v64_e64.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int64_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_sg_v32_e32.cu b/cpp/src/community/edge_triangle_count_sg_v32_e32.cu
index d6a215aa456..3e16a2cf7ef 100644
--- a/cpp/src/community/edge_triangle_count_sg_v32_e32.cu
+++ b/cpp/src/community/edge_triangle_count_sg_v32_e32.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int32_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_sg_v32_e64.cu b/cpp/src/community/edge_triangle_count_sg_v32_e64.cu
index e70fa45c257..24a8de868e0 100644
--- a/cpp/src/community/edge_triangle_count_sg_v32_e64.cu
+++ b/cpp/src/community/edge_triangle_count_sg_v32_e64.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int64_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/edge_triangle_count_sg_v64_e64.cu b/cpp/src/community/edge_triangle_count_sg_v64_e64.cu
index 849603f781b..81f814df713 100644
--- a/cpp/src/community/edge_triangle_count_sg_v64_e64.cu
+++ b/cpp/src/community/edge_triangle_count_sg_v64_e64.cu
@@ -20,6 +20,7 @@ namespace cugraph {
// SG instantiation
template edge_property_t, int64_t> edge_triangle_count(
raft::handle_t const& handle,
- cugraph::graph_view_t const& graph_view);
+ cugraph::graph_view_t const& graph_view,
+ bool do_expensive_check);
} // namespace cugraph
diff --git a/cpp/src/community/egonet_impl.cuh b/cpp/src/community/egonet_impl.cuh
index 8b942be5b6a..c7945831ba8 100644
--- a/cpp/src/community/egonet_impl.cuh
+++ b/cpp/src/community/egonet_impl.cuh
@@ -17,8 +17,6 @@
// #define TIMING
-#include "utilities/graph_utils.cuh"
-
#include
#include
#include
diff --git a/cpp/src/components/legacy/connectivity.cu b/cpp/src/components/legacy/connectivity.cu
index ecaaab173db..4d0198fdff6 100644
--- a/cpp/src/components/legacy/connectivity.cu
+++ b/cpp/src/components/legacy/connectivity.cu
@@ -15,7 +15,6 @@
*/
#include "scc_matrix.cuh"
-#include "utilities/graph_utils.cuh"
#include "weak_cc.cuh"
#include
diff --git a/cpp/src/detail/utility_wrappers_32.cu b/cpp/src/detail/utility_wrappers_32.cu
index 6ab5ae375ca..de407f12493 100644
--- a/cpp/src/detail/utility_wrappers_32.cu
+++ b/cpp/src/detail/utility_wrappers_32.cu
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "detail/utility_wrappers.cuh"
+#include "detail/utility_wrappers_impl.cuh"
#include
#include
@@ -68,6 +68,23 @@ template void sequence_fill(rmm::cuda_stream_view const& stream_view,
size_t size,
int32_t start_value);
+template void sequence_fill(rmm::cuda_stream_view const& stream_view,
+ uint32_t* d_value,
+ size_t size,
+ uint32_t start_value);
+
+template void stride_fill(rmm::cuda_stream_view const& stream_view,
+ int32_t* d_value,
+ size_t size,
+ int32_t start_value,
+ int32_t stride);
+
+template void stride_fill(rmm::cuda_stream_view const& stream_view,
+ uint32_t* d_value,
+ size_t size,
+ uint32_t start_value,
+ uint32_t stride);
+
template int32_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
int32_t const* d_edgelist_srcs,
int32_t const* d_edgelist_dsts,
diff --git a/cpp/src/detail/utility_wrappers_64.cu b/cpp/src/detail/utility_wrappers_64.cu
index a12bc3e952d..2c136d5902b 100644
--- a/cpp/src/detail/utility_wrappers_64.cu
+++ b/cpp/src/detail/utility_wrappers_64.cu
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "detail/utility_wrappers.cuh"
+#include "detail/utility_wrappers_impl.cuh"
#include
#include
@@ -71,6 +71,18 @@ template void sequence_fill(rmm::cuda_stream_view const& stream_view,
size_t size,
uint64_t start_value);
+template void stride_fill(rmm::cuda_stream_view const& stream_view,
+ int64_t* d_value,
+ size_t size,
+ int64_t start_value,
+ int64_t stride);
+
+template void stride_fill(rmm::cuda_stream_view const& stream_view,
+ uint64_t* d_value,
+ size_t size,
+ uint64_t start_value,
+ uint64_t stride);
+
template int64_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
int64_t const* d_edgelist_srcs,
int64_t const* d_edgelist_dsts,
diff --git a/cpp/src/detail/utility_wrappers.cuh b/cpp/src/detail/utility_wrappers_impl.cuh
similarity index 88%
rename from cpp/src/detail/utility_wrappers.cuh
rename to cpp/src/detail/utility_wrappers_impl.cuh
index ce8549db9f8..074d7044261 100644
--- a/cpp/src/detail/utility_wrappers.cuh
+++ b/cpp/src/detail/utility_wrappers_impl.cuh
@@ -72,6 +72,22 @@ void sequence_fill(rmm::cuda_stream_view const& stream_view,
thrust::sequence(rmm::exec_policy(stream_view), d_value, d_value + size, start_value);
}
+template
+void stride_fill(rmm::cuda_stream_view const& stream_view,
+ value_t* d_value,
+ size_t size,
+ value_t start_value,
+ value_t stride)
+{
+ thrust::transform(rmm::exec_policy(stream_view),
+ thrust::make_counting_iterator(size_t{0}),
+ thrust::make_counting_iterator(size),
+ d_value,
+ cuda::proclaim_return_type([start_value, stride] __device__(size_t i) {
+ return static_cast(start_value + stride * i);
+ }));
+}
+
template
vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
vertex_t const* d_edgelist_srcs,
diff --git a/cpp/src/from_cugraph_ops/algo_R.cuh b/cpp/src/from_cugraph_ops/algo_R.cuh
new file mode 100644
index 00000000000..031a7d2ceb9
--- /dev/null
+++ b/cpp/src/from_cugraph_ops/algo_R.cuh
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ */
+
+#pragma once
+
+#include "device.cuh"
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+namespace cugraph::ops::graph {
+
+// single warp-separated field of type IdxT
+template
+using smem_algo_r_t = utils::smem_unit_simple_t<1, IdxT>;
+
+template
+__device__ __forceinline__ void warp_algo_r_index(IdxT* smem,
+ IdxT pop_size,
+ IdxT idx_offset,
+ int sample_size,
+ raft::random::DeviceState& rng_state)
+{
+ auto lane = utils::lane_id();
+ // first 'sample_size' are just copied
+ CUGRAPH_OPS_UNROLL
+ for (int i = lane; i < sample_size; i += utils::WARP_SIZE) {
+ smem[i] = idx_offset + i;
+ }
+ auto sample_size_idxt = IdxT{sample_size};
+ if (sample_size_idxt >= pop_size) return;
+
+ // we must synchronize here since we have just written to smem
+ utils::warp_sync();
+ // TODO(mjoux): when we support more warps per node enable this
+ //__syncthreads();
+
+ auto idx_end = idx_offset + pop_size;
+ auto n = idx_offset + sample_size_idxt;
+ auto flat_id = uint64_t{threadIdx.x + blockIdx.x * blockDim.x};
+ GenT gen(rng_state, flat_id);
+ CUGRAPH_OPS_UNROLL
+ for (auto nidx = n + IdxT{lane}; nidx < idx_end; nidx += IdxT{utils::WARP_SIZE}) {
+ // nidx - idx_offset inclusive (necessary for correctness of algo R)
+ auto end = nidx - idx_offset + 1;
+ raft::random::UniformIntDistParams int_params{};
+ int_params.start = IdxT{0};
+ int_params.end = IdxT{end};
+ int_params.diff = static_cast(end);
+ IdxT idx;
+ raft::random::custom_next(gen, &idx, int_params, 0, 0 /* idx / stride unused */);
+ if (idx < sample_size_idxt) {
+ // using atomic max instead of exch here because it leads to the same
+ // output as the sequential algorithm (DGL does this, too)
+ // Additionally, we use the index instead of the neighbor ID here
+ // since this allows copying over other node/edge-related data
+ // (useful for heterogeneous graphs for example)
+ utils::atomic_max(smem + idx, nidx);
+ }
+ }
+ // must synchronize to make smem valid
+ utils::warp_sync();
+ // TODO(mjoux): when we support more warps per node enable this
+ //__syncthreads();
+}
+
+template
+__device__ __forceinline__ void warp_algo_r(IdxT* smem,
+ IdxT row_id,
+ const IdxT* nodes,
+ const IdxT* fg_offsets,
+ int sample_size,
+ IdxT& node_id,
+ IdxT& node_start,
+ IdxT& node_end,
+ raft::random::DeviceState& rng_state)
+{
+ auto lane = utils::lane_id();
+ if (nodes == nullptr) {
+ node_id = row_id;
+ if (lane == 0)
+ node_start = fg_offsets[node_id];
+ else if (lane == 1)
+ node_end = fg_offsets[node_id + 1];
+ node_start = utils::shfl(node_start, 0);
+ node_end = utils::shfl(node_end, 1);
+ } else {
+ if (lane == 0) {
+ node_id = nodes[row_id];
+ node_start = fg_offsets[node_id];
+ node_end = fg_offsets[node_id + 1];
+ }
+ node_id = utils::shfl(node_id, 0);
+ node_start = utils::shfl(node_start, 0);
+ node_end = utils::shfl(node_end, 0);
+ }
+ auto pop_size = node_end - node_start;
+ warp_algo_r_index(smem, pop_size, node_start, sample_size, rng_state);
+}
+
+// TODO(mjoux): support configuring n_warps_per_node in template
+template
+CUGRAPH_OPS_KERNEL void algo_r_kernel(raft::random::DeviceState rng_state,
+ IdxT* neighbors,
+ IdxT* counts,
+ // edge_types / node_types should be non-const
+ // probably detected if `!IS_HG`
+ // NOLINTNEXTLINE(readability-non-const-parameter)
+ int32_t* edge_types,
+ // NOLINTNEXTLINE(readability-non-const-parameter)
+ int32_t* node_types,
+ const IdxT* offsets,
+ const IdxT* indices,
+ const int32_t* g_edge_types,
+ const int32_t* g_node_types,
+ const IdxT* nodes,
+ IdxT n_dst_nodes,
+ int sample_size)
+{
+ auto lane = utils::lane_id();
+ auto warp = utils::warp_id(); // 1D block with X dim
+ auto row_id = warp + static_cast(blockIdx.x) * IdxT{N_WARPS};
+ if (row_id >= n_dst_nodes) { return; }
+ IdxT* s_idx;
+ smem_algo_r_t smem{};
+ int32_t smem_sizes[] = {sample_size};
+ smem.set_ptrs(warp, N_WARPS, smem_sizes, s_idx);
+ IdxT node_id, node_start, node_end;
+ warp_algo_r(
+ s_idx, row_id, nodes, offsets, sample_size, node_id, node_start, node_end, rng_state);
+
+ IdxT count = 0;
+ for (int i = lane; i < sample_size; i += utils::WARP_SIZE) {
+ auto nidx = s_idx[i];
+ // checking for node_end here because sample_size may be larger than
+ // the total number of neighbors of the node
+ auto val = nidx < node_end ? indices[nidx] : cugraph::invalid_idx