Skip to content

SL-51 PR2: Cosmos3Omni generation tower and wiring - #109

Merged
solderzzc merged 1 commit into
mainfrom
sl51/pr2-cosmos3omni
Nov 2, 2026
Merged

solderzzc merged 1 commit into
mainfrom
sl51/pr2-cosmos3omni

Conversation

@solderzzc

Copy link
Copy Markdown
Member

What

Implements the Cosmos3Omni generation branch (*_moe_gen, the second tower of the Mixture-of-Transformers) and wires cosmos3_omni into the VLM factory. Stacked on #107 (already merged), so this is against main.

  • SharpAICosmos3OmniGenTower and joint attention: understanding tokens attend causally to understanding tokens only; generation tokens attend bidirectionally to [understanding K/V; generation K/V]; per-tower RoPE (unified 3D mRoPE, interleaved sections).
  • Heads: proj_in/proj_out/time_embedder, audio head, domain-aware action linear. The audio and action heads are only built when sound_gen / action_gen is set.
  • Wrapper SharpAICosmos3OmniModel (und: Qwen3VL, gen, gen_heads) with generateVelocity(...).
  • Sanitizer now maps all 1165 checkpoint keys of the reference layout (including the 216 add_* attention keys); unknown keys throw instead of being dropped. The earlier rejection of _moe_gen is removed.
  • Config errors now throw instead of silently falling back to Nano defaults.
  • cosmos3_omni is added to the wired VLM keys (7); conformance expectations regenerated.

Tests (air-gapped, nothing downloaded)

66 Cosmos test cases across Configuration, GenTower, Heads, Model, Registration, Sanitize and WeightFiles, plus the VLM wiring and conformance suites. The air-gap test builds the model through the real registry with deterministic synthetic weights and checks that the model's parameter key set equals the sanitized key set. No .github/workflows or Package.swift changes.

What is not verified

  • No numerical parity with the PyTorch reference (no reference outputs available); tests are structural (shapes, finite values, understanding output independent of generation input).
  • Not loaded with a real Cosmos3-Nano checkpoint.
  • The real processor_class is unconfirmed; Qwen3VLProcessor is forced for cosmos3_omni.
  • Deepstack injection, generation mRoPE position construction from frame rate / frame count, and image/video features (only precomputed embeddings are accepted) are not implemented.
  • Sampler loop, VAE and sound tokenizer are out of scope.

🤖 Generated with Claude Code

…ts every checkpoint key

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@solderzzc
solderzzc merged commit 2646fb3 into main Nov 2, 2026
8 checks passed
@solderzzc
solderzzc deleted the sl51/pr2-cosmos3omni branch November 2, 2026 05:50
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.

1 participant