off-policy-continuous-control
Route and operate the repo's DDPG, SAC, TD3 continuous-action workflows, checkpoint playback, Gym compatibility, action scaling, and backend troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- off-policy-continuous-control
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route and operate the repo's DDPG, SAC, TD3 continuous-action workflows, checkpoint playback, Gym compatibility, action scaling, and backend troubleshooting.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/checkpoint-playback.md4.0 KB
- 参考文档references/troubleshooting.md4.9 KB
- 参考文档references/workflow-guide.md6.3 KB
- 脚本scripts/continuous_control_compat_report.py10.3 KB
03 SKILL.md 正文
Off-Policy Continuous Control
Use this sub-skill when the task is about this repository's continuous-action, off-policy examples: DDPG, SAC, TD3, saved-policy playback, normalized continuous actions, Pendulum, or BipedalWalker.
Do not use this sub-skill for tabular control, DQN/discrete value control, or on-policy actor-critic/PPO/A2C requests. Route those to sibling sub-skills such as ../tabular-control/, ../value-based-discrete-control/, or ../on-policy-actor-critic/ when available.
First-read references
- Read
references/workflow-guide.mdto choose between DDPG, SAC, SAC dual-Q, SAC BipedalWalker, TD3, and TD3 BipedalWalker variants. - Read
references/checkpoint-playback.mdbefore any--mode test, saved checkpoint, or model-load task. - Read
references/troubleshooting.mdwhenever the request mentions CUDA/CPU selection, action bounds, checkpoint paths, Gym deprecations, Box2D, pygame, rendering, or NumPy compatibility. - Use
scripts/continuous_control_compat_report.pyfor a local, non-training compatibility report on torch device availability, Gym env IDs, Box2D/pygame readiness, and continuous-action bounds.
Routing by user request
| Request signal | Best route | Key cautions |
|---|---|---|
| "run DDPG on Pendulum" | DDPG workflow in references/workflow-guide.md |
Modern Gym uses Pendulum-v1, while repo defaults name Pendulum-v0; training is long-running and checkpoint path changes with env id. |
| "train SAC" / "compare SAC variants" | SAC workflow table | SAC.py is single-Q Pendulum-only and has a broken load method; dual-Q scripts are closer to the later SAC variants. |
| "test a SAC checkpoint" | references/checkpoint-playback.md |
Requires a matching SAC_model/ directory and the same env/action dimensionality used at training time. |
| "compare SAC vs TD3" | Compare references/workflow-guide.md algorithm rows |
TD3 uses direct bounded actions; SAC scripts wrap actions through a normalized action wrapper that needs a modern Gym patch. |
| "BipedalWalker compatibility" | BipedalWalker notes in both references | Prefer BipedalWalker-v3; verify Box2D and pygame before running render or checkpoint playback. |
| "CartPole, MountainCar DQN, Q-learning" | Different sub-skill | Those are discrete or tabular workflows, not this continuous-control owner. |
Operating rules
- Treat the original training scripts as reference-backed workflows, not safe bundled trainers. They run large episode counts by default, may render, save under relative experiment directories, and assume old Gym APIs.
- Before suggesting a run command, decide whether the caller wants inspection, bounded smoke, training, or checkpoint playback. Ask for a time/episode budget before launching training-scale loops.
- Modernize legacy environment IDs unless the caller explicitly pins an old Gym stack:
Pendulum-v0->Pendulum-v1BipedalWalker-v2->BipedalWalker-v3
- Keep continuous actions in the environment's Box bounds. DDPG/TD3 actors output
tanh * max_action; SAC variants sample normalized actions in[-1, 1]and rely on an action wrapper to map to environment bounds. - Do not assume a checkpoint exists. Explain expected filenames and relative directory conventions before playback.
- Prefer CPU-compatible guidance unless the user requests CUDA performance. The scripts choose
cudawhentorch.cuda.is_available()is true; see troubleshooting for how to force or debug device behavior.
Safe helper
From this sub-skill directory, run:
python scripts/continuous_control_compat_report.py --env Pendulum-v1 --env BipedalWalker-v3
Use --step only for a tiny random-action step smoke. The helper does not train, read checkpoints, or require the original source checkout.
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).