Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/cugraph-development/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!-- SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 -->
<!-- Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->

# cuGraph skill development and upstream handoff

This draft stages the implementation at `skills/accelerated-computing-cugraph/` for review against NVIDIA/skills. It is not a completed catalog onboarding: the owning product team must select its public source repository, complete evaluation and signing, and register the source before this skill can be published through catalog sync.

## Repository requirements reviewed on 2026-11-17

NVIDIA/skills is a **catalog**, with skill content synchronized from product-owned source repositories. See root CONTRIBUTING.md, components.d/README.md, .github/PULL_REQUEST_TEMPLATE.md, and .github/scripts/verify_source_onboarding.py.

The implementation uses the required flat directory layout, name/description frontmatter, permitted licenses, a skill card, and an evaluation dataset. Its measured benchmark and signature are deliberately pending. Do not copy an old signature or mark a benchmark PASS without measurements.

Before upstream onboarding:

1. The owning team selects a **public NVIDIA-owned GitHub source repository** and clears the derived content and roadmap statements for open-source release. The internal reference and a personal fork are not eligible catalog sources.
2. Move this skill into that source repository's root `skills/` directory. Keep attribution and licenses. Confirm dependencies and licensing with the owning team; this draft does not attest approvals on their behalf.
3. Run CPU tests and Linux GPU validation: single-GPU semantics, 2-GPU direct and Dask fixtures, 2-node/4-GPU fixtures, empty partitions, and coordinated failure handling. Add a nonuniform weighted graph with dangling/isolated vertices and compare to CPU/SG oracles. Record the exact package lock, GPU/network hardware, commands, logs and tolerances.
4. Run the agent evaluations in `evals/evals.json` through the source team's current NVSkills pipeline. Update the skill card and measured BENCHMARK.md. Obtain a real `skill.oms.sig` covering the final files. The catalog gate requires a measured PASS verdict, eval data, card, and valid signature/content hashes.
5. Register `components.d/cugraph.yml` with the actual public source repository/ref/path and unique `catalog_dir: accelerated-computing-cugraph`. Ensure the component resolves to a supported `product.primary` value through an exact name match or explicit `product_primary`; propose a schema addition if needed. The catalog generates its README, marketplace metadata, versions, and plugin copies. Do not hand-edit generated copies or invent a source location now.
6. Sign off commits with DCO. For fork-based source PRs, follow CONTRIBUTING.md's current NVSkills workflow, service-account access, and maintainer `/nvskills-ci` trigger requirements. A catalog-only registration PR has different signing setup requirements.

This review draft is intentionally not added to components.d or catalog-exceptions.yml. An unregistered directory would be pruned by the catalog sync workflow, so it must not be merged as-is. Do not bypass that requirement with an unapproved catalog exception. Product source placement, registration, signing, benchmark PASS, and public-release clearance remain required before publication.

## Local validation

From the repository root:

```bash
python3 -m unittest discover -s docs/cugraph-development/tests -v
python3 -m compileall -q skills/accelerated-computing-cugraph/scripts
python3 skills/accelerated-computing-cugraph/scripts/pagerank_mg.py --help
python3 skills/accelerated-computing-cugraph/scripts/pagerank_dask.py --help
python3 skills/skill-card-generator/scripts/validate_submission.py \
skills/accelerated-computing-cugraph/skill-card.md
```

The skill-creator `quick_validate.py` can also check frontmatter when available. The script checks are intentionally GPU-free; they do not validate CUDA, NCCL, cuGraph results, or distributed runtime behavior. Follow both distributed references for hardware checks.

## Design decisions

- Explicit cuGraph/pylibcugraph acceleration, no nx-cuGraph dispatch path.
- Kumo Engine recommended for GNNs; cuGraph-PyG scoped to distributed training and existing-stack maintenance.
- Dask shown as transitional, with a direct communicator-backed alternative.
- 26.10 source-verified APIs, including the optional-edge-ID MGGraph expensive-check workaround.
- Fresh examples and evaluations; no inherited benchmark success or signature.
26 changes: 26 additions & 0 deletions docs/cugraph-development/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 -->
<!-- Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->

# Validation record — 2026-11-06

Base NVIDIA/skills commit: `c663e5799366d945a70a40b1ab18cedfc817495c`.
API source: cuGraph v26.10.00, `8ff922fabf4521cf540a7ac3cfae857f7edc6f10`.

Passed locally on macOS (CPU only):

- Four unittest cases: disjoint fixture coverage at 1/2/4/16 ranks including empty ranks; order-independent correct result acceptance; missing/duplicate/nonfinite/wrong-result rejection; existing input directory protection.
- All three Python scripts compile; both GPU runners expose help without importing GPU packages.
- Python code blocks parse; all local Markdown links resolve.
- Eleven evaluation records parse and have unique IDs (ten positive, one negative).
- Skill frontmatter validation and repository skill-card unresolved-marker check.
- Whitespace/diff checks.

