Skip to content

vllm.model_executor.models.cosmos3_edge

Classes:

Functions:

Cosmos3EdgeAttention

Bases: NemotronHAttention

Nemotron-H attention with interleaved multimodal RoPE.

Cosmos3EdgeAttentionDecoderLayer

Bases: Module

Pre-norm attention layer for the Cosmos3 Edge dense text model.

Cosmos3EdgeForCausalLM

Bases: Module

Minimal CausalLM wrapper for the Cosmos3 Edge dense text model.

Cosmos3EdgeForConditionalGeneration

Bases: Module, SupportsMultiModal, SupportsPP, SupportsMRoPE

Cosmos3 Edge model with a SigLIP2 vision encoder.

Architecture
  • self.visual: SigLIP2 encoder + patch merger + projector
  • self.language_model: Cosmos3EdgeForCausalLM (pure attention + RoPE)

_get_image_features(pixel_values, grid_thw)

Run the complete vision tower and split by media item.

Cosmos3EdgePatchMerger

Bases: Module

Projector: LayerNorm -> Linear -> GELU -> Linear.

input_hidden_size * spatial_merge_size² -> merger_intermediate_size -> out_hidden_size

Cosmos3EdgeTextModel

Bases: NemotronHModel

Nemotron-H backbone with Cosmos-owned checkpoint name mapping.

Cosmos3EdgeVisionEncoder

Bases: Siglip2VisionTransformer

Adapts Cosmos (T, H, W) metadata to vLLM packed SigLIP2.

Cosmos3EdgeVisionModel

Bases: Module

Complete Cosmos vision tower returning language-model embeddings.

_cosmos3_edge_diffusers_prefix_map()

Map Diffusers blocks to interleaved Nemotron-H layers.

The checkpoint stores attention and MLP in one layers.N block, while the Nemotron-H model represents them as separate decoder layers. Therefore, checkpoint block N maps its attention to layer 2N and its MLP to layer 2N + 1.

_merge_windows_to_raster(pixel_values, grid_thw, merge_size)

Reorder the processor's merge-window-major patches to raster order.

_to_nemotron_h_config(text_config)

Express the dense text model as Nemotron-H attention and MLP layers.

patch_merging_by_param(image_embeds, grid_thw, merge_size=2)

Merge each spatial merge_size block into the channel dimension.