diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9a055d1dc51..2962b4438fe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -113,22 +113,3 @@ jobs: sha: ${{ inputs.sha }} date: ${{ inputs.date }} package-name: cugraph - wheel-build-cugraph-equivariant: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 - with: - build_type: ${{ inputs.build_type || 'branch' }} - branch: ${{ inputs.branch }} - sha: ${{ inputs.sha }} - date: ${{ inputs.date }} - script: ci/build_wheel_cugraph-equivariant.sh - wheel-publish-cugraph-equivariant: - needs: wheel-build-cugraph-equivariant - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12 - with: - build_type: ${{ inputs.build_type || 'branch' }} - branch: ${{ inputs.branch }} - sha: ${{ inputs.sha }} - date: ${{ inputs.date }} - package-name: cugraph-equivariant diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bac56fec9f5..e82342dfd94 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,8 +25,6 @@ jobs: - wheel-tests-pylibcugraph - wheel-build-cugraph - wheel-tests-cugraph - - wheel-build-cugraph-equivariant - - wheel-tests-cugraph-equivariant - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 @@ -161,21 +159,6 @@ jobs: with: build_type: pull-request script: ci/test_wheel_cugraph.sh - wheel-build-cugraph-equivariant: - secrets: inherit - 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, changed-files] - secrets: inherit - 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.12 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 245ac018cec..72f76904f4b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,13 +58,3 @@ jobs: date: ${{ inputs.date }} sha: ${{ inputs.sha }} script: ci/test_wheel_cugraph.sh - wheel-tests-cugraph-equivariant: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 - with: - build_type: nightly - branch: ${{ inputs.branch }} - date: ${{ inputs.date }} - sha: ${{ inputs.sha }} - script: ci/test_wheel_cugraph-equivariant.sh - matrix_filter: map(select(.ARCH == "amd64")) diff --git a/build.sh b/build.sh index 1ab98fe4378..398582c74c0 100755 --- a/build.sh +++ b/build.sh @@ -31,7 +31,6 @@ VALIDARGS=" cugraph-service cugraph-pyg cugraph-dgl - cugraph-equivariant cpp-mgtests cpp-mtmgtests docs @@ -59,7 +58,6 @@ HELP="$0 [ ...] [ ...] cugraph-service - build the cugraph-service_client and cugraph-service_server Python package cugraph-pyg - build the cugraph-pyg Python package cugraph-dgl - build the cugraph-dgl extensions for DGL - cugraph-equivariant - build the cugraph-equivariant Python package cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency. cpp-mtmgtests - build libcugraph MTMG tests. Adds UCX as a dependency (temporary). docs - build the docs @@ -209,8 +207,7 @@ if hasArg uninstall; then # FIXME: if multiple versions of these packages are installed, this only # removes the latest one and leaves the others installed. build.sh uninstall # can be run multiple times to remove all of them, but that is not obvious. - pip uninstall -y pylibcugraph cugraph cugraph-service-client cugraph-service-server \ - cugraph-dgl cugraph-pyg cugraph-equivariant + pip uninstall -y pylibcugraph cugraph cugraph-service-client cugraph-service-server fi if hasArg clean; then @@ -346,15 +343,6 @@ if hasArg cugraph-dgl || hasArg all; then fi fi -# Build and install the cugraph-equivariant Python package -if hasArg cugraph-equivariant || hasArg all; then - if hasArg --clean; then - cleanPythonDir ${REPODIR}/python/cugraph-equivariant - else - python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-equivariant - fi -fi - # Build the docs if hasArg docs || hasArg all; then if [ ! -d ${LIBCUGRAPH_BUILD_DIR} ]; then diff --git a/ci/build_python.sh b/ci/build_python.sh index 9a8f1227488..eab41f63da0 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -50,9 +50,4 @@ rapids-conda-retry mambabuild \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/cugraph-service -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/cugraph-equivariant - rapids-upload-conda-to-s3 python diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 3c89d63538c..9a77e6b3021 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -29,27 +29,22 @@ python -m pip wheel \ sccache --show-adv-stats -# pure-python packages should be marked as pure, and not have auditwheel run on them. -if [[ ${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 python dist -else - case "${RAPIDS_CUDA_VERSION}" in - 12.*) - EXCLUDE_ARGS=( - --exclude "libcublas.so.12" - --exclude "libcublasLt.so.12" - --exclude "libcurand.so.10" - --exclude "libcusolver.so.11" - --exclude "libcusparse.so.12" - --exclude "libnvJitLink.so.12" - ) - ;; - 11.*) - EXCLUDE_ARGS=() - ;; - esac - - mkdir -p final_dist - python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* - RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist -fi +case "${RAPIDS_CUDA_VERSION}" in + 12.*) + EXCLUDE_ARGS=( + --exclude "libcublas.so.12" + --exclude "libcublasLt.so.12" + --exclude "libcurand.so.10" + --exclude "libcusolver.so.11" + --exclude "libcusparse.so.12" + --exclude "libnvJitLink.so.12" + ) + ;; + 11.*) + EXCLUDE_ARGS=() + ;; +esac + +mkdir -p final_dist +python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist diff --git a/ci/build_wheel_cugraph-equivariant.sh b/ci/build_wheel_cugraph-equivariant.sh deleted file mode 100755 index 2f270422f84..00000000000 --- a/ci/build_wheel_cugraph-equivariant.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# Copyright (c) 2024, NVIDIA CORPORATION. - -set -euo pipefail - -package_dir="python/cugraph-equivariant" - -./ci/build_wheel.sh cugraph-equivariant ${package_dir} -./ci/validate_wheel.sh ${package_dir} dist diff --git a/ci/run_cugraph_equivariant_pytests.sh b/ci/run_cugraph_equivariant_pytests.sh deleted file mode 100755 index 5d5a5fb05c2..00000000000 --- a/ci/run_cugraph_equivariant_pytests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# Copyright (c) 2024, NVIDIA CORPORATION. - -set -euo pipefail - -# Support invoking run_cugraph_equivariant_pytests.sh outside the script directory -cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-equivariant/cugraph_equivariant - -pytest --cache-clear "$@" . diff --git a/ci/test_python.sh b/ci/test_python.sh index a3a177dcfc6..646b61805cc 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -100,42 +100,5 @@ rapids-logger "pytest cugraph-service (single GPU)" --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-service-coverage.xml" \ --cov-report=term -# test cugraph-equivariant -if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then - if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then - rapids-mamba-retry env create --yes -f env.yaml -n test_cugraph_equivariant - set +u - conda activate test_cugraph_equivariant - set -u - rapids-mamba-retry install \ - --channel "${CPP_CHANNEL}" \ - --channel "${PYTHON_CHANNEL}" \ - --channel conda-forge \ - --channel nvidia \ - "cugraph-equivariant=${RAPIDS_VERSION_MAJOR_MINOR}.*" - pip install e3nn==0.5.1 - - rapids-print-env - - rapids-logger "pytest cugraph-equivariant" - ./ci/run_cugraph_equivariant_pytests.sh \ - --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-equivariant.xml" \ - --cov-config=../../.coveragerc \ - --cov=cugraph_equivariant \ - --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-equivariant-coverage.xml" \ - --cov-report=term - - # Reactivate the test environment back - set +u - conda deactivate - conda activate test - set -u - else - rapids-logger "skipping cugraph-equivariant pytest on ARM64" - fi -else - rapids-logger "skipping cugraph-equivariant pytest on CUDA!=11.8" -fi - rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE} diff --git a/ci/test_wheel_cugraph-equivariant.sh b/ci/test_wheel_cugraph-equivariant.sh deleted file mode 100755 index 3be1d578964..00000000000 --- a/ci/test_wheel_cugraph-equivariant.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright (c) 2024, NVIDIA CORPORATION. - -set -eoxu pipefail - -package_name="cugraph-equivariant" - -mkdir -p ./dist -RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - -# Download the cugraph-equivariant built in the previous step -RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist - -# determine pytorch source -PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')" -PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2} -if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then - PYTORCH_CUDA_VER="121" -else - PYTORCH_CUDA_VER=$PKG_CUDA_VER -fi -PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}" - -# echo to expand wildcard before adding `[extra]` requires for pip -python -m pip install \ - -v \ - --extra-index-url "${PYTORCH_URL}" \ - "$(echo ./dist/cugraph_equivariant_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ - 'e3nn' \ - 'torch>=2.3.0,<2.4' - -python -m pytest python/cugraph-equivariant/cugraph_equivariant/tests diff --git a/conda/recipes/cugraph-equivariant/build.sh b/conda/recipes/cugraph-equivariant/build.sh deleted file mode 100644 index f0ff1688b55..00000000000 --- a/conda/recipes/cugraph-equivariant/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2024, NVIDIA CORPORATION. - -# This assumes the script is executed from the root of the repo directory - -./build.sh cugraph-equivariant diff --git a/conda/recipes/cugraph-equivariant/meta.yaml b/conda/recipes/cugraph-equivariant/meta.yaml deleted file mode 100644 index 9dc9d51fa48..00000000000 --- a/conda/recipes/cugraph-equivariant/meta.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} -{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} -{% set py_version = environ['CONDA_PY'] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - -package: - name: cugraph-equivariant - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - -requirements: - host: - - python - - rapids-build-backend>=0.3.1,<0.4.0.dev0 - - setuptools>=61.0.0 - run: - - pylibcugraphops ={{ minor_version }} - - python - -tests: - imports: - - cugraph_equivariant - -about: - home: https://rapids.ai/ - dev_url: https://github.com/rapidsai/cugraph - license: Apache-2.0 - license_file: ../../../LICENSE - summary: GPU-accelerated equivariant convolutional layers. diff --git a/cpp/tests/community/balanced_edge_test.cpp b/cpp/tests/community/balanced_edge_test.cpp index c4488dc9b9e..614a4ee4190 100644 --- a/cpp/tests/community/balanced_edge_test.cpp +++ b/cpp/tests/community/balanced_edge_test.cpp @@ -15,7 +15,7 @@ #include #include -TEST(balanced_edge, success) +TEST(balanced_edge, DISABLED_success) { std::vector off_h = {0, 16, 25, 35, 41, 44, 48, 52, 56, 61, 63, 66, 67, 69, 74, 76, 78, 80, 82, 84, 87, 89, 91, 93, diff --git a/dependencies.yaml b/dependencies.yaml index 208b3bedd63..6aa1b86aa60 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -202,30 +202,6 @@ files: - test_python_common - depends_on_pylibwholegraph - depends_on_pytorch - py_build_cugraph_equivariant: - output: pyproject - pyproject_dir: python/cugraph-equivariant - extras: - table: build-system - includes: - - python_build_rapids - - python_build_wheel - py_run_cugraph_equivariant: - output: pyproject - pyproject_dir: python/cugraph-equivariant - extras: - table: project - includes: - # Deprecate pylibcugraphops - - depends_on_pylibcugraphops - py_test_cugraph_equivariant: - output: pyproject - pyproject_dir: python/cugraph-equivariant - extras: - table: project.optional-dependencies - key: test - includes: - - test_python_common py_build_cugraph_service_client: output: pyproject pyproject_dir: python/cugraph-service/client diff --git a/docs/cugraph/source/installation/getting_cugraph.md b/docs/cugraph/source/installation/getting_cugraph.md index 01bc9e379c9..0c553acf964 100644 --- a/docs/cugraph/source/installation/getting_cugraph.md +++ b/docs/cugraph/source/installation/getting_cugraph.md @@ -31,7 +31,6 @@ cuGraph Conda packages * cugraph-service-server * cugraph-dgl * cugraph-pyg - * cugraph-equivariant * nx-cugraph Replace the package name in the example below to the one you want to install. @@ -61,7 +60,6 @@ Replace `-cu12` with `-cu11` for packages supporting CUDA 11. Also available: * cugraph-dgl-cu12 * cugraph-pyg-cu12 - * cugraph-equivariant-cu12 * nx-cugraph-cu12
diff --git a/docs/cugraph/source/nx_cugraph/benchmarks.md b/docs/cugraph/source/nx_cugraph/benchmarks.md index 45085c133a9..9e0718159fa 100644 --- a/docs/cugraph/source/nx_cugraph/benchmarks.md +++ b/docs/cugraph/source/nx_cugraph/benchmarks.md @@ -9,7 +9,7 @@ We ran several commonly used graph algorithms on both `networkx` and `nx-cugraph ![bench-image](../_static/bc_benchmark.png)
Results from running this BenchmarkBenchmark
@@ -23,4 +23,4 @@ Below are the steps to reproduce the results on your own. 4. Install the latest `nx-cugraph` by following the [Installation Guide](installation.md) -5. Follow the instructions written in the README [here](https://github.com/rapidsai/cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based) +5. Follow the instructions written in the README [here](https://github.com/rapidsai/nx-cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based/README.md) diff --git a/docs/cugraph/source/nx_cugraph/supported-algorithms.rst b/docs/cugraph/source/nx_cugraph/supported-algorithms.rst index 8f57c02b240..ae32bc330fe 100644 --- a/docs/cugraph/source/nx_cugraph/supported-algorithms.rst +++ b/docs/cugraph/source/nx_cugraph/supported-algorithms.rst @@ -352,4 +352,4 @@ Generators To request nx-cugraph backend support for a NetworkX API that is not listed -above, visit the `cuGraph GitHub repo `_. +above, visit the `nx-cugraph GitHub repo `_. diff --git a/python/cugraph-equivariant/LICENSE b/python/cugraph-equivariant/LICENSE deleted file mode 120000 index 30cff7403da..00000000000 --- a/python/cugraph-equivariant/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE \ No newline at end of file diff --git a/python/cugraph-equivariant/README.md b/python/cugraph-equivariant/README.md deleted file mode 100644 index d5de8852709..00000000000 --- a/python/cugraph-equivariant/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# cugraph-equivariant - -## Description - -cugraph-equivariant library provides fast symmetry-preserving (equivariant) operations and convolutional layers, to accelerate the equivariant neural networks in drug discovery and other domains. diff --git a/python/cugraph-equivariant/cugraph_equivariant/VERSION b/python/cugraph-equivariant/cugraph_equivariant/VERSION deleted file mode 120000 index d62dc733efd..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/VERSION +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION \ No newline at end of file diff --git a/python/cugraph-equivariant/cugraph_equivariant/__init__.py b/python/cugraph-equivariant/cugraph_equivariant/__init__.py deleted file mode 100644 index 20507bd9329..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from cugraph_equivariant._version import __git_commit__, __version__ diff --git a/python/cugraph-equivariant/cugraph_equivariant/_version.py b/python/cugraph-equivariant/cugraph_equivariant/_version.py deleted file mode 100644 index 940ebac74f7..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/_version.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2023-2024, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import importlib.resources - -# Read VERSION file from the module that is symlinked to VERSION file -# in the root of the repo at build time or copied to the module at -# installation. VERSION is a separate file that allows CI build-time scripts -# to update version info (including commit hashes) without modifying -# source files. -__version__ = ( - importlib.resources.files(__package__).joinpath("VERSION").read_text().strip() -) -try: - __git_commit__ = ( - importlib.resources.files(__package__) - .joinpath("GIT_COMMIT") - .read_text() - .strip() - ) -except FileNotFoundError: - __git_commit__ = "" - -__all__ = ["__git_commit__", "__version__"] diff --git a/python/cugraph-equivariant/cugraph_equivariant/nn/__init__.py b/python/cugraph-equivariant/cugraph_equivariant/nn/__init__.py deleted file mode 100644 index 8f4d8de0042..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/nn/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from .tensor_product_conv import FullyConnectedTensorProductConv - -DiffDockTensorProductConv = FullyConnectedTensorProductConv - -__all__ = [ - "FullyConnectedTensorProductConv", - "DiffDockTensorProductConv", -] diff --git a/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py b/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py deleted file mode 100644 index 923edbfc44a..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py +++ /dev/null @@ -1,283 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from typing import Optional, Sequence, Union, NamedTuple - -import torch -from torch import nn -from e3nn import o3 -from e3nn.nn import BatchNorm - -from cugraph_equivariant.utils import scatter_reduce - -try: - from pylibcugraphops.pytorch.operators import FusedFullyConnectedTensorProduct -except ImportError as exc: - raise RuntimeError( - "FullyConnectedTensorProductConv is no longer supported in " - "cugraph-equivariant starting from version 24.08. It will be migrated " - "to the new `cuequivariance` package. Please use 24.06 release for the " - "legacy interface." - ) from exc - - -class Graph(NamedTuple): - edge_index: torch.Tensor - size: tuple[int, int] - - -class FullyConnectedTensorProductConv(nn.Module): - r"""Message passing layer for tensor products in DiffDock-like architectures. - The left operand of tensor product is the spherical harmonic representation - of edge vector; the right operand consists of node features in irreps. - - .. math:: - \sum_{b \in \mathcal{N}_a} Y\left(\hat{r}_{a b}\right) - \otimes_{\psi_{a b}} \mathbf{h}_b - - where the path weights :math:`\psi_{a b}` can be constructed from edge - embeddings and scalar features using an MLP: - - .. math:: - \psi_{a b} = \operatorname{MLP} - \left(e_{a b}, \mathbf{h}_a^0, \mathbf{h}_b^0\right) - - Users have the option to either directly input the weights or provide the - MLP parameters and scalar features from edges and nodes. - - Parameters - ---------- - in_irreps : e3nn.o3.Irreps - Irreps for the input node features. - - sh_irreps : e3nn.o3.Irreps - Irreps for the spherical harmonic representations of edge vectors. - - out_irreps : e3nn.o3.Irreps - Irreps for the output. - - batch_norm : bool, optional (default=True) - If true, batch normalization is applied. - - mlp_channels : sequence of ints, optional (default=None) - A sequence of integers defining number of neurons in each layer in MLP - before the output layer. If `None`, no MLP will be added. The input layer - contains edge embeddings and node scalar features. - - mlp_activation : nn.Module or sequence of nn.Module, optional (default=nn.GELU()) - A sequence of functions to be applied in between linear layers in MLP, - e.g., `nn.Sequential(nn.ReLU(), nn.Dropout(0.4))`. - - e3nn_compat_mode: bool, optional (default=False) - cugraph-ops and e3nn use different memory layout for Irreps-tensors. - The last (fastest moving) dimension is num_channels for cugraph-ops and - ir.dim for e3nn. When enabled, the input and output of this layer will - follow e3nn's memory layout. - - Examples - -------- - Case 1: MLP with the input layer having 6 channels and 2 hidden layers - having 16 channels. edge_emb.size(1) must match the size of the input layer: 6 - - >>> conv1 = FullyConnectedTensorProductConv(in_irreps, sh_irreps, out_irreps, - >>> mlp_channels=[6, 16, 16], mlp_activation=nn.ReLU()).cuda() - >>> out = conv1(src_features, edge_sh, edge_emb, graph) - - Case 2: If `edge_emb` is constructed by concatenating scalar features from - edges, sources and destinations, as in DiffDock, the layer can accept each - scalar component separately: - - >>> conv2 = FullyConnectedTensorProductConv(in_irreps, sh_irreps, out_irreps, - >>> mlp_channels=[6, 16, 16], mlp_activation=nn.ReLU()).cuda() - >>> out = conv2(src_features, edge_sh, edge_scalars, graph, - >>> src_scalars=src_scalars, dst_scalars=dst_scalars) - - This allows a smaller GEMM in the first MLP layer by performing GEMM on each - component before indexing. The first-layer weights are split into sections - for edges, sources and destinations, in that order.This is equivalent to - - >>> src, dst = graph.edge_index - >>> edge_emb = torch.hstack((edge_scalars, src_scalars[src], dst_scalars[dst])) - >>> out = conv2(src_features, edge_sh, edge_emb, graph) - - Case 3: No MLP, `edge_emb` will be directly used as the tensor product weights: - - >>> conv3 = FullyConnectedTensorProductConv(in_irreps, sh_irreps, out_irreps, - >>> mlp_channels=None).cuda() - >>> out = conv3(src_features, edge_sh, edge_emb, graph) - - """ - - def __init__( - self, - in_irreps: o3.Irreps, - sh_irreps: o3.Irreps, - out_irreps: o3.Irreps, - batch_norm: bool = True, - mlp_channels: Optional[Sequence[int]] = None, - mlp_activation: Union[nn.Module, Sequence[nn.Module]] = nn.GELU(), - e3nn_compat_mode: bool = False, - ): - super().__init__() - self.in_irreps = in_irreps - self.out_irreps = out_irreps - self.sh_irreps = sh_irreps - self.e3nn_compat_mode = e3nn_compat_mode - - self.tp = FusedFullyConnectedTensorProduct( - in_irreps, sh_irreps, out_irreps, e3nn_compat_mode=e3nn_compat_mode - ) - - self.batch_norm = BatchNorm(out_irreps) if batch_norm else None - - if mlp_activation is None: - mlp_activation = [] - elif hasattr(mlp_activation, "__len__") and hasattr( - mlp_activation, "__getitem__" - ): - mlp_activation = list(mlp_activation) - else: - mlp_activation = [mlp_activation] - - if mlp_channels is not None: - dims = list(mlp_channels) + [self.tp.weight_numel] - mlp = [] - for i in range(len(dims) - 1): - mlp.append(nn.Linear(dims[i], dims[i + 1])) - if i != len(dims) - 2: - mlp.extend(mlp_activation) - self.mlp = nn.Sequential(*mlp) - else: - self.mlp = None - - def forward( - self, - src_features: torch.Tensor, - edge_sh: torch.Tensor, - edge_emb: torch.Tensor, - graph: tuple[torch.Tensor, tuple[int, int]], - src_scalars: Optional[torch.Tensor] = None, - dst_scalars: Optional[torch.Tensor] = None, - reduce: str = "mean", - edge_envelope: Optional[torch.Tensor] = None, - ) -> torch.Tensor: - """Forward pass. - - Parameters - ---------- - src_features : torch.Tensor - Source node features. - Shape: (num_src_nodes, in_irreps.dim) - - edge_sh : torch.Tensor - The spherical harmonic representations of the edge vectors. - Shape: (num_edges, sh_irreps.dim) - - edge_emb: torch.Tensor - Edge embeddings that are fed into MLPs to generate tensor product weights. - Shape: (num_edges, dim), where `dim` should be: - - `tp.weight_numel` when the layer does not contain MLPs. - - num_edge_scalars, when scalar features from edges, sources and - destinations are passed in separately. - - graph : tuple - A tuple that stores the graph information, with the first element being - the adjacency matrix in COO, and the second element being its shape: - (num_src_nodes, num_dst_nodes). - - src_scalars: torch.Tensor, optional - Scalar features of source nodes. See examples for usage. - Shape: (num_src_nodes, num_src_scalars) - - dst_scalars: torch.Tensor, optional - Scalar features of destination nodes. See examples for usage. - Shape: (num_dst_nodes, num_dst_scalars) - - reduce : str, optional (default="mean") - Reduction operator. Choose between "mean" and "sum". - - edge_envelope: torch.Tensor, optional - Typically used as attenuation factors to fade out messages coming - from nodes close to the cutoff distance used to create the graph. - This is important to make the model smooth to the changes in node's - coordinates. - Shape: (num_edges,) - - Returns - ------- - torch.Tensor - Output node features. - Shape: (num_dst_nodes, out_irreps.dim) - """ - edge_emb_size = edge_emb.size(-1) - src_scalars_size = 0 if src_scalars is None else src_scalars.size(-1) - dst_scalars_size = 0 if dst_scalars is None else dst_scalars.size(-1) - - if self.mlp is None: - if self.tp.weight_numel != edge_emb_size: - raise RuntimeError( - f"When MLP is not present, edge_emb's last dimension must " - f"equal tp.weight_numel (but got {edge_emb_size} and " - f"{self.tp.weight_numel})" - ) - else: - total_size = edge_emb_size + src_scalars_size + dst_scalars_size - if self.mlp[0].in_features != total_size: - raise RuntimeError( - f"The size of MLP's input layer ({self.mlp[0].in_features}) " - f"does not match the total number of scalar features from " - f"edge_emb, src_scalars and dst_scalars ({total_size})" - ) - - if reduce not in ["mean", "sum"]: - raise RuntimeError( - f"reduce argument must be either 'mean' or 'sum', got {reduce}." - ) - - (src, dst), (num_src_nodes, num_dst_nodes) = graph - - if self.mlp is not None: - if src_scalars is None and dst_scalars is None: - tp_weights = self.mlp(edge_emb) - else: - w_edge, w_src, w_dst = torch.split( - self.mlp[0].weight, - (edge_emb_size, src_scalars_size, dst_scalars_size), - dim=-1, - ) - tp_weights = edge_emb @ w_edge.T + self.mlp[0].bias - - if src_scalars is not None: - tp_weights += (src_scalars @ w_src.T)[src] - - if dst_scalars is not None: - tp_weights += (dst_scalars @ w_dst.T)[dst] - - tp_weights = self.mlp[1:](tp_weights) - else: - tp_weights = edge_emb - - out = self.tp(src_features[src], edge_sh, tp_weights) - - if edge_envelope is not None: - out = out * edge_envelope.view(-1, 1) - - dtype = out.dtype - out = scatter_reduce( - out.float(), dst, dim=0, dim_size=num_dst_nodes, reduce=reduce - ).to(dtype) - - if self.batch_norm: - out = self.batch_norm(out) - - return out diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/conftest.py b/python/cugraph-equivariant/cugraph_equivariant/tests/conftest.py deleted file mode 100644 index 806e03e6d76..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/conftest.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import pytest -import torch - - -@pytest.fixture -def example_scatter_data(): - src_feat = torch.Tensor([3, 1, 0, 1, 1, 2]) - dst_indices = torch.Tensor([0, 1, 2, 2, 3, 1]) - - results = { - "sum": torch.Tensor([3.0, 3.0, 1.0, 1.0]), - "mean": torch.Tensor([3.0, 1.5, 0.5, 1.0]), - "prod": torch.Tensor([3.0, 2.0, 0.0, 1.0]), - "amax": torch.Tensor([3.0, 2.0, 1.0, 1.0]), - "amin": torch.Tensor([3.0, 1.0, 0.0, 1.0]), - } - - return src_feat, dst_indices, results - - -@pytest.fixture -def empty_scatter_data(): - src_feat = torch.empty((0, 41)) - dst_indices = torch.empty((0,)) - - return src_feat, dst_indices diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/pytest.ini b/python/cugraph-equivariant/cugraph_equivariant/tests/pytest.ini deleted file mode 100644 index 7b0a9f29fb1..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. - -[pytest] -addopts = --tb=native diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/test_scatter.py b/python/cugraph-equivariant/cugraph_equivariant/tests/test_scatter.py deleted file mode 100644 index d28a32edcb1..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/test_scatter.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import pytest -import torch -from cugraph_equivariant.utils import scatter_reduce - - -@pytest.mark.parametrize("reduce", ["sum", "mean", "prod", "amax", "amin"]) -def test_scatter_reduce(example_scatter_data, reduce): - device = torch.device("cuda") - src, index, out_true = example_scatter_data - src = src.to(device) - index = index.to(device) - - out = scatter_reduce(src, index, dim=0, dim_size=None, reduce=reduce) - - assert torch.allclose(out.cpu(), out_true[reduce]) - - -def test_scatter_reduce_empty(empty_scatter_data): - device = torch.device("cuda") - src, index = empty_scatter_data - src = src.to(device) - index = index.to(device) - - out = scatter_reduce(src, index, dim=0, dim_size=None) - - assert out.numel() == 0 - assert out.size(1) == src.size(1) diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py b/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py deleted file mode 100644 index ce325c47aa0..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import pytest - -try: - from cugraph_equivariant.nn import FullyConnectedTensorProductConv -except RuntimeError: - pytest.skip( - "Migrated to cuequivariance package starting from 24.08.", - allow_module_level=True, - ) - -import torch -from torch import nn -from e3nn import o3 -from cugraph_equivariant.nn.tensor_product_conv import Graph - -device = torch.device("cuda") - - -def create_random_graph( - num_src_nodes, - num_dst_nodes, - num_edges, - dtype=None, - device=None, -): - row = torch.randint(num_src_nodes, (num_edges,), dtype=dtype, device=device) - col = torch.randint(num_dst_nodes, (num_edges,), dtype=dtype, device=device) - edge_index = torch.stack([row, col], dim=0) - - return Graph(edge_index, (num_src_nodes, num_dst_nodes)) - - -@pytest.mark.parametrize("dtype", [torch.float32, torch.float16, torch.bfloat16]) -@pytest.mark.parametrize("e3nn_compat_mode", [True, False]) -@pytest.mark.parametrize("batch_norm", [True, False]) -@pytest.mark.parametrize( - "mlp_channels, mlp_activation, scalar_sizes", - [ - [(30, 8, 8), nn.Sequential(nn.Dropout(0.3), nn.ReLU()), (15, 15, 0)], - [(7,), nn.GELU(), (2, 3, 2)], - [None, None, None], - ], -) -def test_tensor_product_conv_equivariance( - mlp_channels, mlp_activation, scalar_sizes, batch_norm, e3nn_compat_mode, dtype -): - torch.manual_seed(12345) - to_kwargs = {"device": device, "dtype": dtype} - - in_irreps = o3.Irreps("10x0e + 10x1e") - out_irreps = o3.Irreps("20x0e + 10x1e") - sh_irreps = o3.Irreps.spherical_harmonics(lmax=2) - - tp_conv = FullyConnectedTensorProductConv( - in_irreps=in_irreps, - sh_irreps=sh_irreps, - out_irreps=out_irreps, - mlp_channels=mlp_channels, - mlp_activation=mlp_activation, - batch_norm=batch_norm, - e3nn_compat_mode=e3nn_compat_mode, - ).to(**to_kwargs) - - num_src_nodes, num_dst_nodes = 9, 7 - num_edges = 40 - graph = create_random_graph(num_src_nodes, num_dst_nodes, num_edges, device=device) - - edge_sh = torch.randn(num_edges, sh_irreps.dim, **to_kwargs) - src_features = torch.randn(num_src_nodes, in_irreps.dim, **to_kwargs) - - rot = o3.rand_matrix() - D_in = tp_conv.in_irreps.D_from_matrix(rot).to(**to_kwargs) - D_sh = tp_conv.sh_irreps.D_from_matrix(rot).to(**to_kwargs) - D_out = tp_conv.out_irreps.D_from_matrix(rot).to(**to_kwargs) - - if mlp_channels is None: - edge_emb = torch.randn(num_edges, tp_conv.tp.weight_numel, **to_kwargs) - src_scalars = dst_scalars = None - else: - if scalar_sizes: - edge_emb = torch.randn(num_edges, scalar_sizes[0], **to_kwargs) - src_scalars = ( - None - if scalar_sizes[1] == 0 - else torch.randn(num_src_nodes, scalar_sizes[1], **to_kwargs) - ) - dst_scalars = ( - None - if scalar_sizes[2] == 0 - else torch.randn(num_dst_nodes, scalar_sizes[2], **to_kwargs) - ) - else: - edge_emb = torch.randn(num_edges, tp_conv.mlp[0].in_features, **to_kwargs) - src_scalars = dst_scalars = None - - # rotate before - torch.manual_seed(12345) - out_before = tp_conv( - src_features=src_features @ D_in.T, - edge_sh=edge_sh @ D_sh.T, - edge_emb=edge_emb, - graph=graph, - src_scalars=src_scalars, - dst_scalars=dst_scalars, - ) - - # rotate after - torch.manual_seed(12345) - out_after = ( - tp_conv( - src_features=src_features, - edge_sh=edge_sh, - edge_emb=edge_emb, - graph=graph, - src_scalars=src_scalars, - dst_scalars=dst_scalars, - ) - @ D_out.T - ) - - atol = 1e-3 if dtype == torch.float32 else 1e-1 - if e3nn_compat_mode: - assert torch.allclose(out_before, out_after, rtol=1e-4, atol=atol) diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/test_version.py b/python/cugraph-equivariant/cugraph_equivariant/tests/test_version.py deleted file mode 100644 index e8b484fe16c..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/test_version.py +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. - -import cugraph_equivariant - - -def test_version_constants_are_populated(): - # __git_commit__ will only be non-empty in a built distribution - assert isinstance(cugraph_equivariant.__git_commit__, str) - - # __version__ should always be non-empty - assert isinstance(cugraph_equivariant.__version__, str) - assert len(cugraph_equivariant.__version__) > 0 diff --git a/python/cugraph-equivariant/cugraph_equivariant/utils/__init__.py b/python/cugraph-equivariant/cugraph_equivariant/utils/__init__.py deleted file mode 100644 index b4acfe8d090..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/utils/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from .scatter import scatter_reduce - -__all__ = [ - "scatter_reduce", -] diff --git a/python/cugraph-equivariant/cugraph_equivariant/utils/scatter.py b/python/cugraph-equivariant/cugraph_equivariant/utils/scatter.py deleted file mode 100644 index 909fbc99365..00000000000 --- a/python/cugraph-equivariant/cugraph_equivariant/utils/scatter.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from typing import Optional - -import torch - - -def broadcast(src: torch.Tensor, ref: torch.Tensor, dim: int) -> torch.Tensor: - size = ((1,) * dim) + (-1,) + ((1,) * (ref.dim() - dim - 1)) - return src.view(size).expand_as(ref) - - -def scatter_reduce( - src: torch.Tensor, - index: torch.Tensor, - dim: int = 0, - dim_size: Optional[int] = None, # value of out.size(dim) - reduce: str = "sum", # "sum", "prod", "mean", "amax", "amin" -): - # scatter() expects index to be int64 - index = broadcast(index, src, dim).to(torch.int64) - - size = list(src.size()) - - if dim_size is not None: - size[dim] = dim_size - else: - size[dim] = 0 if index.numel() == 0 else int(index.max()) + 1 - - out = torch.zeros(size, dtype=src.dtype, device=src.device) - return out.scatter_reduce_(dim, index, src, reduce, include_self=False) diff --git a/python/cugraph-equivariant/pyproject.toml b/python/cugraph-equivariant/pyproject.toml deleted file mode 100644 index ffaeb4f9c34..00000000000 --- a/python/cugraph-equivariant/pyproject.toml +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -[build-system] -requires = [ - "rapids-build-backend>=0.3.1,<0.4.0.dev0", - "setuptools>=61.0.0", - "wheel", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. -build-backend = "rapids_build_backend.build" - -[project] -name = "cugraph-equivariant" -dynamic = ["version"] -description = "Fast GPU-based equivariant operations and convolutional layers." -readme = { file = "README.md", content-type = "text/markdown" } -authors = [ - { name = "NVIDIA Corporation" }, -] -license = { text = "Apache 2.0" } -requires-python = ">=3.10" -classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", -] -dependencies = [ - "pylibcugraphops==24.12.*,>=0.0.0a0", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. - -[project.urls] -Homepage = "https://github.com/rapidsai/cugraph" -Documentation = "https://docs.rapids.ai/api/cugraph/stable/api_docs/cugraph-ops/" - -[project.optional-dependencies] -test = [ - "pandas", - "pytest", - "pytest-benchmark", - "pytest-cov", - "pytest-xdist", - "scipy", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. - -[tool.setuptools] -license-files = ["LICENSE"] - -[tool.setuptools.dynamic] -version = {file = "cugraph_equivariant/VERSION"} - -[tool.setuptools.packages.find] -include = [ - "cugraph_equivariant*", - "cugraph_equivariant.*", -] - -[tool.rapids-build-backend] -build-backend = "setuptools.build_meta" -dependencies-file = "../../dependencies.yaml" -matrix-entry = "cuda_suffixed=true" - -[tool.pydistcheck] -select = [ - "distro-too-large-compressed", -] - -# PyPI limit is 100 MiB, fail CI before we get too close to that -max_allowed_size_compressed = '75M' diff --git a/python/cugraph-equivariant/setup.py b/python/cugraph-equivariant/setup.py deleted file mode 100644 index acd0df3f717..00000000000 --- a/python/cugraph-equivariant/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import find_packages, setup - -if __name__ == "__main__": - packages = find_packages(include=["cugraph_equivariant*"]) - setup( - package_data={key: ["VERSION"] for key in packages}, - ) diff --git a/python/cugraph/cugraph/centrality/betweenness_centrality.py b/python/cugraph/cugraph/centrality/betweenness_centrality.py index dd47b1e8df0..00a9972efba 100644 --- a/python/cugraph/cugraph/centrality/betweenness_centrality.py +++ b/python/cugraph/cugraph/centrality/betweenness_centrality.py @@ -58,6 +58,11 @@ def betweenness_centrality( Algorithm (2001) to compute exact or approximate betweenness. If weights are provided in the edgelist, they will not be used. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + k : int, list or cudf object or None, optional (default=None) If k is not None, use k node samples to estimate betweenness. Higher values give better approximation. If k is either a list, a cudf DataFrame, @@ -224,6 +229,11 @@ def edge_betweenness_centrality( The current implementation uses BFS traversals. Use weight parameter if weights need to be considered (currently not supported). + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + k : int or list or None, optional (default=None) If k is not None, use k node samples to estimate betweenness. Higher values give better approximation. If k is either a list, a cudf DataFrame, diff --git a/python/cugraph/cugraph/centrality/degree_centrality.py b/python/cugraph/cugraph/centrality/degree_centrality.py index 12d39f4127e..3e5e8842cf5 100644 --- a/python/cugraph/cugraph/centrality/degree_centrality.py +++ b/python/cugraph/cugraph/centrality/degree_centrality.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 @@ -28,6 +28,11 @@ def degree_centrality(G, normalized=True): cuGraph graph descriptor with connectivity information. The graph can contain either directed or undirected edges. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + normalized : bool, optional, default=True If True normalize the resulting degree centrality values diff --git a/python/cugraph/cugraph/centrality/eigenvector_centrality.py b/python/cugraph/cugraph/centrality/eigenvector_centrality.py index 6be797096fc..d902a0dc947 100644 --- a/python/cugraph/cugraph/centrality/eigenvector_centrality.py +++ b/python/cugraph/cugraph/centrality/eigenvector_centrality.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 @@ -37,6 +37,11 @@ def eigenvector_centrality(G, max_iter=100, tol=1.0e-6): cuGraph graph descriptor with connectivity information. The graph can contain either directed or undirected edges. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + max_iter : int, optional (default=100) The maximum number of iterations before an answer is returned. This can be used to limit the execution time and do an early exit before the diff --git a/python/cugraph/cugraph/centrality/katz_centrality.py b/python/cugraph/cugraph/centrality/katz_centrality.py index d902f9b06c9..1a44582d90e 100644 --- a/python/cugraph/cugraph/centrality/katz_centrality.py +++ b/python/cugraph/cugraph/centrality/katz_centrality.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -48,6 +48,11 @@ def katz_centrality( cuGraph graph descriptor with connectivity information. The graph can contain either directed or undirected edges. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + alpha : float, optional (default=None) Attenuation factor defaulted to None. If alpha is not specified then it is internally calculated as 1/(degree_max) where degree_max is the diff --git a/python/cugraph/cugraph/community/egonet.py b/python/cugraph/cugraph/community/egonet.py index 56ae8ce70cc..e2a0833f6cb 100644 --- a/python/cugraph/cugraph/community/egonet.py +++ b/python/cugraph/cugraph/community/egonet.py @@ -62,6 +62,11 @@ def ego_graph(G, n, radius=1, center=True, undirected=None, distance=None): information. Edge weights, if present, should be single or double precision floating point values. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + n : integer or list, cudf.Series, cudf.DataFrame A single node as integer or a cudf.DataFrame if nodes are represented with multiple columns. If a cudf.DataFrame is provided, diff --git a/python/cugraph/cugraph/community/induced_subgraph.py b/python/cugraph/cugraph/community/induced_subgraph.py index c10241afa61..64d5ab09531 100644 --- a/python/cugraph/cugraph/community/induced_subgraph.py +++ b/python/cugraph/cugraph/community/induced_subgraph.py @@ -71,6 +71,11 @@ def induced_subgraph( G : cugraph.Graph or networkx.Graph The current implementation only supports weighted graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + vertices : cudf.Series or cudf.DataFrame Specifies the vertices of the induced subgraph. For multi-column vertices, vertices should be provided as a cudf.DataFrame diff --git a/python/cugraph/cugraph/community/ktruss_subgraph.py b/python/cugraph/cugraph/community/ktruss_subgraph.py index bcf8527e17b..6535592856d 100644 --- a/python/cugraph/cugraph/community/ktruss_subgraph.py +++ b/python/cugraph/cugraph/community/ktruss_subgraph.py @@ -50,6 +50,11 @@ def k_truss( defined for only undirected graphs as they are defined for undirected triangle in a graph. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + k : int The desired k to be used for extracting the k-truss subgraph. diff --git a/python/cugraph/cugraph/community/leiden.py b/python/cugraph/cugraph/community/leiden.py index d2a1a413d7b..6abedcac955 100644 --- a/python/cugraph/cugraph/community/leiden.py +++ b/python/cugraph/cugraph/community/leiden.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -56,6 +56,11 @@ def leiden( The adjacency list will be computed if not already present. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + max_iter : integer, optional (default=100) This controls the maximum number of levels/iterations of the Leiden algorithm. When specified the algorithm will terminate after no more diff --git a/python/cugraph/cugraph/community/louvain.py b/python/cugraph/cugraph/community/louvain.py index 0bedd427824..5c70a900b73 100644 --- a/python/cugraph/cugraph/community/louvain.py +++ b/python/cugraph/cugraph/community/louvain.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -62,6 +62,11 @@ def louvain( present. The current implementation only supports undirected graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + max_level : integer, optional (default=100) This controls the maximum number of levels of the Louvain algorithm. When specified the algorithm will terminate after no more diff --git a/python/cugraph/cugraph/community/spectral_clustering.py b/python/cugraph/cugraph/community/spectral_clustering.py index 8b4dbce830f..418e08e96d7 100644 --- a/python/cugraph/cugraph/community/spectral_clustering.py +++ b/python/cugraph/cugraph/community/spectral_clustering.py @@ -45,6 +45,11 @@ def spectralBalancedCutClustering( G : cugraph.Graph or networkx.Graph Graph descriptor + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + num_clusters : integer Specifies the number of clusters to find, must be greater than 1 @@ -142,6 +147,11 @@ def spectralModularityMaximizationClustering( G : cugraph.Graph or networkx.Graph cuGraph graph descriptor. This graph should have edge weights. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + num_clusters : integer Specifies the number of clusters to find @@ -233,6 +243,11 @@ def analyzeClustering_modularity( G : cugraph.Graph or networkx.Graph graph descriptor. This graph should have edge weights. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + n_clusters : integer Specifies the number of clusters in the given clustering diff --git a/python/cugraph/cugraph/community/subgraph_extraction.py b/python/cugraph/cugraph/community/subgraph_extraction.py index 43169051be4..e49e681c096 100644 --- a/python/cugraph/cugraph/community/subgraph_extraction.py +++ b/python/cugraph/cugraph/community/subgraph_extraction.py @@ -46,6 +46,11 @@ def subgraph( G : cugraph.Graph or networkx.Graph The current implementation only supports weighted graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + vertices : cudf.Series or cudf.DataFrame Specifies the vertices of the induced subgraph. For multi-column vertices, vertices should be provided as a cudf.DataFrame diff --git a/python/cugraph/cugraph/community/triangle_count.py b/python/cugraph/cugraph/community/triangle_count.py index 247327b6e4c..eb2ee1465bc 100644 --- a/python/cugraph/cugraph/community/triangle_count.py +++ b/python/cugraph/cugraph/community/triangle_count.py @@ -54,6 +54,11 @@ def triangle_count(G, start_list=None): (edge weights are not used in this algorithm). The current implementation only supports undirected graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + start_list : list or cudf.Series list of vertices for triangle count. if None the entire set of vertices in the graph is processed diff --git a/python/cugraph/cugraph/components/connectivity.py b/python/cugraph/cugraph/components/connectivity.py index 45dba37d2ce..00bf443278f 100644 --- a/python/cugraph/cugraph/components/connectivity.py +++ b/python/cugraph/cugraph/components/connectivity.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -115,6 +115,11 @@ def weakly_connected_components(G, directed=None, connection=None, return_labels The adjacency list will be computed if not already present. The number of vertices should fit into a 32b int. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + directed : bool, optional (default=None) NOTE @@ -224,6 +229,11 @@ def strongly_connected_components( The adjacency list will be computed if not already present. The number of vertices should fit into a 32b int. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + directed : bool, optional (default=True) NOTE @@ -330,6 +340,11 @@ def connected_components(G, directed=None, connection="weak", return_labels=None The adjacency list will be computed if not already present. The number of vertices should fit into a 32b int. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + directed : bool, optional (default=True) NOTE diff --git a/python/cugraph/cugraph/cores/core_number.py b/python/cugraph/cugraph/cores/core_number.py index 3e6cbe0d96f..0b411c2eed2 100644 --- a/python/cugraph/cugraph/cores/core_number.py +++ b/python/cugraph/cugraph/cores/core_number.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -37,6 +37,11 @@ def core_number(G, degree_type="bidirectional"): of the core numbers. The current implementation only supports undirected graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + degree_type: str, (default="bidirectional") This option determines if the core number computation should be based on input, output, or both directed edges, with valid values being diff --git a/python/cugraph/cugraph/cores/k_core.py b/python/cugraph/cugraph/cores/k_core.py index 3dbc1cfa377..6c8e20b0ea8 100644 --- a/python/cugraph/cugraph/cores/k_core.py +++ b/python/cugraph/cugraph/cores/k_core.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -55,6 +55,11 @@ def k_core(G, k=None, core_number=None, degree_type="bidirectional"): weights, they don't participate in the calculation of the k-core. The current implementation only supports undirected graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + k : int, optional (default=None) Order of the core. This value must not be negative. If set to None, the main core is returned. diff --git a/python/cugraph/cugraph/link_analysis/pagerank.py b/python/cugraph/cugraph/link_analysis/pagerank.py index ef0705c6be9..40ae14e76dd 100644 --- a/python/cugraph/cugraph/link_analysis/pagerank.py +++ b/python/cugraph/cugraph/link_analysis/pagerank.py @@ -107,6 +107,11 @@ def pagerank( as an edge list. The transposed adjacency list will be computed if not already present. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + alpha : float, optional (default=0.85) The damping factor alpha represents the probability to follow an outgoing edge, standard value is 0.85. diff --git a/python/cugraph/cugraph/link_prediction/cosine.py b/python/cugraph/cugraph/link_prediction/cosine.py index 9dce0e96f8c..71ef88b78b4 100644 --- a/python/cugraph/cugraph/link_prediction/cosine.py +++ b/python/cugraph/cugraph/link_prediction/cosine.py @@ -190,6 +190,11 @@ def cosine_coefficient( This implementation only supports undirected, non-multi Graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None) A GPU dataframe consisting of two columns representing pairs of vertices or iterable of 2-tuples (u, v) where u and v are nodes in diff --git a/python/cugraph/cugraph/link_prediction/jaccard.py b/python/cugraph/cugraph/link_prediction/jaccard.py index 214d92a1be5..77eb6447e85 100644 --- a/python/cugraph/cugraph/link_prediction/jaccard.py +++ b/python/cugraph/cugraph/link_prediction/jaccard.py @@ -190,6 +190,11 @@ def jaccard_coefficient( This implementation only supports undirected, non-multi Graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None) A GPU dataframe consisting of two columns representing pairs of vertices or iterable of 2-tuples (u, v) where u and v are nodes in diff --git a/python/cugraph/cugraph/link_prediction/overlap.py b/python/cugraph/cugraph/link_prediction/overlap.py index 52697d6b552..47c7765fb0f 100644 --- a/python/cugraph/cugraph/link_prediction/overlap.py +++ b/python/cugraph/cugraph/link_prediction/overlap.py @@ -75,6 +75,11 @@ def overlap_coefficient( This implementation only supports undirected, non-multi edge Graph. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None) A GPU dataframe consisting of two columns representing pairs of vertices or iterable of 2-tuples (u, v) where u and v are nodes in diff --git a/python/cugraph/cugraph/link_prediction/sorensen.py b/python/cugraph/cugraph/link_prediction/sorensen.py index 8030234993b..d8327bf25a9 100644 --- a/python/cugraph/cugraph/link_prediction/sorensen.py +++ b/python/cugraph/cugraph/link_prediction/sorensen.py @@ -205,6 +205,11 @@ def sorensen_coefficient( This implementation only supports undirected, non-multi Graphs. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None) A GPU dataframe consisting of two columns representing pairs of vertices or iterable of 2-tuples (u, v) where u and v are nodes in diff --git a/python/cugraph/cugraph/sampling/node2vec.py b/python/cugraph/cugraph/sampling/node2vec.py index 71fc2969f86..eb91bfec82b 100644 --- a/python/cugraph/cugraph/sampling/node2vec.py +++ b/python/cugraph/cugraph/sampling/node2vec.py @@ -60,6 +60,11 @@ def node2vec(G, start_vertices, max_depth=1, compress_result=True, p=1.0, q=1.0) The graph can be either directed or undirected. Weights in the graph are ignored. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + start_vertices: int or list or cudf.Series or cudf.DataFrame A single node or a list or a cudf.Series of nodes from which to run the random walks. In case of multi-column vertices it should be diff --git a/python/cugraph/cugraph/sampling/random_walks.py b/python/cugraph/cugraph/sampling/random_walks.py index 1bd7394164f..1c56dbbe324 100644 --- a/python/cugraph/cugraph/sampling/random_walks.py +++ b/python/cugraph/cugraph/sampling/random_walks.py @@ -72,6 +72,11 @@ def random_walks( G : cuGraph.Graph or networkx.Graph The graph can be either directed or undirected. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + random_walks_type : str, optional (default='uniform') Type of random walks: 'uniform', 'biased', 'node2vec'. Only 'uniform' random walks is currently supported diff --git a/python/cugraph/cugraph/traversal/bfs.py b/python/cugraph/cugraph/traversal/bfs.py index cad96947f8b..2335b1d390c 100644 --- a/python/cugraph/cugraph/traversal/bfs.py +++ b/python/cugraph/cugraph/traversal/bfs.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -135,6 +135,11 @@ def bfs( information. Edge weights, if present, should be single or double precision floating point values. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + start : Integer or list, optional (default=None) The id of the graph vertex from which the traversal begins, or if a list, the vertex from which the traversal begins in each @@ -265,6 +270,11 @@ def bfs_edges(G, source, reverse=False, depth_limit=None, sort_neighbors=None): information. Edge weights, if present, should be single or double precision floating point values. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + source : Integer The starting vertex index diff --git a/python/cugraph/cugraph/traversal/sssp.py b/python/cugraph/cugraph/traversal/sssp.py index bb98b5a9a29..ad3f3c716d1 100644 --- a/python/cugraph/cugraph/traversal/sssp.py +++ b/python/cugraph/cugraph/traversal/sssp.py @@ -158,6 +158,12 @@ def sssp( weights, if present, should be single or double precision floating point values. The current implementation only supports weighted graphs. + + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + source : int Index of the source vertex. cutoff : double, optional (default=None) @@ -323,6 +329,11 @@ def shortest_path_length(G, source, target=None): cuGraph graph descriptor with connectivity information. Edge weights, if present, should be single or double precision floating point values. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + source : Dependant on graph type. Index of the source vertex. If graph is an instance of cuGraph.Graph or CuPy sparse COO matrix: diff --git a/python/cugraph/cugraph/tree/minimum_spanning_tree.py b/python/cugraph/cugraph/tree/minimum_spanning_tree.py index b297042f199..342ee0b77fe 100644 --- a/python/cugraph/cugraph/tree/minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tree/minimum_spanning_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-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 @@ -72,6 +72,11 @@ def minimum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) G : cuGraph.Graph or networkx.Graph cuGraph graph descriptor with connectivity information. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + weight : string default to the weights in the graph, if the graph edges do not have a weight attribute a default weight of 1 will be used. @@ -115,6 +120,11 @@ def maximum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) G : cuGraph.Graph or networkx.Graph cuGraph graph descriptor with connectivity information. + .. deprecated:: 24.12 + Accepting a ``networkx.Graph`` is deprecated and will be removed in a + future version. For ``networkx.Graph`` use networkx directly with + the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/ + weight : string default to the weights in the graph, if the graph edges do not have a weight attribute a default weight of 1 will be used. diff --git a/python/cugraph/cugraph/utilities/utils.py b/python/cugraph/cugraph/utilities/utils.py index 69616f26857..5bad68a79e2 100644 --- a/python/cugraph/cugraph/utilities/utils.py +++ b/python/cugraph/cugraph/utilities/utils.py @@ -23,6 +23,7 @@ from cuda.cudart import cudaDeviceAttr from rmm._cuda.gpu import getDeviceAttribute +from warnings import warn # optional dependencies try: @@ -334,6 +335,12 @@ def ensure_cugraph_obj_for_nx( input_type = type(obj) if is_nx_graph_type(input_type): + warn( + "Support for accepting and returning NetworkX objects is " + "deprecated. Please use NetworkX with the nx-cugraph backend", + DeprecationWarning, + 2, + ) return ( convert_from_nx( obj, diff --git a/python/cugraph/pytest.ini b/python/cugraph/pytest.ini index 5cbc4631664..bf6e6bdd802 100644 --- a/python/cugraph/pytest.ini +++ b/python/cugraph/pytest.ini @@ -71,3 +71,4 @@ filterwarnings = # Called via dask. Not obviously addressable in cugraph. ignore:The behavior of array concatenation with empty entries is deprecated:FutureWarning ignore:This method is deprecated and will no longer be supported. The symmetrization:FutureWarning + ignore:Support for accepting and returning NetworkX objects is deprecated. Please use NetworkX with the nx-cugraph backend:DeprecationWarning