AGENT SKILL

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

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

  1. Read self-contained-runtime.md for bundled runtime/source/, default helper behavior, and editable staging.

  2. Read repo-provenance.md when checking whether the bundled source snapshot is current or before refreshing it.

  3. Read architecture-overview.md for the roles of runtime/source/muzero.py, game modules, networks, MCTS, replay buffer, trainer, shared storage, and diagnostics.

  4. Read troubleshooting.md for install/import, Gym/Ray, optional dependency, CPU/GPU, and bundled-source packaging issues.

  5. Run the shared checker before deeper work. Omit --repo-root to 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-root only 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 to runtime/source/.
  • scripts/run_muzero.py: self-contained constructor/train/test entry point backed by runtime/source/.
  • scripts/stage_muzero_source.py: copies runtime/source/ into an editable working directory for custom games or experiments.
  • sub-skills/training-and-cli/scripts/muzero_cli_smoke.py: safe MuZero constructor and optional tiny training wrapper; defaults to runtime/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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351