training-and-evaluation
Use HighwayEnv safely as an RL training, rollout, evaluation, rendering, and recording target.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training-and-evaluation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use HighwayEnv safely as an RL training, rollout, evaluation, rendering, and recording target.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/rendering-and-recording.md5.1 KB
- 参考文档references/rl-integration.md8.9 KB
- 参考文档references/troubleshooting.md5.7 KB
- 脚本scripts/random_policy_rollout.py9.8 KB
03 SKILL.md 正文
Training and evaluation sub-skill
Use this sub-skill when an agent needs to run bounded rollouts, smoke-test an environment before training, integrate optional RL libraries, evaluate learned policies, use vectorized environments for RL, configure pixel/video evaluation, or avoid unbounded HighwayEnv training loops.
Routing boundaries
- For choosing environment IDs, versioned environment names, reset/step basics,
render_modebasics, registration, finite-MDP helpers, and general vectorized Gymnasium operation, read../simulation-environments/SKILL.md. - For observation, action, reward,
info["rewards"], goal/success, image-observation, or continuous-action configuration decisions, read../observations-actions-rewards/SKILL.md. - For custom roads, vehicles, dynamics, custom environment classes, or changing transition/reward internals, read
../road-vehicle-dynamics/SKILL.md. - Use this sub-skill only after the package imports and a basic environment can be created.
Runtime references and helper
- Read
references/rl-integration.mdbefore using HighwayEnv with Stable-Baselines3, Torch, rl-agents, vectorized training, image observations, or policy evaluation. It includes optional dependency boundaries, Gymnasium-compatible loop patterns, SB3 DQN/PPO skeletons, and bounded evaluation patterns. - Read
references/rendering-and-recording.mdwhen rendering during evaluation, collectingrgb_arrayframes, using image observations, recording videos, or diagnosing too-fast videos and headless display behavior. - Read
references/troubleshooting.mdwhen training fails, videos are blank or too fast, optional RL imports are missing, Gymnasium/SB3 API signatures mismatch, image/CNN shapes fail, vectorized environments fail, or policies are unexpectedly poor. - Run
scripts/random_policy_rollout.pyfor a no-RL-dependency smoke test that samples random actions for a bounded number of episodes and steps, optionally rendersrgb_arrayframes, and can write a JSON rollout summary.
Safe default workflow
- Confirm installation and environment creation with the root skill or simulation sub-skill.
- Run a bounded random-policy smoke test before any RL training:
python scripts/random_policy_rollout.py --env-id highway-v0 --episodes 1 --max-steps 20 - If training with optional RL libraries, start from the skeletons in
references/rl-integration.md, keeptotal_timestepssmall for the first validation run, and evaluate with a hard episode and step cap. - If recording video, use the pattern in
references/rendering-and-recording.mdand always close the wrapped environment.
Handoff contract
A successful use of this sub-skill should produce one or more of:
- a bounded smoke-test result with episode return, steps, termination/truncation status, and crash/success summary;
- an RL integration plan that explicitly lists optional dependencies and safe training/evaluation limits;
- a recording plan that uses
rgb_array/RecordVideosafely and avoids too-fast videos; - a clear route to another sub-skill if the blocker is environment selection, observation/action/reward configuration, or custom dynamics rather than training/evaluation.
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).