vllm.model_executor.layers.mla
¶
Classes:
-
MLAModules–Modules used in MLA.
-
MultiHeadLatentAttentionWrapper–Pluggable MLA layer which allows OOT backends to add
MLAModules
dataclass
¶
Modules used in MLA.
MultiHeadLatentAttentionWrapper
¶
Bases: PluggableLayer
Pluggable MLA layer which allows OOT backends to add custom implementations of the outer MLA layer (including rope & o_proj). Note that currently oot platforms can still use CustomOp.register_oot to replace MLA layer entirely, although we use PluggableLayer to register this layer now.
This class takes positions and hidden_states as input. The input tensors can either contain prefill tokens or decode tokens. The class does the following:
- MLA Preprocess.
- Perform multi-head attention to prefill tokens and multi-query attention to decode tokens separately.
- Return the output tensor.