rl-workflows
Train, smoke-test, save, load, and play PPO hover policies with HoverAviary and MultiHoverAviary.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- rl-workflows
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Train, smoke-test, save, load, and play PPO hover policies with HoverAviary and MultiHoverAviary.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md6.7 KB
- 参考文档references/troubleshooting.md7.0 KB
- 参考文档references/workflows.md5.5 KB
- 脚本scripts/run_rl_workflow.py19.5 KB
03 SKILL.md 正文
rl-workflows
Read when
Use this sub-skill for reinforcement-learning tasks that mention PPO, SB3, train a hover policy, run a short PPO smoke, play a saved model, compare single-agent and multi-agent hover, Gymnasium hover IDs, or debug RL import/model-path failures.
What this sub-skill owns
- Short, headless PPO training smoke runs for
HoverAviaryandMultiHoverAviary. - Saving and loading SB3
PPOmodels asfinal_model.zipandbest_model.zip-style artifacts. - Headless or GUI playback of saved policies, including optional logger and wall-clock sync behavior.
- Choosing between single-agent hover (
hover-aviary-v0,HoverAviary) and two-or-more-drone multi-hover (multihover-aviary-v0,MultiHoverAviary). - Using
BaseRLAviary,ActionType,ObservationType,Logger, andsyncin the RL example pattern. - Explaining the source
learn.run(..., local=False)smoke branch and why long training must be explicitly requested.
Route elsewhere
- Control-only PID, velocity, downwash, MRAC,
CtrlAviary,VelocityAviary, and controller internals belong to the control-simulation sub-skill. - Betaflight SITL, external Betaflight checkout layout, UDP ports, and
BetaAviarybelong to the betaflight-sitl sub-skill. - General package installation/import routing belongs to the root repo skill, but RL-specific
torch,stable_baselines3,gymnasium, and model-path failures are covered here.
Quick operating route
- Confirm the installed runtime has
gym_pybullet_drones,gymnasium,torch, andstable_baselines3; the package has no CLI entry points, so prefer the bundled helper script. - Pick the RL task:
- single-agent hover:
HoverAviary/hover-aviary-v0, default one drone, target z approximately 1.0; - multi-agent hover:
MultiHoverAviary/multihover-aviary-v0, default two drones, per-drone hover targets.
- single-agent hover:
- Start with a short headless smoke train, not full training. Use
gui=False, kinematic observations, and one-dimensional RPM actions unless the task asks otherwise. - Use the saved
best_model.ziporfinal_model.zipfrom the smoke run for playback; never assumeresults/best_model.zipexists. - Playback headless first when no display is available; enable GUI or plotting only after the model loads and the environment runs.
Runtime references and helper
- Workflows: smoke training, train-then-play, playback, single-agent vs multi-agent choices, and output layout.
- API reference: env IDs, constructors, enums,
learn.run,play.play,Logger, andsyncfacts. - Troubleshooting: import failures, missing model paths, local-vs-full training, plotting/results folders, multi-agent confusion, and headless operation.
- RL workflow helper: skill-owned automation for import checks, safe PPO smoke training, and separate playback.
Native anchors
- Native smoke target:
tests/test_examples.py::test_learn, which callslearn.run(gui=False, plot=False, output_folder='tmp', local=False). - Follow-on playback target: run playback against the model produced by the smoke training path, using
gui=Falsefirst.
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).