AGENT SKILL

objectives-and-training

Choose and wire TorchRL losses, value estimators, target updaters, trainers, Hydra configs, and SOTA recipes.

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

01 前言 Front Matter

name
objectives-and-training
license
MIT
metadata
{ "disco-role": "operating" }
description
Choose and wire TorchRL losses, value estimators, target updaters, trainers, Hydra configs, and SOTA recipes.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

TorchRL objectives and training

Use this sub-skill when a task is about TorchRL objective modules, value estimators, target-network updates, trainer hooks, Hydra algorithm configs, or choosing an algorithm recipe. Typical triggers: ClipPPOLoss, PPOLoss, SACLoss, DQNLoss, DDPGLoss, TD3Loss, IQLLoss, CQLLoss, MAPPOLoss, ValueEstimators, make_value_estimator, set_keys, _AcceptedKeys, SoftUpdate, HardUpdate, Trainer, trainer hooks, config parity, and sota-implementations.

Route before acting

  • Actor, critic, distribution, recurrent-module, and policy-wrapper construction belongs to sibling sub-skill modules-and-policies. Return here after the modules expose the TensorDict keys the loss expects.
  • Collector topology, replay buffers, prioritized samplers, and data movement belong to sibling sub-skill collectors-and-replay. Return here for loss-side priority keys and target updates.
  • Environment specs, action specs, step_mdp, simulator setup, and transforms belong to sibling sub-skill envs-and-transforms.
  • LLM GRPO/SFT/RLHF and VLA-specific serving or dataset workflows belong to sibling sub-skill llm-vla-and-services; this sub-skill only covers generic loss-key and trainer conventions that those workflows share.

Operating sequence

  1. Pick the loss family from loss API reference by algorithm, action space, online/offline setting, and multi-agent layout.
  2. Verify the actor/critic/replay/env dependencies before writing training code: module out_keys, environment action_spec, replay sample keys, and ("next", ...) transition fields must match the loss key map.
  3. Configure TensorDict keys with loss.set_keys(...) using the accepted key names listed in loss API reference. Prefer NestedKey tuples for nested fields.
  4. Build the value estimator with loss.make_value_estimator(ValueEstimators.<name>, ...) or a standalone estimator such as GAE; make sure reward/done/terminated keys are forwarded to the estimator.
  5. Add target-network updaters when the loss has delayed target parameters, and call updater step() at the correct cadence; see training algorithms.
  6. If using TorchRL Trainer, register hooks deliberately and follow config/class parity rules from trainer and configs.
  7. Use SOTA implementation map as a reference-only recipe index. Do not run long SOTA launchers as generic helper scripts.
  8. For failures, start with troubleshooting, then use the bundled inspection helper.

Bundled helper

  • scripts/inspect_loss_keys.py prints a named loss class signature, whether set_keys is available, default configurable TensorDict keys when accessible, and the default value estimator. It performs no training and is safe to run from any current directory.

Verification boundary

The skill content is based on repository source, public reference docs, tutorials, SOTA recipe files, objective tests, trainer/config code, and CPU package/API inspection. Core objective/trainer APIs are CPU-verifiable. CUDA kernels, Triton paths, distributed learner backends, simulator-heavy examples, and long SOTA training are optional or reference-only unless a future task provisions those dependencies explicitly.

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