vllm.models.deepseek_v4_1.sparse_mla ¶
DeepSeek-V4.1 FlashMLA sparse backend, metadata, and metadata builders.
Classes:
-
DeepseekV41SparseSWAMetadataBuilder–SWA metadata builder base for v4.1.
-
DeepseekV4SparseMLABackend–DeepSeek-V4.1 sparse-MLA backend base.
DeepseekV41SparseSWAMetadataBuilder ¶
Bases: DeepseekSparseSWAMetadataBuilder
SWA metadata builder base for v4.1.
The shared builder classifies decode layer types by the v4.0 ratios (1 = SWA-only, 4, 128). v4.1 uses 0 / 1 / 2, so recompute the set of tile-scheduler plans from the v4.1 topology.
Source code in vllm/models/deepseek_v4_1/sparse_mla.py
DeepseekV4SparseMLABackend ¶
Bases: AttentionBackend
DeepSeek-V4.1 sparse-MLA backend base.
Subclasses AttentionBackend directly (not the V3.2 FlashMLASparseBackend): DeepSeek-V4.1 runs its own attention layer (DeepseekV4Attention), so it does not reuse the V3.2 builder or impl, and only needs to declare its own metadata builder, KV-cache layout, and the sparse-MLA capability flags.