Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into branch-24.12-ci-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-rliu authored Nov 1, 2024
2 parents 4919a5a + 3b062b9 commit 712ca19
Show file tree
Hide file tree
Showing 66 changed files with 196 additions and 1,936 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ per-file-ignores =
__init__.py:F401,F403,
_nx_cugraph/__init__.py:E501,
nx_cugraph/__init__.py:E402,F401,F403,
benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py:E501,W605,
docs/nx-cugraph/source/conf.py:E501
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ python/ @rapidsai/nx-cugraph-python-codeowners
/.pre-commit-config.yaml @rapidsai/ci-codeowners

#packaging code owners
# /.devcontainer/ @rapidsai/packaging-codeowners
/.devcontainer/ @rapidsai/packaging-codeowners
/conda/ @rapidsai/packaging-codeowners
/dependencies.yaml @rapidsai/packaging-codeowners
/build.sh @rapidsai/packaging-codeowners
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body:
attributes:
label: Version
description: What version of nx-cugraph are you running?
placeholder: "example: 22.12"
placeholder: "example: 24.12"
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ body:
attributes:
label: Describe any alternatives you have considered
description: List any other libraries, or approaches you have looked at or tried.
placeholder: I have looked at library xyz and qrs, but they do not offer GPU accleration
placeholder: I have looked at library xyz and qrs, but they do not offer GPU acceleration

- type: textarea
id: misc
Expand Down
2 changes: 1 addition & 1 deletion .github/ops-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ auto_merger: true
branch_checker: true
label_checker: true
release_drafter: true
recently_updated: false
forward_merger: true
recently_updated: true
39 changes: 16 additions & 23 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
needs:
- changed-files
- checks
- conda-notebook-tests
- conda-python-build
- wheel-build-nx-cugraph
- conda-notebook-tests
- conda-python-tests
- docs-build
secrets: inherit
Expand All @@ -30,27 +31,16 @@ jobs:
files_yaml: |
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/[email protected]
with:
enable_check_generated_files: false
conda-python-build:
needs: checks
secrets: inherit
Expand All @@ -69,19 +59,22 @@ jobs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks
with:
enable_check_generated_files: false
conda-python-build:
needs: [checks]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10"
run_script: "ci/test_notebooks.sh"
docs-build:
needs: conda-python-build
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
wheel-build-nx-cugraph:
needs: [checks]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job[email protected]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build[email protected]
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10"
run_script: "ci/build_docs.sh"
script: ci/build_wheel_nx-cugraph.sh
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
75 changes: 57 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,92 @@
## https://pre-commit.com/
#
# Before first use: `pre-commit install`
# To run: `pre-commit run --all-files`
# To run: `make lint`
# To update: `make lint-update`
# - &flake8_dependencies below needs updated manually
exclude: '^thirdparty'
fail_fast: false
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-ast
- id: check-toml
- id: check-yaml
exclude: '^conda/recipes/.*\.yaml$'
- id: debug-statements
- id: end-of-file-fixer
exclude_types: [svg]
- id: mixed-line-ending
- id: no-commit-to-branch
args: [-p, "^branch-2....$"]
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ["--config=.flake8"]
files: nx_cugraph.*$
types: [file]
types_or: [python] # TODO: Enable [python, cython]
additional_dependencies: ["flake8-force"]
args: ["--config=.flake8"] # uses config
additional_dependencies: &flake8_dependencies
# These versions need updated manually
- flake8==7.1.1
- flake8-bugbear==24.8.19
- flake8-simplify==0.21.0
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies:
- flake8==7.1.1
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
additional_dependencies: *flake8_dependencies
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.19
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: [--in-place]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: clang-format
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- id: codespell
types_or: [python, rst, markdown]
additional_dependencies: [tomli]
files: ^(nx_cugraph|docs)/
args: ["-L thirdparty,coo,COO,numer"]
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.4.0
hooks:
- id: verify-copyright
files: |
(?x)
[.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$|
CMakeLists[.]txt$|
CMakeLists_standalone[.]txt$|
[.](sh|py)$|
[.]flake8[.]cython$|
meta[.]yaml$|
setup[.]cfg$
- id: verify-alpha-spec
args: ["--fix"]
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.13.11
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
SHELL= /bin/bash

.PHONY: all
all: plugin-info lint readme

.PHONY: lint
lint:
git ls-files | xargs pre-commit run --config lint.yaml --files || true

.PHONY: lint-update
lint-update:
pre-commit autoupdate --config lint.yaml
all: plugin-info readme

.PHONY: plugin-info
plugin-info:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ to run supported algorithms with GPU acceleration.

nx-cugraph requires the following:
* NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+
* CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5
* CUDA 11.4-11.8 or 12.0-12.5
* Python version 3.10, 3.11, or 3.12
* NetworkX >= version 3.0 (version 3.2 or higher recommended)

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/nx-cugraph/pytest-based/bench_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import random

import networkx as nx
import pandas as pd
import pytest
from cugraph import datasets

import nx_cugraph as nxcg

# Attempt to import the NetworkX dispatching module, which is only needed when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# limitations under the License.


import re
import pathlib
import json
import pathlib
import platform
import psutil
import re
import socket
import subprocess

import psutil


def get_formatted_time_value(time):
res = ""
if time < 1:
if time < 0.001:
units = "us"
Expand All @@ -40,7 +40,8 @@ def get_all_benchmark_info():
# Populate benchmarks dir from .json files
for json_file in logs_dir.glob("*.json"):
try:
data = json.loads(open(json_file).read())
with open(json_file) as file:
data = json.loads(file.read())
except json.decoder.JSONDecodeError:
continue

Expand Down Expand Up @@ -155,8 +156,8 @@ def get_system_info():
if __name__ == "__main__":
logs_dir = pathlib.Path("logs")

dataset_patt = re.compile(".*ds=([\w-]+).*")
backend_patt = re.compile(".*backend=(\w+).*")
dataset_patt = re.compile(r".*ds=([\w-]+).*")
backend_patt = re.compile(r".*backend=(\w+).*")
k_patt = re.compile(".*k=(10*).*")

# Organize all benchmark runs by the following hierarchy: algo -> backend -> dataset
Expand Down Expand Up @@ -266,7 +267,7 @@ def get_system_info():
f" <td>{nx_formatted} / {cg_formatted}<br>{speedup}<br>{runtime_delta}</td>"
)
else:
print(f" <td></td>")
print(" <td></td>")

