Skip to content

Add composable world-model pipelines and Cosmos3 export - #466

Draft
xiaoyu-work wants to merge 10 commits into
mainfrom
xiaoyu-work/cosmos3-world-model
Draft

Add composable world-model pipelines and Cosmos3 export#466
xiaoyu-work wants to merge 10 commits into
mainfrom
xiaoyu-work/cosmos3-world-model

Conversation

@xiaoyu-work

Copy link
Copy Markdown
Contributor

Introduce executable pipeline schema 1.1 with typed generated-input programs, recurrent state lifecycle, scheduler and autoregressive controls, parameterized transforms, runtime assets, and dtype/EP hints.

Implement complete Cosmos3 Omni and Edge exports with the shared MoT generator, Wan video VAE, optional AVAE audio tokenizer, domain-aware action heads, real checkpoint weight routing, CLI support, documentation, and numerical tests.

Introduce executable pipeline schema 1.1 with typed generated-input programs, recurrent state lifecycle, scheduler and autoregressive controls, parameterized transforms, runtime assets, and dtype/EP hints.

Implement complete Cosmos3 Omni and Edge exports with the shared MoT generator, Wan video VAE, optional AVAE audio tokenizer, domain-aware action heads, real checkpoint weight routing, CLI support, documentation, and numerical tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
@CLAassistant

CLAassistant commented Aug 8, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ xiaoyu-work
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread src/mobius/_cosmos3_edge_world_model.py Dismissed
Comment thread src/mobius/_cosmos3_world_model.py Fixed
Focus the world-model guides on export commands, package contents, supported checkpoints, runtime usage, and practical options. Remove internal architecture and manifest implementation details from the user guide.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 55dd6746c9cddd

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 60 60 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 105 105 +0.0%
gpt2 model_size_bytes 388 KB 388 KB +0.0%
gpt2 num_nodes 54 54 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 60 60 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 56 56 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 94 94 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 58 58 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 54 54 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 60 60 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 56 56 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 264 264 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 126 126 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 428 428 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 166 166 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 55dd6746c9cddd

Model Sub-model Changes Status
bert (feature-extraction) model 0
falcon model 0
gemma2 model 0
gemma4 (gemma4) decoder 0
gemma4 (gemma4) embedding 0
gemma4 (gemma4) vision_encoder 0
gemma4_text model 0
gpt2 model 0
llama model 0
llama (static-cache) model 0
mamba (ssm-text-generation) model 0
phi3 model 0
phi3 (static-cache) model 0
qwen model 0
qwen (static-cache) model 0
qwen2 model 0
qwen2 (static-cache) model 0
qwen2_moe model 0
qwen2_moe (static-cache) model 0
qwen3 model 0
qwen3 (static-cache) model 0
qwen3_5_moe (hybrid-text-generation) model 0
qwen3_5_text (hybrid-text-generation) model 0
qwen3_5_vl (hybrid-qwen-vl) decoder 0
qwen3_5_vl (hybrid-qwen-vl) embedding 0
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0
qwen3_moe model 0
qwen3_moe (static-cache) model 0
qwen3_next (hybrid-text-generation) model 0
t5 (seq2seq) decoder 0
t5 (seq2seq) encoder 0
whisper (speech-to-text) decoder 0
whisper (speech-to-text) encoder 0

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

Add model-agnostic build, generation, and pipeline configuration for world-model exporters, plus safe shared helpers for diffusers-style checkpoint inspection and asset resolution.

Keep LLM ArchitectureConfig and every model/component implementation unchanged; Cosmos3 Omni and Edge only consume the new outer pipeline configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Match upstream chunk-zero temporal resampling so Cosmos3 can decode a single latent frame without running Conv on an empty temporal extent. Preserve bit-identical multi-frame behavior and add ORT/PyTorch parity coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Replace the fixed SigLIP1-style vision graph with the published packed variable-resolution SigLIP2 contract, correct block-major projection ordering, and use interleaved multimodal RoPE.

Add image/video feature routing, processor metadata, real-checkpoint numerical parity tests, and image/video understanding coverage while preserving text-only behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Describe conditioned video encoding, classifier-free guidance, prompt packing, and official Cosmos3 Edge generation recipes in pipeline.json. Ship the recommended negative prompt when available and preserve checkpoint-specific action behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Comment thread src/mobius/_cosmos3_edge_world_model.py Fixed
Comment thread src/mobius/_cosmos3_world_model_test.py Fixed
xiaoyu-work and others added 2 commits August 9, 2026 17:49
Apply the repository Ruff formatter to resolve CI formatting findings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Xiaoyu <85524621+xiaoyu-work@users.noreply.github.com>
Comment thread src/mobius/_cosmos3_world_model.py Fixed
Comment thread src/mobius/_cosmos3_world_model.py Fixed
Comment thread src/mobius/_cosmos3_world_model.py Fixed
Fix the Ruff unused-import failure after the latest world-model cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 997ab62c-69cb-4802-a5c6-fddd51bfd583
Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
@xiaoyu-work

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolve conflicts between the world-model/Cosmos3 export work and main:

- --features: keep world-model alongside main's prune-lm-head ->
  prune-prefill-prefix rename (CLI, README, CHANGELOG, cli_reference).
- _diffusers_builder: keep both the component allowlist and pipeline
  component task overrides from main and the EP/trace-optimization
  plumbing from this branch, plus the corresponding tests.
- components/tasks __init__: export main's new components/tasks together
  with the Cosmos3 Edge vision and Cosmos3 audio/generator additions;
  drop the projector removed by this branch.
- _weight_loading: thread main's revision pin through the new
  iter_weight_shards generator.
- _sub_configs: drop duplicated Cosmos3-Edge vision token fields that
  main added independently.
- wan_vae_test: expect the fused Swish op introduced by main.

Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: xiaoyu-work <85524621+xiaoyu-work@users.noreply.github.com>

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merged origin/main into the branch in 6c9cddd. Conflict resolutions:

  • --features: kept world-model alongside main's prune-lm-headprune-prefill-prefix rename (CLI, README, CHANGELOG, cli_reference).
  • _diffusers_builder: kept main's component allowlist + pipeline task overrides together with this branch's execution_provider/trace_optimization plumbing (and both sets of tests).
  • components/__init__.py, tasks/__init__.py: exported main's new components/tasks plus the Cosmos3 Edge vision and Cosmos3 audio/generator additions.

Also fixed two silent (non-conflicting) merge breakages: iter_weight_shards now threads main's revision pin, and duplicated Cosmos3-Edge vision token fields in _sub_configs.py were removed. wan_vae_test.py was updated for main's fused Swish op.

ruff check/ruff format --check are clean and the fast suite passes (5103 passed, 274 skipped). The only remaining failures are pre-existing tests/arch_validation_test.py cases unrelated to this PR (transformers-version issues on gemma4/nemotron/qwen3_asr etc.).

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.

4 participants