AGENT SKILL

graph-data

Create, validate, batch, slice, and convert Graph Nets graph data with GraphsTuple, data dictionaries, NumPy arrays, and NetworkX graphs.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
graph-data
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Create, validate, batch, slice, and convert Graph Nets graph data with GraphsTuple, data dictionaries, NumPy arrays, and NetworkX graphs.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Graph Data

Use this sub-skill when a task needs to build or inspect Graph Nets data before it reaches TensorFlow or Sonnet modules. It covers graphs.GraphsTuple, per-graph data dictionaries, NumPy arrays, NetworkX conversion, batching, unbatching, and slicing.

Read first

  • Data formats: field semantics, valid None combinations, batch offsets, data dictionary rules, and NetworkX feature conventions.
  • API reference: exact NumPy conversion and slicing functions, expected inputs/outputs, and common preflight checks.
  • Troubleshooting: fast diagnosis for key-set, endpoint, feature, and NetworkX compatibility failures.
  • Smoke script: deterministic round-trip check that prints JSON and can be run from any working directory.

Typical workflows

  1. Create a GraphsTuple directly when arrays are already in batched form. Provide all seven fields: nodes, edges, receivers, senders, globals, n_node, and n_edge; keep n_node and n_edge non-None.
  2. Create from per-graph data dictionaries when each sample is easier to describe independently. Use utils_np.data_dicts_to_graphs_tuple, and make every dictionary have the same non-None field set.
  3. Create from NetworkX when graph topology is naturally object-based. Use utils_np.networkx_to_data_dict for one graph or utils_np.networkxs_to_graphs_tuple for a batch; enforce ordered integer node keys and the "features" attribute convention.
  4. Round-trip or inspect a batch with utils_np.graphs_tuple_to_data_dicts, utils_np.graphs_tuple_to_networkxs, or utils_np.get_graph.
  5. Use GraphsTuple.replace or GraphsTuple.map for structural-preserving field updates; invalid None combinations still raise immediately.

Boundary routing

  • TensorFlow placeholders, tensor batching, padding, specs, tf.Session handling, and utils_tf workflows belong to tensorflow-ops.
  • Sonnet blocks, graph network modules, learned architecture choices, and model call requirements belong to graph-models.
  • Long notebook-style training recipes belong to the root demo recipes and, for model construction, graph-models.

Minimum preflight checklist

  • Confirm whether the graph is featureful or featureless separately for nodes, edges, and globals.
  • Confirm receivers and senders are both present or both absent; featureless edges still need endpoints.
  • Confirm n_node and n_edge are present for manually constructed GraphsTuple objects and for featureless/empty data dictionaries that cannot infer counts from arrays.
  • When batching, confirm all data dictionaries have identical non-None key sets, including number fields if any dictionary provides them.
  • When using NetworkX, confirm the runtime has networkx.OrderedMultiDiGraph or another compatible networkx<3 graph class accepted by the conversion path.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351