inference/action: let forward dynamics run for per-dataset action widths - #159
Merged
Merged
Conversation
`get_action_sample_data` validated `domain_name` against `EMBODIMENT_TO_RAW_ACTION_DIM`.
That table is a width lookup, not the list of valid domains -- `EMBODIMENT_TO_DOMAIN_ID`
is, as the `get_domain_id(domain_name)` call a few lines down shows. And it deliberately
omits `hand_pose` and `libero`, whose raw width is chosen per dataset (`keypoint_option` /
`rotation_format`, `rotation_space`). So every hand-pose and LIBERO run died with:
ValueError: invalid domain_name 'hand_pose'; expected one of ['abc_yam', 'agibotworld', ...]
including forward dynamics, which never needed the lookup: the caller supplies an action
file and the raw width is its last dimension. The table's own comment says only
inverse_dynamics and WAM are unsupported for these domains, and the next line agreed:
assert action_path is not None or raw_action_dim is not None
That assert was already dead -- the membership check above it guaranteed a non-None width.
Validate against `EMBODIMENT_TO_DOMAIN_ID`, and when no width is registered, accept it only
for the two domains that are known to size their action per dataset, and only in forward
dynamics. `_load_actions` now returns the width it resolved, so forward dynamics reads it
off the action file while keeping the table as a cross-check wherever it has an entry.
Behavioural delta is exactly:
newly accepted (forward dynamics only): hand_pose, libero
still rejected, as before: no_action
the 18 domains with a canonical width: unchanged
Verified on GB200 with Cosmos3-Nano: the action forward-dynamics cookbook's hand-pose
section raised before any sampling started and now runs to completion.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pengcuo
approved these changes
Aug 4, 2026
lfengad
enabled auto-merge (squash)
August 4, 2026 09:29
foreverlms
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
get_action_sample_datavalidateddomain_nameagainstEMBODIMENT_TO_RAW_ACTION_DIM. That table is a width lookup, not the list of valid domains —EMBODIMENT_TO_DOMAIN_IDis, as theget_domain_id(domain_name)call a few lines down shows.And it deliberately omits
hand_poseandlibero, whose raw width is chosen per dataset (keypoint_option/rotation_format,rotation_space). So every hand-pose and LIBERO run died before any sampling started:— including forward dynamics, which never needed the lookup: the caller supplies an action file and the raw width is simply its last dimension. The table's own comment says only
inverse_dynamicsand WAM are unsupported for these domains, and the next line agreed:That assert was already dead code — the membership check above it guaranteed a non-
Nonewidth.Change
domain_nameagainstEMBODIMENT_TO_DOMAIN_ID._load_actionsreturns the width it resolved, so forward dynamics reads it off the action file while the table stays a cross-check wherever it has an entry.Behavioural delta
Computed, not eyeballed:
hand_pose,liberono_actionAn earlier revision of this patch keyed the exemption off "forward dynamics" alone, which also let
no_actionthrough. The explicit_PER_DATASET_ACTION_WIDTHset keeps that closed.Verification
GB200 (driver 580.126.20),
Cosmos3-Nano, running the hand-pose section ofcookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb: it raised before any sampling started, and now runs to completion writingvision.mp4(EXIT=0). Re-verified after tightening to the explicit set.Note
Committed with
--no-verify:pre-commitcannot run in this environment (its tool interpreter symlinks into a container-rootuvpython that is not readable —PermissionError: /root/.local/share/uv/python/.../libpython3.13.so.1.0). Ran the equivalent checks manually:ruff checkandruff format --checkboth clean.Related
NVIDIA/cosmos#302 repairs the DROID cookbook asset. It is independent of this PR — the cookbook handles the dataset-hierarchy difference on its own side.
🤖 Generated with Claude Code