Skip to content

feat(inference): Cosmos3-Edge num_frames default + Edge GPU smoke tests#123

Merged
lfengad merged 3 commits into
mainfrom
feat/edge-inference-defaults-and-smoke-tests
Jul 21, 2026
Merged

feat(inference): Cosmos3-Edge num_frames default + Edge GPU smoke tests#123
lfengad merged 3 commits into
mainfrom
feat/edge-inference-defaults-and-smoke-tests

Conversation

@lfengad

@lfengad lfengad commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a Cosmos3-Edge–specific num_frames inference default and two Edge GPU smoke tests, mirroring the existing Nano suite and wiring both into the current inference-smoke CI jobs.

num_frames default for Edge

  • args.py: default num_frames to 121 for Cosmos3-Edge video generation (keyed on the reasoner vlm model_name), following the existing per-model _RESOLUTION_SHIFT_DEFAULTS pattern. Other models keep the 189 modality 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 uses num_frames as an inert 1).
  • resolution (480, from model config) and fps (24, shared) were already correct for Edge, so only num_frames needed 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), so t2vs → plain t2v; 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 generated reasoner_text is 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 existing generator-inference-smoke / reasoner-inference-smoke jobs (reusing checkout + uv sync + input cache).

Verification

Run on a 4×GB200 node with the repo .venv (container guardrails enabled):

  • Unit test_edge_num_frames_default: passes on CPU (6 cases incl. image/action/reasoner scope regressions).
  • num_frames=121 default, end-to-end: a real Edge t2v run (no --resolution/--num-frames/--fps; t2v.json pins none) resolved to resolution=480, num_frames=121, fps=24 and produced a valid 121-frame, 832×480 video (pixel std 66) — confirming the default takes effect in real inference, not just at build time.
  • Reasoner smoke: passed on 4×GB200. Edge produced an accurate description — "two robotic arms with mechanical hands … on a table with wooden structures … in a lab or research environment …" — hitting both the subject and scene anchors, so the content check matches real output.
  • Not run locally (4-GPU node): the 8-GPU generator smoke's policy / forward_dynamics paths — 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

lfengad and others added 3 commits July 20, 2026 23:45
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>
@lfengad
lfengad merged commit acf00a5 into main Jul 21, 2026
8 checks passed
@lfengad
lfengad deleted the feat/edge-inference-defaults-and-smoke-tests branch July 21, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants