Skip to content

Commit

Permalink
udpate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jnke2016 committed Aug 30, 2024
2 parents 5294974 + d5154d5 commit d0c163d
Show file tree
Hide file tree
Showing 39 changed files with 986 additions and 346 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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
Expand All @@ -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.3.1
rev: v0.4.0
hooks:
- id: verify-copyright
files: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand All @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies:
- numpy>=1.23,<2.0a0
- numpydoc
- nvcc_linux-64=11.8
- ogb
- openmpi
- packaging>=21
- pandas
Expand Down Expand Up @@ -74,6 +75,7 @@ dependencies:
- sphinxcontrib-websupport
- thriftpy2!=0.5.0,!=0.5.1
- torchdata
- torchmetrics
- ucx-proc=*=gpu
- ucx-py==0.40.*,>=0.0.0a0
- wget
Expand Down
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies:
- numba>=0.57
- numpy>=1.23,<2.0a0
- numpydoc
- ogb
- openmpi
- packaging>=21
- pandas
Expand Down Expand Up @@ -79,6 +80,7 @@ dependencies:
- sphinxcontrib-websupport
- thriftpy2!=0.5.0,!=0.5.1
- torchdata
- torchmetrics
- ucx-proc=*=gpu
- ucx-py==0.40.*,>=0.0.0a0
- wget
Expand Down
4 changes: 1 addition & 3 deletions conda/recipes/nx-cugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions cpp/examples/developers/graph_operations/graph_operations.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<vertex_t, vertex_t, weight_t, int32_t>(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
Expand Down Expand Up @@ -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<result_t> weighted_averages(
size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream());
Expand Down Expand Up @@ -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<result_t> weighted_averages(
size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<vertex_t, vertex_t, weight_t, int32_t>(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
Expand Down
15 changes: 12 additions & 3 deletions cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vertex_t, vertex_t, weight_t, int32_t>(handle,
std::move(d_edge_srcs),
std::move(d_edge_dsts),
Expand Down Expand Up @@ -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<raft::handle_t> handle = initialize_mg_handle();

//
Expand Down Expand Up @@ -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();

Expand All @@ -292,5 +292,14 @@ int main(int argc, char** argv)
run_graph_algorithms<vertex_t, edge_t, weight_t, store_transposed, multi_gpu>(
*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());
}
3 changes: 2 additions & 1 deletion cpp/include/cugraph/graph_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,8 @@ std::tuple<rmm::device_uvector<vertex_t>,
rmm::device_uvector<vertex_t>,
std::optional<rmm::device_uvector<weight_t>>,
std::optional<rmm::device_uvector<edge_t>>,
std::optional<rmm::device_uvector<edge_type_t>>>
std::optional<rmm::device_uvector<edge_type_t>>,
std::vector<size_t>>
shuffle_external_edges(raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& edge_srcs,
rmm::device_uvector<vertex_t>&& edge_dsts,
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ ConfigureTest(SAMPLING_POST_PROCESSING_TEST sampling/sampling_post_processing_te

###################################################################################################
# - NEGATIVE SAMPLING tests --------------------------------------------------------------------
ConfigureTest(NEGATIVE_SAMPLING_TEST sampling/negative_sampling.cpp)
ConfigureTest(NEGATIVE_SAMPLING_TEST sampling/negative_sampling.cpp PERCENT 100)

###################################################################################################
# - Renumber tests --------------------------------------------------------------------------------
Expand Down
8 changes: 3 additions & 5 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,6 @@ dependencies:
specific:
- output_types: [conda]
matrices:
- matrix:
py: "3.9"
packages:
- python=3.9
- matrix:
py: "3.10"
packages:
Expand All @@ -494,7 +490,7 @@ dependencies:
- python=3.11
- matrix:
packages:
- python>=3.9,<3.12
- python>=3.10,<3.12
python_build_rapids:
common:
- output_types: [conda, pyproject, requirements]
Expand Down Expand Up @@ -717,6 +713,8 @@ dependencies:
- &pytorch_unsuffixed pytorch>=2.0,<2.2.0a0
- torchdata
- pydantic
- ogb
- torchmetrics

specific:
- output_types: [requirements]
Expand Down
2 changes: 1 addition & 1 deletion docs/cugraph/source/installation/getting_cugraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ conda install -c rapidsai -c conda-forge -c nvidia cugraph cuda-version=12.0

Alternatively, use `cuda-version=11.8` for packages supporting CUDA 11.

Note: This conda installation only applies to Linux and Python versions 3.9/3.10/3.11.
Note: This conda installation only applies to Linux and Python versions 3.10/3.11.

<br>

Expand Down
5 changes: 2 additions & 3 deletions docs/cugraph/source/installation/source_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ __Compilers:__
* `nvcc` version 11.5+

__CUDA:__
* CUDA 11.2+
* NVIDIA driver 470.42.01 or newer
* CUDA 11.8+
* NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+

Further details and download links for these prerequisites are available on the
Expand Down Expand Up @@ -178,7 +177,7 @@ Run either the C++ or the Python tests with datasets
make test
```

Note: This conda installation only applies to Linux and Python versions 3.8/3.11.
Note: This conda installation only applies to Linux and Python versions 3.10 and 3.11.

### (OPTIONAL) Set environment variable on activation

Expand Down
4 changes: 2 additions & 2 deletions docs/cugraph/source/tutorials/basic_cugraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

CuGraph is part of [Rapids](https://docs.rapids.ai/user-guide) and has the following system requirements:
* 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 or 12.2
* Python version 3.9, 3.10, or 3.11
* CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5
* Python version 3.10 or 3.11
* NetworkX >= version 3.3 or newer in order to use use [NetworkX Configs](https://networkx.org/documentation/stable/reference/backends.html#module-networkx.utils.configs) **This is required for use of nx-cuGraph, [see below](#cugraph-using-networkx-code).**

## Installation
Expand Down
5 changes: 2 additions & 3 deletions docs/cugraph/source/tutorials/cugraph_notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ Running the example in these notebooks requires:
* Download via Docker, Conda (See [__Getting Started__](https://rapids.ai/start.html))

* cuGraph is dependent on the latest version of cuDF. Please install all components of RAPIDS
* Python 3.8+
* A system with an NVIDIA GPU: Pascal architecture or better
* Python 3.10+
* A system with an NVIDIA GPU: Volta architecture or newer
* CUDA 11.4+
* NVIDIA driver 450.51+

## Copyright

Expand Down
5 changes: 2 additions & 3 deletions docs/cugraph/source/wholegraph/installation/source_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ __Compiler__:

__CUDA__:
* CUDA 11.8+
* NVIDIA driver 450.80.02+
* Pascal architecture or better
* Volta architecture or better

You can obtain CUDA from [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads).

Expand Down Expand Up @@ -177,7 +176,7 @@ Run either the C++ or the Python tests with datasets
```
Note: This conda installation only applies to Linux and Python versions 3.8/3.10.
Note: This conda installation only applies to Linux and Python versions 3.10 and 3.11.
## Creating documentation
Expand Down
13 changes: 6 additions & 7 deletions notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,23 @@ Running the example in these notebooks requires:
* Download via Docker, Conda (See [__Getting Started__](https://rapids.ai/start.html))

* cuGraph is dependent on the latest version of cuDF. Please install all components of RAPIDS
* Python 3.8+
* A system with an NVIDIA GPU: Pascal architecture or better
* Python 3.10+
* A system with an NVIDIA GPU: Volta architecture or newer
* CUDA 11.4+
* NVIDIA driver 450.51+

### QuickStart

The easiest way to run the notebooks is to get the latest [rapidsai/notebooks](https://hub.docker.com/r/rapidsai/notebooks) docker image with matching cuda version and run a container based on the image.

For example, get the latest (as of writing the document) nightly image (`a` after the version number indicates that an image is nightly) with cuda 12.0 using
```sh
docker pull rapidsai/notebooks:24.10a-cuda12.0-py3.9
docker pull rapidsai/notebooks:24.10a-cuda12.0-py3.10
```

And, then run a container based on the image using

```sh
docker run --rm -it --pull always --gpus all --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -p 8888:8888 rapidsai/notebooks:24.10a-cuda12.0-py3.9
docker run --rm -it --pull always --gpus all --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -p 8888:8888 rapidsai/notebooks:24.10a-cuda12.0-py3.10
```
You are all set. Run and edit cugraph notebooks from a browser at url
http://127.0.0.1:8888/lab/tree/cugraph/cugraph_benchmarks
Expand All @@ -89,8 +88,8 @@ ssh -L 127.0.0.1:8888:127.0.0.1:8888 [USER_NAME@][REMOTE_HOST_NAME or REMOTE_HO
and then run the container in your remote machine.

```sh
docker pull rapidsai/notebooks:24.10a-cuda12.0-py3.9
docker run --rm -it --pull always --gpus all --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -p 8888:8888 rapidsai/notebooks:24.10a-cuda12.0-py3.9
docker pull rapidsai/notebooks:24.10a-cuda12.0-py3.10
docker run --rm -it --pull always --gpus all --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -p 8888:8888 rapidsai/notebooks:24.10a-cuda12.0-py3.10
```

You can run and edit cugraph notebooks at url http://127.0.0.1:8888/lab/tree/cugraph/cugraph_benchmarks as if they are running locally.
Expand Down
2 changes: 1 addition & 1 deletion notebooks/demo/nx_cugraph_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Using `nx-cugraph` with this notebook requires the following: \n",
"- NVIDIA GPU, Pascal architecture or later\n",
"- CUDA 11.2, 11.4, 11.5, 11.8, or 12.0\n",
"- Python versions 3.9, 3.10, or 3.11\n",
"- Python versions 3.10 or 3.11\n",
"- NetworkX >= version 3.2\n",
" - _NetworkX 3.0 supports dispatching and is compatible with `nx-cugraph`, but this notebook will demonstrate features added in 3.2_\n",
" - At the time of this writing, NetworkX 3.2 is only available from source and can be installed by following the [development version install instructions](https://github.com/networkx/networkx/blob/main/INSTALL.rst#install-the-development-version).\n",
Expand Down
4 changes: 4 additions & 0 deletions python/cugraph-dgl/cugraph_dgl/dataloading/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ def __init__(
self.__graph = graph
self.__device = device

@property
def _batch_size(self):
return self.__batch_size

@property
def dataset(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def sample(

if g.is_homogeneous:
indices = torch.concat(list(indices))
ds.sample_from_nodes(indices, batch_size=batch_size)
ds.sample_from_nodes(indices.long(), batch_size=batch_size)
return HomogeneousSampleReader(
ds.get_reader(), self.output_format, self.edge_dir
)
Expand Down
Loading

0 comments on commit d0c163d

Please sign in to comment.