training-and-cli
Runs and troubleshoots MuZero General CLI, Python API, Ray training/testing, TensorBoard logging, and safe smoke workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training-and-cli
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Runs and troubleshoots MuZero General CLI, Python API, Ray training/testing, TensorBoard logging, and safe smoke workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md5.1 KB
- 参考文档references/training-workflows.md7.5 KB
- 参考文档references/troubleshooting.md4.5 KB
- 脚本scripts/muzero_cli_smoke.py7.5 KB
03 SKILL.md 正文
Training and CLI
Use this sub-skill when the task is to run MuZero General, build a safe training or testing command, use the MuZero Python API, adjust a JSON config override, understand Ray workers, inspect the upstream CartPole CI recipe, or debug training/runtime startup failures.
Fast route
-
Read training-workflows.md for self-contained bundled-source entry points, Python API patterns, TensorBoard usage, hyperparameter search, and safe smoke overrides.
-
Read api-reference.md when you need verified signatures, constructor behavior, worker roles, checkpoint lifecycle, or replay/trainer/shared-storage interactions.
-
Read troubleshooting.md for invalid game/config names, Ray startup failures, GPU resource conflicts, long-running training, TensorBoard confusion, Gym/Ray warnings, or interactive menu blocking.
-
Run the bundled safe smoke helper before real training:
python sub-skills/training-and-cli/scripts/muzero_cli_smoke.py --game tictactoe --training-steps 0 --jsonThe helper imports the bundled
runtime/source/snapshot by default, constructsMuZero, applies CPU-safe overrides, reports key config/checkpoint facts, and shuts Ray down. It does not train unless--run-trainis explicitly supplied. Use--repo-rootonly for a staged editable copy or another target checkout.
Primary workflows
- Self-contained entry point: from the skill root, use
python scripts/run_muzero.py --game <game> --config-json '<json-config>' --mode construct|train|test. It runs against bundledruntime/source/unless--repo-rootpoints to an intentionally staged copy or target checkout. Use JSON overrides for bounded runs such as{"training_steps": 0, "num_simulations": 1, "max_moves": 1, "save_model": false}. - Python API run: instantiate
MuZero(game_name, config=None, split_resources_in=1), optionally callload_model(...), then calltrain(log_in_tensorboard=True|False)ortest(render=False, ...). - Smoke before training: prefer the bundled helper or
python scripts/run_muzero.py --game tictactoe --safe-smoke --mode construct --jsonbefore launching Ray workers that can run indefinitely. - Real training: choose a game/config in sibling games-and-configs, validate model/search shapes in models-and-mcts, then run training with a deliberate result path and TensorBoard plan.
- Checkpoint-aware runs: read checkpoints-and-diagnostics before loading
model.checkpointorreplay_buffer.pklartifacts.
Safety boundaries
- Do not run the upstream interactive menu (
runtime/source/muzero.pywith no args) in automation unless the user explicitly wants prompts. Preferscripts/run_muzero.py, which has no interactive menu mode. - Do not run the upstream 7,500-step CartPole CI recipe as a normal smoke; it is an expensive native candidate, not the default verification path.
- Do not enable
train_on_gpu,selfplay_on_gpu, orreanalyse_on_gpuwhile settingmax_num_gpus = 0. - Do not assume all optional games are installed. Atari, LunarLander/Box2D, MiniGrid, and OpenSpiel need extra packages; route those checks to games-and-configs.
When to stop and ask
Ask for user approval before long training, installing optional game dependencies, downloading Atari ROM/assets, using GPUs for a heavy run, or overwriting/checkpointing into a user-important results directory. Otherwise use bounded CPU-safe smoke checks first.
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).