Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates nx-cugraph README for latest h/w, CUDA, python, NX requirements, moves updater to pre-commit #4225

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -59,3 +59,12 @@ repos:
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
- repo: local
hooks:
- id: nx-cugraph-readme-check
name: nx-cugraph README updater
entry: bash -c PYTHONPATH=./python/nx-cugraph python ./python/nx-cugraph/scripts/update_readme.py ./python/nx-cugraph/README.md
files: ^python/nx-cugraph/
types: [python]
language: python
pass_filenames: false
7 changes: 0 additions & 7 deletions ci/test_python.sh
Expand Up @@ -127,13 +127,6 @@ python -m nx_cugraph.scripts.print_tree --dispatch-name --plc --incomplete --dif
python -m nx_cugraph.scripts.print_table
popd

rapids-logger "ensure nx-cugraph autogenerated files are up to date"
pushd python/nx-cugraph
make || true
git diff --exit-code .
git checkout .
popd

rlratzel marked this conversation as resolved.
Show resolved Hide resolved
rapids-logger "pytest cugraph-service (single GPU)"
./ci/run_cugraph_service_pytests.sh \
--verbose \
Expand Down
20 changes: 14 additions & 6 deletions python/nx-cugraph/README.md
Expand Up @@ -7,11 +7,10 @@ to run supported algorithms with GPU acceleration.
## System Requirements

nx-cugraph requires the following:

* NVIDIA GPU, Pascal architecture or later
* 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, or 12.0
* Python versions 3.9, 3.10, or 3.11
* NetworkX >= version 3.2
* Python version 3.10 or 3.11
rlratzel marked this conversation as resolved.
Show resolved Hide resolved
* NetworkX >= version 3.0 (version 3.2 or higher recommended)

More details about system requirements can be found in the [RAPIDS System Requirements documentation](https://docs.rapids.ai/install#system-req).

Expand All @@ -20,16 +19,25 @@ More details about system requirements can be found in the [RAPIDS System Requir
nx-cugraph can be installed using either conda or pip.

### conda
#### latest nightly version
```
conda install -c rapidsai-nightly -c conda-forge -c nvidia nx-cugraph
```
#### latest stable version
```
conda install -c rapidsai -c conda-forge -c nvidia nx-cugraph
```
### pip
#### latest nightly version
```
python -m pip install nx-cugraph-cu11 --extra-index-url https://pypi.anaconda.org/rapidsai-wheels-nightly/simple
```
#### latest stable version
```
python -m pip install nx-cugraph-cu11 --extra-index-url https://pypi.nvidia.com
```
Notes:

* Nightly wheel builds will not be available until the 23.12 release, therefore the index URL for the stable release version is being used in the pip install command above.
* The pip example above installs for CUDA 11. To install for CUDA 12, replace `-cu11` with `-cu12`
* Additional information relevant to installing any RAPIDS package can be found [here](https://rapids.ai/#quick-start).

## Enabling nx-cugraph
Expand Down
31 changes: 28 additions & 3 deletions python/nx-cugraph/scripts/update_readme.py
Expand Up @@ -16,10 +16,13 @@
import zlib
from collections import namedtuple
from pathlib import Path
import urllib.request
from warnings import warn

from nx_cugraph.scripts.print_tree import create_tree, tree_lines

_objs_file_url = "https://networkx.org/documentation/stable/objects.inv"

# See: https://sphobjinv.readthedocs.io/en/stable/syntax.html
DocObject = namedtuple(
"DocObject",
Expand Down Expand Up @@ -190,14 +193,36 @@ def get_payload_internal(keys):
return text


def find_or_download_objs_file(objs_file_dir):
"""
Returns the path to <objs_file_dir>/objects.inv, downloading it from
_objs_file_url if it does not already exist.
"""
objs_file_path = objs_file_dir / "objects.inv"
if not objs_file_path.exists():
request = urllib.request.Request(_objs_file_url)
with urllib.request.urlopen(request) as response:
with open(objs_file_path, "wb") as out:
out.write(response.read())
return objs_file_path


if __name__ == "__main__":
parser = argparse.ArgumentParser(
"Update README.md to show NetworkX functions implemented by nx-cugraph"
)
parser.add_argument("readme_filename", help="Path to the README.md file")
parser.add_argument(
"networkx_objects", help="Path to the objects.inv file from networkx docs"
"networkx_objects", nargs="?", default=None,
help="Path to the objects.inv file from networkx docs. Optional."
rlratzel marked this conversation as resolved.
Show resolved Hide resolved
)
args = parser.parse_args()
with Path(args.readme_filename).open("a+") as readme_file:
main(readme_file, args.networkx_objects)

readme_filename = args.readme_filename
readme_path = Path(readme_filename)
objects_filename = args.networkx_objects
if objects_filename is None:
objects_filename = find_or_download_objs_file(readme_path.parent)

with readme_path.open("a+") as readme_file:
main(readme_filename, objects_filename)