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
- 参考文档references/loss-api-reference.md13.1 KB
- 参考文档references/sota-implementation-map.md9.4 KB
- 参考文档references/trainer-and-configs.md8.7 KB
- 参考文档references/training-algorithms.md9.3 KB
- 参考文档references/troubleshooting.md9.5 KB
- 脚本scripts/inspect_loss_keys.py6.2 KB
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-skillenvs-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
- Pick the loss family from loss API reference by algorithm, action space, online/offline setting, and multi-agent layout.
- Verify the actor/critic/replay/env dependencies before writing training code: module
out_keys, environmentaction_spec, replay sample keys, and("next", ...)transition fields must match the loss key map. - Configure TensorDict keys with
loss.set_keys(...)using the accepted key names listed in loss API reference. PreferNestedKeytuples for nested fields. - Build the value estimator with
loss.make_value_estimator(ValueEstimators.<name>, ...)or a standalone estimator such asGAE; make sure reward/done/terminated keys are forwarded to the estimator. - Add target-network updaters when the loss has delayed target parameters, and call updater
step()at the correct cadence; see training algorithms. - If using TorchRL
Trainer, register hooks deliberately and follow config/class parity rules from trainer and configs. - Use SOTA implementation map as a reference-only recipe index. Do not run long SOTA launchers as generic helper scripts.
- 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_keysis 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
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).