Metadata-Version: 2.2
Name: cugraph-dgl
Version: 25.2.0
Summary: cugraph extensions for DGL
Author: NVIDIA Corporation
License: Apache 2.0
Project-URL: Homepage, https://github.com/rapidsai/cugraph
Project-URL: Documentation, https://docs.rapids.ai/api/cugraph/stable/
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cugraph==25.2.*
Requires-Dist: numba>=0.57
Requires-Dist: numpy<3.0a0,>=1.23
Provides-Extra: test
Requires-Dist: pylibwholegraph==25.2.*; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-benchmark; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: tensordict>=0.1.2; extra == "test"
Requires-Dist: torch>=2.3; extra == "test"

# cugraph_dgl

## Description

[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data.  Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection.

## Conda

Install and update cugraph-dgl and the required dependencies using the command:

```
# CUDA 11
conda install -c rapidsai -c pytorch -c conda-forge -c nvidia -c dglteam/label/th23_cu118 cugraph-dgl

# CUDA 12
conda install -c rapidsai -c pytorch -c conda-forge -c nvidia -c dglteam/label/th23_cu121 cugraph-dgl
```

## Build from Source

### Create the conda development environment
```
mamba env create -n cugraph_dgl_dev --file conda/cugraph_dgl_dev_11.6.yml
```

### Install  in editable mode
```
pip install -e .
```

### Run tests

```
pytest tests/*
```


## Usage
```diff

+from cugraph_dgl.convert import cugraph_storage_from_heterograph
+cugraph_g = cugraph_storage_from_heterograph(dgl_g)

sampler = dgl.dataloading.NeighborSampler(
        [15, 10, 5], prefetch_node_feats=['feat'], prefetch_labels=['label'])

train_dataloader = dgl.dataloading.DataLoader(
- dgl_g,
+ cugraph_g,
train_idx,
sampler,
device=device,
batch_size=1024,
shuffle=True,
drop_last=False,
num_workers=0)
```
