mjcf-mujoco-models
Build, parse, compose, export, compile, step, inspect, and optionally render MJCF/MuJoCo models with dm_control.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mjcf-mujoco-models
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Build, parse, compose, export, compile, step, inspect, and optionally render MJCF/MuJoCo models with dm_control.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/mujoco-physics-reference.md8.4 KB
- 参考文档references/pymjcf-reference.md10.2 KB
- 参考文档references/troubleshooting.md8.8 KB
- 脚本scripts/mjcf_smoke_model.py7.6 KB
03 SKILL.md 正文
MJCF and MuJoCo Models
Use this sub-skill when a task is about raw MJCF/PyMJCF models or dm_control.mujoco.Physics: building XML object models, parsing model files or strings, composing attached models, exporting assets, compiling a Physics, stepping/resetting state, named data/model inspection, action specs, or a small render probe.
Route before working
- Stay here for
dm_control.mjcf.RootElement,Element.add/find/find_all, parser/export helpers,mjcf.Physics.from_mjcf_model,mujoco.Physics.from_xml_string/from_xml_path,physics.named,reset_context,mujoco.action_spec, andphysics.renderAPI usage. - Route custom Composer
Entity,Task, observable, and variation abstractions to composer-environments. - Route Control Suite benchmark loading, wrappers, and rollout loops to suite-rl-workflows.
- Route operational OpenGL, viewer, pixel-observation, EGL/OSMesa/GLFW, and Blender-exporter troubleshooting to rendering-viewer-assets.
Installation and runtime guardrails
Install the public package with:
pip install dm_control
For unreleased source installs use:
pip install git+https://github.com/google-deepmind/dm_control.git
Editable installs are not supported; do not rely on a source checkout, local paths, notebooks, or repository tests at runtime. Rendering is optional: CPU model construction, compile, reset, and stepping should work without an OpenGL backend, while physics.render depends on a configured MuJoCo GL backend.
Read or run these bundled files
- Read references/pymjcf-reference.md when creating, parsing, modifying, attaching, namespacing, validating, or exporting MJCF/PyMJCF models.
- Read references/mujoco-physics-reference.md when compiling models into
Physics, stepping/resetting simulations, using named data/model access, deriving action specs, rendering, or wrapping a customdm_envenvironment. - Read references/troubleshooting.md when schema/attribute validation, duplicate names, invalid references, assets, compile failures, render backend selection, or simulation divergence blocks progress.
- Run scripts/mjcf_smoke_model.py to verify an installed
dm_controlcan build a tiny PyMJCF model, compilemjcf.Physics, step it, optionally render, and optionally write the generated XML.
Default operating sequence
- Choose the level: PyMJCF object model for programmatic construction/composition; raw
mujoco.Physicsconstructors for existing XML or MJB models. - Build or parse the model; use
dclassfor XMLclass,getattr(model.visual, 'global')for keyword child names, and directmjcf.Elementreferences for reference attributes. - If composing models, attach a fresh or copied child model, keep the returned attachment frame if joints/inertials are needed, and validate namespaced identifiers after attachment.
- Compile with
mjcf.Physics.from_mjcf_model(model)ormujoco.Physics.from_xml_string(xml, assets=model.get_assets())before claiming the model is valid. - Inspect and control through
physics.named,physics.bind(element)for PyMJCF elements,reset_context,set_control,step, andmujoco.action_spec. - Treat rendering as an optional probe. If rendering fails but non-rendering compile/step succeeds, preserve the model result and route backend diagnosis to the rendering sibling skill.
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).