muzero-general
Guides MuZero General model-based reinforcement learning workflows, game/config customization, network and MCTS debugging, training CLI/API use, and checkpoint diagnostics.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- muzero-general
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guides MuZero General model-based reinforcement learning workflows, game/config customization, network and MCTS debugging, training CLI/API use, and checkpoint diagnostics.
- disable-model-invocation
- true
02 资源文件 34
- 参考文档references/architecture-overview.md4.3 KB
- 参考文档references/repo-provenance.md2.9 KB
- 参考文档references/repo-routing-metadata.json546 B
- 参考文档references/self-contained-runtime.md3.7 KB
- 参考文档references/troubleshooting.md3.9 KB
- 参考文档runtime/source/.github/workflows/ci-testing.yaml1.5 KB
- 参考文档runtime/source/BUNDLED-SOURCE-MANIFEST.json4.0 KB
- 脚本runtime/source/diagnose_model.py13.3 KB
- 参考文档runtime/source/docs/README.md173 B
- 脚本runtime/source/games/abstract_game.py2.7 KB
- 脚本runtime/source/games/atari.py9.1 KB
- 脚本runtime/source/games/breakout.py9.0 KB
- 脚本runtime/source/games/cartpole.py9.0 KB
- 脚本runtime/source/games/connect4.py13.9 KB
- 脚本runtime/source/games/gomoku.py13.1 KB
- 脚本runtime/source/games/gridworld.py9.3 KB
- 脚本runtime/source/games/lunarlander.py25.1 KB
- 脚本runtime/source/games/simple_grid.py9.7 KB
- 脚本runtime/source/games/spiel.py11.5 KB
- 脚本runtime/source/games/tictactoe.py13.5 KB
- 脚本runtime/source/games/twentyone.py11.7 KB
- 脚本runtime/source/models.py22.4 KB
- 脚本runtime/source/muzero.py25.9 KB
- 参考文档runtime/source/README.md7.1 KB
- 脚本runtime/source/replay_buffer.py14.4 KB
- 其他runtime/source/requirements.lock4.3 KB
- 参考文档runtime/source/requirements.txt67 B
- 脚本runtime/source/self_play.py20.6 KB
- 脚本runtime/source/shared_storage.py1.1 KB
- 脚本runtime/source/trainer.py11.0 KB
- 脚本scripts/_skill_runtime.py3.8 KB
- 脚本scripts/check_muzero_environment.py6.5 KB
- 脚本scripts/run_muzero.py8.3 KB
- 脚本scripts/stage_muzero_source.py2.5 KB
03 SKILL.md 正文
MuZero General
Use this repo skill when a task involves MuZero General, a bundled source-snapshot implementation of DeepMind-style MuZero with PyTorch networks, Ray self-play/training workers, built-in Gym/board/card games, checkpointed results, TensorBoard logging, and optional diagnostics. The skill includes the required MuZero General source under runtime/source/, so core workflows and smoke helpers do not require an external checkout.
Start here
-
Read self-contained-runtime.md for bundled
runtime/source/, default helper behavior, and editable staging. -
Read repo-provenance.md when checking whether the bundled source snapshot is current or before refreshing it.
-
Read architecture-overview.md for the roles of
runtime/source/muzero.py, game modules, networks, MCTS, replay buffer, trainer, shared storage, and diagnostics. -
Read troubleshooting.md for install/import, Gym/Ray, optional dependency, CPU/GPU, and bundled-source packaging issues.
-
Run the shared checker before deeper work. Omit
--repo-rootto use the bundled source snapshot:python scripts/check_muzero_environment.py --smoke --json
Route by task
| User task | Read next | Why |
|---|---|---|
| Run the self-contained MuZero entry point, build a JSON config override, start/stop training, test a model, use TensorBoard, or run HPO | training-and-cli | Owns bundled-source CLI/API patterns, Ray worker lifecycle, safe training smokes, expensive CI recipe, and runtime failures. |
Choose a built-in game, add a custom game, validate MuZeroConfig, fix observation/action/player errors, or handle optional game packages |
games-and-configs | Owns the AbstractGame/Game contract, built-in game catalog, config field groups, and optional dependencies. |
Debug FC/ResNet construction, tensor shapes, support transforms, GameHistory, legal action masks, or MCTS behavior |
models-and-mcts | Owns models.py and self_play.py model/search internals and safe tensor smoke checks. |
Load/inspect model.checkpoint, resume from replay_buffer.pkl, diagnose learned model dynamics, or avoid plotting/headless failures |
checkpoints-and-diagnostics | Owns checkpoint schema, load_model, SharedStorage.save_checkpoint, DiagnoseModel, and non-interactive inspection. |
Installation and import context
MuZero General has no upstream packaging metadata, so this skill bundles the required source snapshot at runtime/source/ and provides skill-owned entry points that add that source to sys.path automatically. Use an external --repo-root only when intentionally validating a staged editable copy or another target checkout; it is not required for core skill workflows.
Bundled-source dependency install from the skill root:
pip install -r runtime/source/requirements.lock
Practical modern CPU inspection often needs compatible versions of torch, ray, gym, tensorboard, nevergrad, seaborn, matplotlib, numpy, and pygame for classic-control environments. Optional game integrations require extra packages; do not install all optional packages unless the selected workflow needs them.
Minimal self-contained import check:
python scripts/check_muzero_environment.py --json
Safe operating defaults
- Start with CPU-safe smoke checks before training:
training_steps=0,num_simulations=1,max_moves=1,save_model=false,max_num_gpus=0, and all GPU flags false. - Avoid the interactive no-argument CLI and game
render()methods in unattended work. - Treat Atari, LunarLander/Box2D, MiniGrid, OpenSpiel, Graphviz plotting, and long CartPole CI training as optional or expensive unless the user explicitly selects them.
- Use bundled scripts and
runtime/source/instead of relying on an external source checkout, examples, or notebooks. The scripts use the bundled source by default and accept--repo-rootonly as an optional override for staged copies or user target checkouts. - Do not claim a checkpoint is compatible with a game/config until weight shapes and key config fields are checked.
Important bundled helpers
scripts/check_muzero_environment.py: shared dependency/import/optional-game checker with an optional CPU smoke; defaults toruntime/source/.scripts/run_muzero.py: self-contained constructor/train/test entry point backed byruntime/source/.scripts/stage_muzero_source.py: copiesruntime/source/into an editable working directory for custom games or experiments.sub-skills/training-and-cli/scripts/muzero_cli_smoke.py: safeMuZeroconstructor and optional tiny training wrapper; defaults toruntime/source/.sub-skills/games-and-configs/scripts/list_builtin_games.py: built-in game/dependency summary.sub-skills/games-and-configs/scripts/validate_game_module.py: custom or built-in game contract validator.sub-skills/models-and-mcts/scripts/model_mcts_smoke.py: FC/ResNet/MCTS tensor smoke.sub-skills/checkpoints-and-diagnostics/scripts/inspect_checkpoint.py: CPU-safe checkpoint/replay metadata inspector.
Non-goals
This skill does not provide a new MuZero algorithm implementation beyond the bundled upstream source snapshot, guarantee benchmark-level training results, install optional system packages without approval, download Atari ROMs/assets, or execute long experiments by default. It prepares future agents to use and troubleshoot MuZero General workflows safely and accurately without requiring the production 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).