[Attention][MiniMax-M3] Add MSA speculative decode verification (#50032)
This commit is contained in:
@@ -11,6 +11,7 @@ from vllm.v1.attention.backends.mla.prefill.registry import MLAPrefillBackendEnu
|
||||
from vllm.v1.attention.backends.registry import AttentionBackendEnum
|
||||
|
||||
IndexerKVDType = Literal["bf16", "fp8", "mxfp4", "nvfp4"]
|
||||
MiniMaxM3MSADecodeBackend = Literal["triton", "cutlass"]
|
||||
|
||||
|
||||
@config
|
||||
@@ -20,6 +21,9 @@ class AttentionConfig:
|
||||
backend: AttentionBackendEnum | None = None
|
||||
"""Attention backend to use. Use "auto" or None for automatic selection."""
|
||||
|
||||
minimax_m3_msa_decode_backend: MiniMaxM3MSADecodeBackend = "triton"
|
||||
"""Sparse decode kernel used by the MiniMax M3 MSA backend."""
|
||||
|
||||
backend_per_kind: dict[str, AttentionBackendEnum] = field(default_factory=dict)
|
||||
"""Per-KV-cache-group attention backend overrides, keyed by
|
||||
`KVCacheSpecKind` (e.g. `{"mla_attention": "FLASHINFER_MLA",
|
||||
@@ -99,6 +103,17 @@ class AttentionConfig:
|
||||
PyTorch >= 2.9, and 128 for encoder-only attention or older PyTorch
|
||||
versions."""
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
msa_aliases: dict[AttentionBackendEnum, MiniMaxM3MSADecodeBackend] = {
|
||||
AttentionBackendEnum.CUTLASS_MSA: "cutlass",
|
||||
AttentionBackendEnum.TRITON_MSA: "triton",
|
||||
}
|
||||
if self.backend in msa_aliases:
|
||||
self.minimax_m3_msa_decode_backend = msa_aliases[self.backend]
|
||||
# The alias selects only MiniMax's sparse decode kernel. Dense
|
||||
# layers still use the platform's normal automatic backend.
|
||||
self.backend = None
|
||||
|
||||
def compute_hash(self) -> str:
|
||||
"""
|
||||
Provide a hash that uniquely identifies all the configs
|
||||
|
||||
Reference in New Issue
Block a user