# If a comparison between cugraph and NX cannot be made, output empty cells
# for each dataset
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
Positional Arguments:
1) dataset name (e.g. 'email_Eu_core', 'cit-patents')
available datasets can be found here: `python/cugraph/cugraph/datasets/__init__.py`
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("-", "_")
Expand Down
17 changes: 0 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ VALIDARGS="
-g
-n
--pydevelop
--allgpuarch
--clean
-h
--help
Expand All @@ -49,7 +48,6 @@ HELP="$0 [<target> ...] [<flag> ...]
-g - build for debug
-n - do not install after a successful build (does not affect Python packages)
--pydevelop - install the Python packages in editable mode
--allgpuarch - build for all supported GPU architectures
--clean - clean an individual target (note: to do a complete rebuild, use the clean target described above)
-h - print this text
Expand Down Expand Up @@ -107,27 +105,12 @@ fi
if hasArg -n; then
INSTALL_TARGET=""
fi
if hasArg --allgpuarch; then
BUILD_ALL_GPU_ARCH=1
fi
if hasArg --pydevelop; then
PYTHON_ARGS_FOR_INSTALL="${PYTHON_ARGS_FOR_INSTALL} -e"
fi

# If clean or uninstall targets given, run them prior to any other steps
if hasArg uninstall; then
# TODO: can lines 119-128 be removed since this is just a Python project?
if [[ "$INSTALL_PREFIX" != "" ]]; then
rm -rf ${INSTALL_PREFIX}/include/cugraph
rm -f ${INSTALL_PREFIX}/lib/libcugraph.so
rm -rf ${INSTALL_PREFIX}/include/cugraph_c
rm -f ${INSTALL_PREFIX}/lib/libcugraph_c.so
rm -rf ${INSTALL_PREFIX}/include/cugraph_etl
rm -f ${INSTALL_PREFIX}/lib/libcugraph_etl.so
rm -rf ${INSTALL_PREFIX}/lib/cmake/cugraph
rm -rf ${INSTALL_PREFIX}/lib/cmake/cugraph_etl
fi
# uninstall nx-cugraph
# 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.
Expand Down
Loading

0 comments on commit 712ca19

Please sign in to comment.