Skip to content

vllm.model_executor.models.transformers.fusers.mla

MLA fuser: adapt a Transformers MLA attention module for vLLM's MLA layer.

Classes:

  • MLAFuser –

    Fuser for the MLA attention pattern.

MLAFuser dataclass

Bases: StackedFuser

Fuser for the MLA attention pattern.

Methods:

  • update_forward –

    Merge q_a_proj and kv_a_proj into one fused down proj then split.

Attributes:

shards property

q_a_proj and kv_a_proj_with_mqa stack into one down-projection.

update_forward(module)

Merge q_a_proj and kv_a_proj into one fused down proj then split. Bypass the KV expansion method so the compressed latent reaches the vllm_mla attention interface unexpanded.

_consumes_placeholder(node)

Whether node is a linear applied directly to a forward input.

_is_rms_norm(module)

Whether module computes an RMSNorm, verified by RMSNormFuser's matcher.

_single_expand_call(funcdef, module, kv_b_proj_name)

The KV expansion call self.<method>(kv_c_normed, k_pe): the unique two-argument call to a method of module with the expansion's signature.

The expansion is kv_c_normed, k_pe -> key, value: two inputs, every return a pair, and it applies kv_b_proj -- the projection MLAAttention owns after the bypass, absorbed into the attention computation.

_top_level_index(funcdef, node)

Index in funcdef.body of the top-level statement containing node.