configuration
Routes DreamerV2 configuration construction, preset composition, typed flags, immutable updates, and schedule validation.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- configuration
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes DreamerV2 configuration construction, preset composition, typed flags, immutable updates, and schedule validation.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/flags-and-config.md10.7 KB
- 参考文档references/presets.md10.7 KB
- 参考文档references/troubleshooting.md9.7 KB
- 脚本scripts/preview_config.py2.0 KB
03 SKILL.md 正文
DreamerV2 configuration
Use this route to construct, inspect, serialize, or troubleshoot a DreamerV2
common.Config before handing it to training or the public API. The package
configuration is a typed, immutable flat/nested mapping; command-line flags
produce a new config rather than mutating the input.
Route boundaries
Use this sub-skill for:
- the
defaults,atari,crafter,dmc_vision,dmc_proprio, anddebugYAML presets; - ordered preset composition through
--configs; - dotted keys, regular-expression key updates, and typed flag values;
Config.update(),Config.save()/Config.load(), and schedule syntax; and- high-impact model, replay, dataset, precision, JIT, and training cadence choices that are configuration values.
Route elsewhere for:
- environment names, observation/action schemas, wrappers, or external assets:
use
environments; - launching training, logdir/checkpoint/replay lifecycle, GPU setup, or resume:
use
training; and - plot flags, metric aggregation, and run comparison: use
evaluation.
Read the focused tables before changing a value:
- references/presets.md — exact defaults, preset deltas, order, and high-impact choices.
- references/flags-and-config.md — parser, conversion, immutability, patterns, persistence, and schedules.
- references/troubleshooting.md — failure diagnosis and portable command recipes.
- scripts/preview_config.py — safe, package-backed preset/override preview with no training side effects.
Verified construction workflow
-
Start from the public package defaults. For the Python API, use
import dreamerv2.api as dv2anddv2.defaults; for the built-in runner, provide a real writable--logdirrather than retaining/dev/null. -
Select presets in the exact order they should override one another. The runner first parses
--configs, starts fromdefaults, then callsconfig.update(configs[name])once for each selected name. Later presets win.defaultsis the implicit selection when--configsis omitted. -
Apply named dotted overrides after all presets, for example
--replay.minlen 10 --dataset.length 10 --precision 32. Use the exact spelling and the value spelling documented in the references; do not invent flags. -
Preview and validate with a small Python process before a costly run. The safe preview helper is also available. The following is safe and does not create environments or checkpoints:
python - <<'PY' import dreamerv2.api as dv2 cfg = dv2.defaults.update({'logdir': '/tmp/dreamerv2-config-preview'}) for name in ('atari', 'debug'): cfg = cfg.update(dv2.configs[name]) cfg = cfg.parse_flags(['--replay.minlen', '10', '--replay.maxlen', '30']) print(cfg) print('flat replay:', {k: v for k, v in cfg.flat.items() if k.startswith('replay.')}) PY--configsis a runner flag; it is not a key indv2.defaults. For direct Python composition, load the package's preset mapping or reproduce the runner's orderedConfig.update()calls, then callparse_flags()only for ordinary config keys. -
Save a validated configuration beside a run with
config.save(path), or load a prior.yaml,.yml, or.jsonusingConfig.load(path). The training runner saves its effective config asconfig.yamlinlogdir. -
Hand the resulting config to
dv2.train()or to thetrainingroute. This sub-skill does not launch training. The installed console launcher is known to resolveconfigs.yamlfromsys.argv[0]; use the verified module routepython -m dreamerv2.train ...instead.
Fast checks
python -m dreamerv2.train --helpis a help-only parser check; it does not prove that a selected environment or GPU can train.- A typed config check should assert that YAML lists become tuples, a fractional
integer is rejected, and a typo is rejected by
Config.update(). - A schedule check should evaluate one value at step 0, one interior value, and the endpoint using TensorFlow tensors. See the exact formulas in references/flags-and-config.md.
- Keep generated
config.yamlportable: use a path valid on the target host, avoid source-checkout paths, and record the effective config after preset and flag composition. Precision/JIT and environment availability still belong to the downstream training gate.
High-impact decisions
- Choose
dmc_visionversusdmc_proprioaccording to the observation modality; their encoder/decoder key filters and preset model sizes differ. atarichanges image keys, action repeat, time limit, horizon, replay prefill, optimizer rates, entropy, discount, and loss scales. It is not just a task-name alias.crafterenables image-only model keys, achievement/reward logging, and a regex update that sets every existing*.normkey tolayer.debugmust normally be last. It disables JIT and shortens evaluation, logging, prefill, replay, and dataset settings; it does not make the native runner CPU-safe, nor does it overrideprecision.precisionaccepts only 16 or 32 in the built-in runner.jit: Falseenables eager TensorFlow functions;jit: Trueleaves graph compilation enabled. These are runtime choices, not proof that a config is otherwise valid.
If a flag fails, preserve the exact error and compare it with references/troubleshooting.md; do not silently coerce a typo, fractional integer, empty list, or non-canonical boolean.
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).