graph-layers
Construct and troubleshoot the repository's sparse and dense graph layers, dynamic or dilated KNN blocks, GENConv aggregation, and reversible coupling primitives; use this skill for layer-level API and shape questions, not end-to-end dataset workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- graph-layers
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Construct and troubleshoot the repository's sparse and dense graph layers, dynamic or dilated KNN blocks, GENConv aggregation, and reversible coupling primitives; use this skill for layer-level API and shape questions, not end-to-end dataset workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/aggregation-and-blocks.md4.6 KB
- 参考文档references/api-reference.md5.8 KB
- 参考文档references/reversible.md4.6 KB
- 参考文档references/troubleshooting.md5.5 KB
- 脚本scripts/layer_smoke.py5.6 KB
03 SKILL.md 正文
Graph layers
Use this skill for a layer-level design or debugging task. It is a distilled operating guide, not a source-checkout import recipe. Start with the tensor layout and graph representation, choose a static or dynamic layer, then run the small bundled smoke before moving to a real workload.
Route by task
- For ModelNet40, S3DIS, PartNet, point-cloud data loading, task flags, checkpoints, or visualization, hand off to the sibling point-cloud-workflows skill.
- For OGB datasets, DeeperGCN benchmark configurations, graph pooling, partitioning, or RevGNN/RevGAT experiments, hand off to ogb-workflows.
- For PPI data, F1 metrics, and PPI training/evaluation, hand off to ppi-workflows.
- Keep the root skill responsible for installation and broad routing. This skill can identify dependency failures but does not install packages or run long training.
Quick decision procedure
-
Identify layout. Use sparse node features
(N, C)with a PyGedge_index(2, E)and optionalbatch(N,)for independent graphs; use dense point-cloud features(B, C, N, 1)with dense indices(2, B, N, K). Do not pass a dense tensor to sparse layers or flatten a dense batch without preserving graph membership. -
Choose graph construction. Use a supplied
edge_indexwhen topology is fixed. Otherwise useDynConv/DynConv2d, selectingkernel_size K,dilation d, and (for dense layers)knn='matrix'or the compiledtorch_clusterpath. EnsureK*ddoes not exceed points per graph. -
Choose convolution. Sparse
GraphConvsupportsedge,mr,gat,gcn, andginin the inspected implementation.sageandrsageare exposed but are not a supported modern-PyG route; see troubleshooting. DenseGraphConv2dandDynConv2dsupportedgeandmr. -
Choose composition. Plain blocks transform features, residual blocks add a same-width scaled skip, and dense blocks concatenate newly produced channels. Static blocks preserve and return
edge_index; sparse dynamic blocks return(features, batch). -
For generalized aggregation, configure
GENConvand validate the aggregator, temperature/power parameters, edge encoding, and message normalization together. See aggregation and blocks. -
For memory-efficient depth, use a channel-divisible group additive coupling with deterministic per-group functions, then wrap it with the reversible wrapper only after a direct forward/inverse round trip passes. See reversible.
-
Run the safe helper from any working directory:
python /absolute/path/to/graph-layers/scripts/layer_smoke.py --help python /absolute/path/to/graph-layers/scripts/layer_smoke.py --tinyResolve the absolute path in the caller's skill installation; never add a source checkout to
PYTHONPATHfor this helper.
Dependency boundary
The core layer behavior depends on a coherent PyTorch, PyTorch Geometric,
torch-scatter, and torch-cluster installation. The verified inspection
combination was PyTorch 2.11.0+cu128, PyG 2.8.0.post1,
torch-scatter 2.1.2+pt211cu128, and torch-cluster 1.6.3+pt211cu128, with
pip check passing. Treat those versions as evidence, not as a universal pin:
match PyG extension wheels to the installed PyTorch and CUDA/CPU build. A
missing or ABI-incoherent compiled extension is a dependency failure, not a
layer-shape bug. The tiny helper probes these dependencies without importing
repository modules.
Exact benchmark reproduction is intentionally outside this skill. The
repository-era PyG 1.6.3 probe did not import with torch 1.13.1 because of the
removed torch._six.container_abcs; use a coherent historical environment for
old-number reproduction and do not infer benchmark equivalence from the modern
smoke.
References
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).