composer-environments
Create and validate custom dm_control Composer entities, tasks, observables, variations, and Environment loops.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- composer-environments
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Create and validate custom dm_control Composer entities, tasks, observables, variations, and Environment loops.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/composer-api-reference.md11.7 KB
- 参考文档references/observables-and-variation.md11.9 KB
- 参考文档references/troubleshooting.md10.4 KB
- 脚本scripts/composer_minimal_task.py7.5 KB
03 SKILL.md 正文
composer-environments
Use this sub-skill when a task needs a custom dm_control.composer environment: new Entity subclasses, a Task with lifecycle hooks and rewards, entity or task observables, per-episode randomization, or a composer.Environment reset/step loop.
Do not use this sub-skill for ready-made locomotion, manipulation, or soccer task catalogs; route those to ../locomotion-manipulation/SKILL.md. Route raw MJCF parsing/exporting/model surgery to ../mjcf-mujoco-models/SKILL.md, and Control Suite benchmark loading/wrappers to ../suite-rl-workflows/SKILL.md. If a custom observable renders camera pixels and the error is OpenGL/backend-specific, use ../rendering-viewer-assets/SKILL.md for backend selection.
Prerequisites and safe default
Use an installed dm_control package. Public install commands only:
python -m pip install dm_control
# For unreleased source snapshots only:
python -m pip install git+https://github.com/google-deepmind/dm_control.git
Do not use editable installs; dm_control does not support editable mode. Composer model construction and non-rendering reset/step loops are CPU workflows. Camera observables are rendering workflows and need a separately validated OpenGL backend.
First decisions
- Entity structure: implement
composer.Entity._build(...), store amjcf.RootElementor attached model, return it frommjcf_model, and return acomposer.Observablessubclass from_build_observables()when the entity exposes observations. - Task contract: implement
root_entity,get_reward(physics), optionaltask_observables, optional termination/discount/spec methods, and lifecycle hooks only where needed. - Timing: set
physics_timestepandcontrol_timestepthroughTask.set_timesteps(...)or the task properties. Ensure the control timestep is an integer multiple of the physics timestep. - Environment options: choose
random_state,time_limit,max_reset_attempts, recompilation behavior, observation buffer shape options, and physics error policy before training. - Validation before training: instantiate the task, create
composer.Environment, runreset()and severalstep(action)calls with actions fromaction_spec(), verify observation keys/shapes againstobservation_spec(), confirm reward/discount/termination behavior, and exercise any stochastic episode initialization with fixed seeds.
Bundled operating files
- Read
references/composer-api-reference.mdwhen implementing Composer class contracts, lifecycle hooks, environment options, observable key qualification, random-state handling, or recompilation behavior. - Read
references/observables-and-variation.mdwhen configuring enabled observables, buffers, delays, aggregators, corruptors,@composer.observable, or variation/distribution/noise randomizers. - Read
references/troubleshooting.mdwhen abstract method errors, missingmjcf_model/root_entity, bad observable keys, dead physics proxies, reset retry failures, or action-shape mismatches appear. - Run
scripts/composer_minimal_task.pyto smoke-test an installed-package Composer entity/task/environment loop and inspect action specs, observation specs, fully qualified keys, hook counts, and short rollout behavior.
Minimal validation command
From this sub-skill directory:
python scripts/composer_minimal_task.py --steps 5 --seed 7
Expected signal: the script prints one bounded action spec, observation specs containing a task-level key and entity-qualified keys, a control_timestep, a physics_steps_per_control_step, several successful step lines, and hook counts consistent with the configured number of physics substeps. If this smoke fails, fix import/install or core Composer construction before using the custom environment for training.
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).