Cosmos3-edge PR 6: Cosmos3-Edge as a cosmos3 config variant, with streaming rollout and action loop - #297
Open
merceod wants to merge 152 commits into
Open
Cosmos3-edge PR 6: Cosmos3-Edge as a cosmos3 config variant, with streaming rollout and action loop#297merceod wants to merge 152 commits into
merceod wants to merge 152 commits into
Conversation
This was referenced Sep 22, 2026
…s into Cosmos3Config
…k_norm_und_for_gen, lm_head, text_forward)
…(the reference kernel)
merceod
force-pushed
the
model/cosmos3-edge
branch
from
September 23, 2026 23:18
347302d to
b20bb5e
Compare
This branch has not been deployed
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.
Adds
nvidia/Cosmos3-Edge(4B) to thecosmos3family as a config-driven variant, registrycosmos3_edgeandcosmos3_edge_droid. No fork. The dense Nemotron backbone (relu2 MLP, Nemotron RMSNorm ordering, no text QK-norm,k_norm_und_for_gen), the 480p defaults, the native flow schedule and the diffusers-0.40 i2v conditioning recipe areCosmos3Configknobs read from the checkpoint. The Edge reasoner (understanding tower + SigLIP2-style vision encoder) is served as a VLM on/v1/chat/completionsfrom the same transformer instance and KV pool as the DiT, with its decode step compiled before the CUDA-graph capture. Also registers the 4-step distilled Super checkpoints (cosmos3_super_t2i_4step,cosmos3_super_i2v_4step).New for serving a world model is the streaming rollout. A long clip is generated window by window (8 latent = 29 pixel frames at 480p), each finished window leaves the denoise loop on a streaming edge to a decoder node in its own partition, and the client receives frames while the next window is still denoising.
chainedmode re-pins the previous window's tail as clean frames,kvmode commits the window's K/V into the paged cache so later windows attend to it block-causally, with the context bounded by the retention policy from #293. Asession_idkeeps that world state across requests. The action policy runs over the/generate/wsWebSocket from #294.Depends on #292 #293 #294 #295 #296. Their commits are carried on this branch until they merge (a rebase drops them), so merge order is those five first, then this one. Parity against diffusers 0.40 and transformers 5.17 (fixed-seed PSNR per frame, engine-cache harness, reasoner greedy tokens) lives in the tests under
mstar/model/cosmos3/tests/.Benchmarks
H100 80GB, one GPU of one node, every system back-to-back on that GPU, warmup excluded, n=3 medians (2026-09-23/24; clocks, driver and versions in the run's
environment.txt). 832x480 unless noted, 20 UniPC steps, guidance 6, seed 0. M* isconfigs/cosmos3_edge.yaml(the DROID rowconfigs/cosmos3_edge_droid.yaml) at9a5dafb9.The reasoner is the one row M* loses at more than one stream. The GPU is not the reason: the decode graph runs at the weight-streaming floor, and a profile shows the step at 32 streams spending ~8 of its 10 ms in per-row CPU work in the worker (postprocess, output routing, one device-to-host copy per row) plus an eager 25 ms vision prefill that stalls every stream. Both are engine-side follow-ups (the per-row work as its own PR), not properties of the model integration.
Also measured earlier (2026-09-17/18, two GPUs of one node at once, n=2, not redone under the one-GPU protocol): Nano at 832x480x121 with 35 steps 30.6 / 30.4 s on M* vs 30.9 / 30.8 on vLLM-Omni (i2v / t2v); the Nano 241-frame rollout streams its first window at 7.0 s where vLLM-Omni returns the clip whole after 76.4 s; Super 4-step distilled on TP2 does t2i 1024x1024 in 0.45 s and i2v 832x480x121 in 6.5 s.
Reproduce with
benchmark/cosmos3/reproduce_edge.sh(setSNAP,MSTAR,VLLM_OMNI_PY,VLLM_PY,SGLANGfirst):