dgl
Route DGL graph learning tasks across graph APIs, datasets, message passing, GraphBolt, distributed tools, and DGL-Go workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- dgl
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route DGL graph learning tasks across graph APIs, datasets, message passing, GraphBolt, distributed tools, and DGL-Go workflows.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/install-and-build.md5.2 KB
- 参考文档references/repo-development.md3.8 KB
- 参考文档references/repo-provenance.md2.3 KB
- 参考文档references/repo-routing-metadata.json393 B
- 参考文档references/troubleshooting.md4.7 KB
- 脚本scripts/check_dgl_environment.py4.9 KB
03 SKILL.md 正文
DGL Repo Skill
Use this repo skill when a task names DGL, Deep Graph Library, DGLGraph, GraphBolt, DGL-Go, DGL sparse, DGL distributed training, or graph neural network workflows implemented with DGL.
Quick Start
Install a public DGL package that matches the target backend and Python version, then verify imports before using deeper workflows:
python -m pip install dgl
python - <<'PY'
import dgl
print(dgl.__version__)
print(dgl.graph(([0, 1], [1, 2]), num_nodes=3))
PY
For PyTorch workflows that use GraphBolt, keep the installed torch version compatible with the DGL wheel's bundled GraphBolt library. If import dgl reports a missing libgraphbolt_pytorch_<version> file, read references/troubleshooting.md.
Route By Task
- Use graph-apis for
dgl.graph,dgl.heterograph, canonical etypes, features, transforms, batching, subgraphs,to_block, and graph-level smoke checks. - Use datasets-and-io for
DGLDataset,CSVDataset,meta.yaml, graph save/load, dataset caches, download/cache environment variables, and CSV/OnDiskDataset handoffs. - Use message-passing-training for
update_all,dgl.function, PyTorch GNN layers, full-graph training loops, heterograph modules, readout, anddgl.sparse. - Use dataloading-graphbolt for stochastic minibatch sampling,
dgl.dataloading.DataLoader,NeighborSampler, GraphBoltItemSet/ItemSampler, feature fetching, OnDiskDataset, GPU sampling, and UVA decisions. - Use distributed-tools for partition configs,
DistGraph,DistDataLoader,node_split,edge_split,ip_config.txt, dry launch-command construction, and safe distributed preflight. - Use dglgo-cli for DGL-Go
configure,recipe,train,export,configure-apply,apply, YAML config linting, and recipe/custom CSV workflows.
Shared References And Scripts
- Read references/install-and-build.md before source builds, backend selection, DGL-Go installs, or native library troubleshooting.
- Read references/troubleshooting.md for cross-cutting import, backend, GraphBolt, sparse, dataset cache, and build failures.
- Read references/repo-development.md when editing the DGL repository itself or selecting focused native tests.
- Read references/repo-provenance.md before deciding whether this skill is stale for a checkout.
- Run
python scripts/check_dgl_environment.pyfor a safe import/backend/native-library diagnostic.
Routing Rules
- If the user asks for a DGL data folder or
meta.yaml, route todatasets-and-iobefore any model or dataloader work. - If the user asks for blocks, sampled minibatches, GraphBolt, or UVA, route to
dataloading-graphbolt; then route modelforward()details tomessage-passing-training. - If the user asks for a cluster, partition JSON,
ip_config.txt, orDistGraph, route todistributed-toolsand do not run SSH/cluster launchers without explicit approval. - If the user asks for a ready-to-run CLI experiment or YAML recipe, route to
dglgo-cli; usedatasets-and-iofor custom CSV data validation andmessage-passing-trainingfor exported script edits. - If the request is only about constructing or debugging graph objects, stay in
graph-apisand avoid training or dataset assumptions.
Safety Defaults
- Prefer CPU-safe synthetic smoke checks unless the user explicitly requests CUDA, distributed execution, downloads, or long training.
- Treat source builds and distributed launches as environment-mutating or side-effectful; summarize prerequisites and ask before broad builds, SSH, multi-host processes, or data dispatch.
- Do not rely on original DGL checkout docs, examples, tests, or tools at runtime. Use this skill's bundled references and scripts.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).