Skip to content

vllm.model_executor.models.gemma3n

Classes:

Gemma3nAltUp

Bases: Module

Alternating updates (Altup) The AltUp module wraps transformer layers. The predict step modifies the input to the transformer layer, and the correct step propagates the output of the transformer layer to the sparsely updated dimensions. See more in the research paper: https://proceedings.neurips.cc/paper_files/paper/2023/file/f2059277ac6ce66e7e5543001afa8bb5-Paper-Conference.pdf

Gemma3nCrossDecoder

Bases: Module

Cross-decoder layers.

Gemma3nLaurelBlock

Bases: Module

Learned Augmented Residual Layer.

Gemma3nSelfDecoder

Bases: Module

Includes altup embedding and self decoder layers.

_kv_sharing_weights_mapper(config)

KV-shared layers only have q_proj, so qkv_proj packing applies to the other layers. Original checkpoints still ship K/V tensors for the shared layers (fine-tuned ones omit them); those are dropped.