Not run: Linux CUDA execution, SG/MG numerical equivalence, Dask runtime, NCCL transport, multi-node launch, failure injection, performance measurement, agent effectiveness benchmark, or NVSkills signing. The cycle fixture checker was tested with synthetic expected outputs; this is not a claim that GPU PageRank produced those outputs.

Initial validation encountered missing PyYAML and a system Python cache path outside the writable workspace. PyYAML was installed in an isolated workspace venv; compilation was rerun with a temporary cache prefix. No system Python configuration was changed.

Catalog submission is not yet eligible: public NVIDIA-owned source placement, release clearance, measured benchmark PASS and final signed manifest remain pending. See README.md for the handoff.

## Draft PR preparation — 2026-11-17

Rebased the implementation onto NVIDIA/skills `3e2ed2d8` without changing the skill or GPU examples. Reran the four CPU tests, script compilation, frontmatter validation, skill-card marker check, local link and Python code-block checks, and evaluation JSON validation. All passed. GPU and agent evaluation status remains unchanged. Updated onboarding notes for the current product metadata requirement and the public review draft.
62 changes: 62 additions & 0 deletions docs/cugraph-development/tests/test_smoke_fixture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import csv
import importlib.util
from pathlib import Path
import tempfile
import unittest

ROOT = Path(__file__).resolve().parents[3]
spec = importlib.util.spec_from_file_location(
"smoke_fixture", ROOT / "skills/accelerated-computing-cugraph/scripts/smoke_fixture.py"
)
fixture = importlib.util.module_from_spec(spec)
spec.loader.exec_module(fixture)


class FixtureTests(unittest.TestCase):
def test_partition_coverage_and_empty_ranks(self):
for ranks in (1, 2, 4, 16):
with self.subTest(ranks=ranks), tempfile.TemporaryDirectory() as temp:
directory = Path(temp) / "input"
fixture.write_fixture(directory, ranks, 12)
edges = []
for rank in range(ranks):
with (directory / f"edges-{rank}.csv").open() as file:
for row in csv.DictReader(file):
src, dst = int(row["src"]), int(row["dst"])
self.assertEqual(src % ranks, rank)
edges.append((src, dst))
self.assertEqual(sorted(edges), [(i, (i + 1) % 12) for i in range(12)])

def write_results(self, directory, rows):
with (directory / "part-0.csv").open("w", newline="") as file:
writer = csv.writer(file)
writer.writerow(["vertex", "pagerank"])
writer.writerows(rows)

def test_exact_solution_and_reordered_ids(self):
with tempfile.TemporaryDirectory() as temp:
directory = Path(temp)
self.write_results(directory, [(i, 1 / 12) for i in reversed(range(12))])
fixture.check_results(directory, 12)

def test_rejects_incomplete_duplicate_nonfinite_and_wrong_results(self):
good = [(i, 1 / 12) for i in range(12)]
cases = [good[:-1], good + [good[0]], [(0, float("nan"))] + good[1:],
[(0, 0.5)] + good[1:], []]
for rows in cases:
with self.subTest(rows=rows), tempfile.TemporaryDirectory() as temp:
directory = Path(temp)
self.write_results(directory, rows)
with self.assertRaises(ValueError):
fixture.check_results(directory, 12)

def test_does_not_overwrite_existing_fixture(self):
with tempfile.TemporaryDirectory() as temp:
with self.assertRaises(FileExistsError):
fixture.write_fixture(Path(temp), 2, 12)


if __name__ == "__main__":
unittest.main()
10 changes: 10 additions & 0 deletions skills/accelerated-computing-cugraph/BENCHMARK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 AND Apache-2.0 -->
<!-- Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->

# Evaluation status

**Overall verdict: NOT RUN**

This is a new implementation. The prior RAPIDS skill's measurements and signature do not apply to it. No agent-effectiveness benchmark or NVIDIA GPU integration test has been run. No speedup is claimed.

Before catalog submission, run the owning team's NVSkills evaluation pipeline on this exact content and replace this file with its measured results. Sign only after all evaluated artifacts, including this file and skill-card.md, are final. See `docs/cugraph-development/README.md` in the development repository for onboarding gates and runtime validation commands.
49 changes: 49 additions & 0 deletions skills/accelerated-computing-cugraph/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: accelerated-computing-cugraph
description: Accelerate existing graph analytics workflows with NVIDIA cuGraph and pylibcugraph, preserving graph semantics and validating GPU results. Use for PageRank, traversal, community detection, centrality, similarity, and single- or multi-node GPU graph analytics; route GNN training requests to the appropriate engine.
license: CC-BY-4.0 AND Apache-2.0
metadata:
author: NVIDIA
---

