dm-control
Use DeepMind dm_control for MuJoCo simulation, Control Suite environments, PyMJCF models, Composer tasks, rendering, and high-level locomotion/manipulation workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- dm-control
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use DeepMind dm_control for MuJoCo simulation, Control Suite environments, PyMJCF models, Composer tasks, rendering, and high-level locomotion/manipulation workflows.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/installation-and-backends.md4.2 KB
- 参考文档references/package-overview.md5.2 KB
- 参考文档references/repo-provenance.md2.4 KB
- 参考文档references/repo-routing-metadata.json510 B
- 参考文档references/troubleshooting.md5.0 KB
- 脚本scripts/check_dm_control_install.py4.5 KB
- 脚本scripts/list_dm_control_tasks.py2.4 KB
03 SKILL.md 正文
dm-control
Use this repo skill when a task involves Google's dm_control package: DeepMind Control Suite environments, MuJoCo simulation through dm_control.mujoco, PyMJCF model construction, Composer custom tasks, locomotion/manipulation task families, pixel observations, viewer launchers, or rendering backend troubleshooting.
First checks
- Install public releases with
pip install dm_control; install unreleased source withpip install git+https://github.com/google-deepmind/dm_control.git. - Do not use editable installs for normal use.
dm_controlgenerates legacy MuJoCo bindings during installation, and editable installs can leavedm_control.mujoco.wrapper.mjbindingspartially initialized. - Run scripts/check_dm_control_install.py for an installed-package smoke check that imports core modules, loads one Control Suite task, builds a tiny PyMJCF model, and optionally probes rendering.
- Run scripts/list_dm_control_tasks.py to list installed Control Suite and manipulation task registries before choosing names.
- Read references/installation-and-backends.md when a task needs installation, MuJoCo/OpenGL backend selection, optional rendering, or Blender exporter constraints.
- Read references/package-overview.md for the component map, API entry points, and how the sub-skills fit together.
- Read references/troubleshooting.md for cross-cutting install/import, task selection, backend, and package-data failures.
Route by task
| User task | Read next |
|---|---|
| Load a Control Suite benchmark, step an environment, inspect action/observation specs, use wrappers, or create a random rollout | suite-rl-workflows |
Build, parse, compose, export, compile, step, or inspect a MuJoCo/MJCF model with PyMJCF or dm_control.mujoco.Physics |
mjcf-mujoco-models |
Create a custom Composer Entity, Task, observable, variation, arena, robot, or composer.Environment |
composer-environments |
| Use high-level locomotion, soccer, walker, mocap, prop, or manipulation task families | locomotion-manipulation |
Render frames, use pixel observations, launch the viewer, choose MUJOCO_GL, diagnose headless OpenGL, or reason about the Blender exporter |
rendering-viewer-assets |
Operating defaults
- Prefer installed-package imports over source-tree assumptions. The public distribution name and import package are both
dm_control. - Start from CPU/non-rendering simulation unless the user explicitly needs images, camera observations, a viewer, EGL, OSMesa, GLFW, or Blender export.
- Validate task names from registries before loading them:
suite.TASKS_BY_DOMAIN,suite.ALL_TASKS,manipulation.ALL, andmanipulation.TAGS. - For RL loops, use
dm_env.TimeStepsemantics: reset first, sample actions withinaction_spec(), step untiltime_step.last(), and inspectreward,discount, and observation keys. - For custom environments, decide whether the request is a ready-made task selection problem (
suite/ manipulation / locomotion) or a model/task-construction problem (mjcf/ Composer). - Keep rendering failures separate from simulation failures. A Control Suite task can reset/step correctly even when GLFW warns that
DISPLAYis missing; only pixel/render/viewer tasks require backend fixes. - When using cameras or pixel wrappers on headless Linux, try
MUJOCO_GL=eglfirst when a compatible NVIDIA/EGL stack is available; use OSMesa only when system OSMesa libraries are installed; use GLFW only with a display. - Treat
dm_control.blender.mujoco_exporteras optional and system-mutating: it requires Blender, and add-on installation should be an explicit user choice.
Minimal smoke snippets
from dm_control import suite
import numpy as np
env = suite.load('cartpole', 'balance')
time_step = env.reset()
action_spec = env.action_spec()
action = np.zeros(action_spec.shape, dtype=action_spec.dtype)
time_step = env.step(action)
print(time_step.reward, time_step.discount, time_step.observation.keys())
from dm_control import mjcf
model = mjcf.RootElement(model='smoke')
model.worldbody.add('geom', name='floor', type='plane', size=[1, 1, 0.1])
physics = mjcf.Physics.from_mjcf_model(model)
physics.step()
print(physics.model.nbody, physics.data.time)
Verification notes
- Safe native verification should prefer small CPU cases first: Control Suite registry/loading, PyMJCF model compilation, MuJoCo named access/math, Composer environment reset/step, and manipulation registry tasks.
- Rendering native checks are backend-specific. Use the bundled render probe before asserting pixel observations or viewer behavior.
- Long locomotion, mocap, soccer, GUI, Blender, benchmark-scale, or data-download workflows should be treated as optional or documentation-backed unless the user provides runtime budget and dependencies.
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).