feat(inference): Cosmos3-Edge num_frames default + Edge GPU smoke tests#123
Merged
Merged
Conversation
Default num_frames to 121 for Cosmos3-Edge video generation (keyed on the reasoner vlm model_name), mirroring the existing per-model _RESOLUTION_SHIFT_DEFAULTS pattern; other models keep the 189 modality default. resolution (480, from model config) and fps (24, shared) are already correct for Edge, so only num_frames needed a model-specific default. Add two GPU smoke tests mirroring the Nano suite, wired into the existing generator/reasoner inference-smoke CI jobs: - tests/edge_inference_smoke_test.py (8-GPU): t2v + policy + forward_dynamics. Edge has no sound, so t2vs -> plain t2v; the t2v sample gets the stronger whole-clip check and asserts the Edge 480/121/24 generation defaults. - tests/edge_reasoner_inference_smoke_test.py (4-GPU): image-conditioned reasoner. Golden-free smoke that validates the generated reasoner_text is non-empty, coherent, and on-topic (references the image's robotic subject). Verified on 4xGB200: Edge produced an accurate robotic-scene description. Also add a unit test for the Edge=121 / Nano=189 / explicit-override behavior and note the Edge default in docs/inference.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Strengthen the reasoner_text content check into a fuller "complete description"
gate: the generated text must reference BOTH the dominant robotic subject
(_SUBJECT_PATTERN) AND the table/lab setting (_SCENE_PATTERN), not just one.
Rejects "subject-only" / "scene-only" replies while staying phrasing-robust.
Verified on 4xGB200: the real Edge description ("two robotic arms with
mechanical hands ... on a table with wooden structures ... in a lab or research
environment ...") passes both anchors; test green (1 passed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…regression tests The Edge 121 default guard keyed on vision_mode==VIDEO, but the reasoner reports VIDEO vision_mode (it is neither an image-output nor an action mode), so an Edge reasoner sample was getting num_frames rewritten to 121. Harmless at runtime (the reasoner treats num_frames as an inert 1) but incorrect; exclude reasoner from the guard alongside action/image modes. Extend test_edge_num_frames_default with regression cases proving the default is scoped to plain video generation only: Edge text2image -> 1, Edge policy -> 189 (action, unchanged), Edge reasoner -> 1. All build on CPU (no GPU/assets). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pengcuo
approved these changes
Jul 21, 2026
Xuanmeng-Zhang
approved these changes
Jul 21, 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.
What
Adds a Cosmos3-Edge–specific
num_framesinference default and two Edge GPU smoke tests, mirroring the existing Nano suite and wiring both into the current inference-smoke CI jobs.num_framesdefault for Edgeargs.py: defaultnum_framesto 121 for Cosmos3-Edge video generation (keyed on the reasonervlmmodel_name), following the existing per-model_RESOLUTION_SHIFT_DEFAULTSpattern. Other models keep the189modality default. The default is scoped to plain video generation only — it is not applied to image modes (single-frame), action modes (own default), or the reasoner (reports VIDEO vision_mode but usesnum_framesas an inert 1).resolution(480, from model config) andfps(24, shared) were already correct for Edge, so onlynum_framesneeded a model-specific default.args_test.py:test_edge_num_frames_default— Edge=121 / Nano=189 / explicit-override, plus regressions proving the scope: Edge text2image→1, Edge policy→189 (action untouched), Edge reasoner→1. All build on CPU (no GPU/assets).docs/inference.md: note the Edge default.Edge GPU smoke tests (mirror Nano)
tests/edge_inference_smoke_test.py(8-GPU): t2v + policy + forward_dynamics. Edge has no sound (sound_gen: false), sot2vs→ plaint2v; the t2v sample gets the stronger whole-clip content check (_assert_video_has_content) and asserts the Edge 480/121/24 generation defaults.tests/edge_reasoner_inference_smoke_test.py(4-GPU): image-conditioned reasoner. Golden-free smoke that validates the generatedreasoner_textis non-empty, coherent (min length + lexical diversity), and a complete description — it must reference both the dominant robotic subject and the table/lab setting.gpu-tests.yml: both Edge tests added as steps in the existinggenerator-inference-smoke/reasoner-inference-smokejobs (reusing checkout +uv sync+ input cache).Verification
Run on a 4×GB200 node with the repo
.venv(container guardrails enabled):test_edge_num_frames_default: passes on CPU (6 cases incl. image/action/reasoner scope regressions).num_frames=121default, end-to-end: a real Edge t2v run (no--resolution/--num-frames/--fps;t2v.jsonpins none) resolved toresolution=480, num_frames=121, fps=24and produced a valid 121-frame, 832×480 video (pixel std 66) — confirming the default takes effect in real inference, not just at build time.policy/forward_dynamicspaths — first real execution is on the CI 8-GPU runner. The reasoner smoke was verified on GB200; CI runs on H200 (greedy decode + broad anchors make a pass expected, not hardware-proven).🤖 Generated with Claude Code