AGENT SKILL

nn-training-workflows

Author and train Jittor models with layers, losses, optimizers, schedulers, and state handling.

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

01 前言 Front Matter

name
nn-training-workflows
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Author and train Jittor models with layers, losses, optimizers, schedulers, and state handling.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

nn-training-workflows

Use this sub-skill for Jittor model authoring, scratch training loops, optimizer and scheduler setup, parameter/state handling, gradient accumulation, and train/eval behavior.

Start here

  • Read references/nn-api-reference.md for the layer, loss, optimizer, scheduler, and init signatures that matter for training.
  • Read references/training-recipes.md for the bounded quadratic-regression recipe, PyTorch-to-Jittor porting map, accumulation order, and save/load pattern.
  • Read references/troubleshooting.md when training fails, loss shapes mismatch, parameters are missing, or state does not reload.
  • Run scripts/training_smoke.py to verify a tiny CPU training loop; it is CPU-safe and network-free by default. Use --help first, then --steps and --assert-loss-drop for a bounded check.

Use when

  • You need to define a model by subclassing Module and implementing execute.
  • You need nn.Linear, nn.Conv, nn.BatchNorm, nn.Dropout, nn.Sequential, or recurrent layers for a training graph.
  • You need nn.SGD, nn.Adam, nn.AdamW, nn.RMSprop, nn.Adan, Optimizer.step, backward, zero_grad, gradient clipping, or a learning-rate scheduler.
  • You need state_dict, load_state_dict, save, load, or checkpoint conversion between Jittor and PyTorch-style state bundles.
  • You need a bounded recipe for accumulation, clipping, or mode switching.

Do not use for

  • Raw Var or autograd fundamentals.
  • Dataset, dataloader, model-zoo, or checkpoint-download workflows.
  • Backend flags, compiler setup, or runtime/performance tuning.

Operating rules

  • Implement execute, not forward.
  • Call model.train() before training and model.eval() before validation or inference.
  • Use optimizer.step(loss) for the simple case, or optimizer.backward(loss) plus optimizer.step() when you need accumulation.
  • Keep non-trainable state in buffers, not in hidden Python containers.
  • Treat state_dict shape and name mismatches as a load-time issue to inspect, not something to ignore silently.

Fast path

  1. Confirm the model exposes parameters.
  2. Pick the loss whose shape contract matches the target.
  3. Choose an optimizer and, if needed, a scheduler.
  4. Verify with scripts/training_smoke.py.
  5. If the loop is unstable, open the troubleshooting reference before changing the architecture.

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