on-policy-actor-critic
Router for REINFORCE, baseline, actor-critic, A2C, and PPO workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- on-policy-actor-critic
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Router for REINFORCE, baseline, actor-critic, A2C, and PPO workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/troubleshooting.md5.5 KB
- 参考文档references/workflows.md7.2 KB
- 脚本scripts/multiprocessing_env.py5.4 KB
- 脚本scripts/playback_saved_policy.py7.1 KB
03 SKILL.md 正文
On-policy Actor-Critic
Use this sub-skill for the repo's on-policy classic-control workflows in Char02, Char03, Char04, and Char07.
Route here when the task says
- "run REINFORCE on CartPole"
- "compare baseline vs no-baseline"
- "inspect actor-critic updates"
- "use the A2C multiprocessing helper"
- "inspect PPO clipping"
- "play back a saved policy"
Keep this route focused on
- REINFORCE and policy-gradient baselines in Char02.
- Actor-critic variants in Char03.
- A2C with
SubprocVecEnvin Char04. - PPO on CartPole, MountainCar, and Pendulum in Char07.
- Playback of saved policy pickles from the on-policy family.
Do not use this route for
- Tabular control or GridWorld toy examples — route to the tabular-control route.
- DQN or other value-based discrete control — route to the value-based-discrete-control route.
- Off-policy continuous-control families such as DDPG, SAC, or TD3 — route to the off-policy continuous-control route.
- Standalone plotting or results aggregation.
Read first
references/workflows.mdfor the algorithm comparison, checkpoint map, and the exact source-script roles.references/troubleshooting.mdforenv.seed, old Gym step signatures, multiprocessing, checkpoint loading, TensorBoard paths, and headless plotting failures.
Bundled helpers
scripts/multiprocessing_env.pyfor the reusable subprocess vector-env helper used by A2C.scripts/playback_saved_policy.pyfor bounded playback of saved policy pickles from the REINFORCE / actor-critic family.
Fast choice guide
- No critic, episode returns only,
saved_log_probs: REINFORCE. - Policy plus value head, advantage from
G - V: actor-critic or baseline. - Multiple env processes and short rollouts: A2C.
clip_param, ratio clipping, minibatches, repeated epochs: PPO.- A saved
.pklpolicy object that should be evaluated rather than trained: playback helper.
Compatibility notes
- The inspection environment verified Gym 0.23.1 with classic-control envs and 4-value
step(...)tuples. - The source scripts still use legacy
env.seed(...)and legacy env IDs such asCartPole-v0,MountainCar-v0, andPendulum-v0. - Treat
Pendulum-v0as a compatibility note; usePendulum-v1in the inspected environment when you need a modern substitute. - This route is CPU-first, even though CUDA is available in the inspection environment.
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).