laguna¶
laguna
¶
Laguna (poolside's Laguna) on vLLM (vllm.model_executor.models.laguna).
Llama's names and Llama's fused block: it takes and returns the stream as
(hidden_states, residual). What differs is inside the sublayers, as on
transformers:
- Per-block head counts.
num_attention_heads_per_layergives each block its own number of query heads;layers[i].self_attn's interior is split by that block's attention layer, and the root'snum_headsis the config's top-level count. - Gated attention. Per-head query and key norms before the rotary
embedding, then a softplus gate (
g_proj, per head or per channel) on the attention layer's output beforeo_proj: the head outputs are ungated andattention_outputis the gated projection the block adds. - Mixture of experts.
mlp_layer_typesnames the dense blocks and the sparse ones; a sparse block'smlpreturns the routed experts (timesmoe_routed_scaling_factor) plus its shared expert, which is what the block adds. The routing is inside vLLM's fused MoE kernel and has no values here. vLLM calls the shared expertshared_expert, aliased toshared_expertsas on transformers; it is the dense MLP's class, so it is anMlptoo, and itsmlp_outputis unavailable.
RENAME
module-attribute
¶
RENAME = {'model.embed_tokens': 'embed_tokens', 'model.layers': 'layers', 'model.norm': 'norm', 'gate': 'router', 'shared_expert': 'shared_experts'}
ENVOYS
module-attribute
¶
ENVOYS = {LagunaDecoderLayer: Layer, LagunaAttention: Attention, LagunaMLP: Mlp, LagunaMoE: Mlp}
Layer
¶
Bases: FusedLayer
The decoder block: forward(positions, hidden_states, residual) -> (hidden_states, residual).