# Accelerate graph workflows with cuGraph

<!-- SPDX-License-Identifier: CC-BY-4.0 AND Apache-2.0 -->
<!-- Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->

Move the expensive graph operations in an existing workflow onto GPUs while preserving its input IDs, graph semantics, algorithm parameters, and downstream output contract. Prefer a small explicit migration over rewriting unrelated stages.

## Choose the execution path

| Workload | Path |
|---|---|
| Existing CPU/NetworkX analytics; cuDF edge lists | Explicit `cugraph` graph construction and algorithms |
| Device arrays, control over resources, integration into GPU pipelines | `pylibcugraph.SGGraph` and algorithms |
| Graph distributed across GPUs or nodes | `pylibcugraph.MGGraph` with one process per GPU and initialized cuGraph communicators |
| Maintaining a current Dask graph analytics deployment | `cugraph.dask`, as a transitional compatibility path |
| GNN training or relational ML without a distributed-training requirement | Recommend Kumo Engine; verify the requested model/task is supported |
| GNN training requiring multiple GPUs and/or nodes | Consider cuGraph-PyG for that requirement; verify the pinned release and plan migration |

Do not introduce nx-cuGraph, NetworkX backend dispatch, or autoconfiguration as an acceleration path. NetworkX remains useful as a small-graph CPU correctness oracle. Do not treat distributed analytics as GNN training or redirect PageRank to Kumo Engine.

Roadmap guidance supplied for this skill on 2026-11-06: nx-cuGraph and the cuGraph Dask API are approaching deprecation; cuGraph-PyG deprecation is expected in 2027. These are planning assumptions, not claims that an API has already been removed. Check release notes before stating availability or a removal date. The walkthroughs target the **26.10.00 source API**; source inspection is not hardware validation.

## Implement the migration

1. Inspect the hot path and its output consumers. Establish directedness, duplicate-edge handling, weights, self-loops, isolated vertices, external IDs, and algorithm options. Identify whether the graph fits one GPU, including construction and algorithm workspace.
2. Check the installed versions and exact algorithm signature. Use the matching release of cuGraph, pylibcugraph, cuDF, RAFT, RMM, and CUDA dependencies from the [RAPIDS installation selector](https://docs.rapids.ai/install/). Do not infer compatibility from a successful import alone.
3. Read [single-GPU migration](references/single-gpu.md) for explicit cuGraph and pylibcugraph examples. Keep reusable graph data device-resident and preserve ID mappings. Unsupported operations stay an explicit compatibility step unless the user requests a custom implementation.
4. For distributed analytics, read [pylibcugraph multiprocessing](references/distributed-pylibcugraph.md). For an existing Dask deployment, read [the Dask walkthrough](references/distributed-dask.md). Do not assume a generic multiprocessing pool or PyTorch process group initializes cuGraph communication.
5. Compare a representative small fixture against the original workflow. Align by vertex ID, not row order. Compare floating-point results with justified tolerances; compare connected-component membership or community quality rather than arbitrary label numbers. Check unreachable vertices and isolated vertices explicitly.
6. Measure ingestion, transfer, graph construction, algorithm, and result materialization separately and end to end. Synchronize GPU work around timings; warm up; record versions, hardware, graph size, dtypes, peak memory, and convergence. Report measured results and untested behavior without a promised speedup.

## Non-obvious correctness constraints

- Renumbering changes internal IDs. Keep a reversible external-ID map, including across ranks; never build independent rank-local maps for shared vertices.
- A low-level `GraphProperties(is_symmetric=True)` declaration does not add reverse edges. Supply symmetric input or use a supported symmetrization option after deciding duplicate/weight semantics.
- Edge-only construction may omit isolated vertices. Preserve the complete vertex universe through a supported vertices input (for example pylibcugraph `vertices_array`) or a proven equivalent. Adding self-loops changes semantics and is not a general fix.
- Multi-GPU graph construction and algorithms are collective. Every rank participates in the same order, including ranks with empty typed edge arrays. Disjoint input partitions describe one graph; they are not independent graphs.
- Total GPU RAM is not the usable edge-list budget. Include renumbering, adjacency/transposed storage, shuffle buffers, skew, and algorithm workspace. Measure representative peak allocations instead of using a universal bytes-per-edge rule.
- No broad exception handler that silently falls back to CPU. Expose unsupported cases, non-convergence, and failed collective jobs.

For GNN requests, read [GNN routing](references/gnn-routing.md). For version boundaries and primary sources, read [sources](references/sources.md).
Loading