Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e4228dc
Change default from CUTLASS MLA to FlashInfer MLA
MatthewBonanni Jan 19, 2026
30cd686
Change log lines from debug to info
MatthewBonanni Jan 19, 2026
0b4c746
Merge remote-tracking branch 'upstream/main'
MatthewBonanni Jan 19, 2026
2cfba3b
First pass
MatthewBonanni Jan 19, 2026
5417186
Fix typo
MatthewBonanni Jan 19, 2026
c427ff8
Fix pre-commit
MatthewBonanni Jan 19, 2026
b80db7e
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Jan 29, 2026
370d66d
Use device_config
MatthewBonanni Jan 29, 2026
5151bd9
Remove dead code
MatthewBonanni Jan 30, 2026
6922185
Bump deprecation version
MatthewBonanni Jan 30, 2026
f0a0acd
Update docs
MatthewBonanni Jan 30, 2026
3dc0fba
Cleanup
MatthewBonanni Jan 30, 2026
0225644
Format name
MatthewBonanni Jan 30, 2026
8013037
Fix dagger inside quotes
MatthewBonanni Jan 30, 2026
6688a67
Add selector test
MatthewBonanni Jan 30, 2026
a962bee
Update table
MatthewBonanni Jan 30, 2026
25d976f
Comment
MatthewBonanni Jan 30, 2026
f30cb13
Add model dtype support
MatthewBonanni Jan 30, 2026
eb27ec8
Add type annotation to fix docs build
MatthewBonanni Jan 30, 2026
17c9a9e
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Feb 2, 2026
0f42a95
Fix rebase issue
MatthewBonanni Feb 2, 2026
97c9aa7
Introduce hashable config
MatthewBonanni Feb 2, 2026
fb7bead
Fix test
MatthewBonanni Feb 2, 2026
3b25d20
Pass device capability directly
MatthewBonanni Feb 2, 2026
0086b94
Fix hashing
MatthewBonanni Feb 2, 2026
5051737
Fix tests
MatthewBonanni Feb 3, 2026
115a75b
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Mar 16, 2026
88d0be8
Fix pre-commit
MatthewBonanni Mar 16, 2026
0cd22de
Clean up FA import
MatthewBonanni Mar 16, 2026
7bf5ae8
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Apr 2, 2026
d4c77ab
wip
LucasWilkinson Apr 7, 2026
2f0b2ad
cleanup
LucasWilkinson Apr 8, 2026
1d04d07
cleanup
LucasWilkinson Apr 9, 2026
9077fe2
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Apr 28, 2026
26d38ac
Fixes
MatthewBonanni Apr 28, 2026
f1f47f9
Fix pre-commit
MatthewBonanni Apr 28, 2026
de1c30f
Cleanup
MatthewBonanni Apr 28, 2026
b4be44d
Merge branch 'main' into mla_prefill_abstraction
MatthewBonanni Apr 29, 2026
6ca7954
Fix test
MatthewBonanni Apr 29, 2026
a8edfd1
Fix old flag handling
MatthewBonanni Apr 29, 2026
d75923c
Clean up
MatthewBonanni Apr 29, 2026
d71ddcf
FA4 default
MatthewBonanni Apr 30, 2026
37399f7
Clean up
MatthewBonanni Apr 30, 2026
0433138
Remove cuDNN
MatthewBonanni Apr 30, 2026
2255459
Eliminate metadata classes, cleanup
MatthewBonanni Apr 30, 2026
eada601
Merge impl into backend
MatthewBonanni Apr 30, 2026
8489336
Update docs
MatthewBonanni Apr 30, 2026
21874a4
Clean up
MatthewBonanni Apr 30, 2026
b14ba7e
Clean up
MatthewBonanni Apr 30, 2026
83d9580
Update test
MatthewBonanni May 1, 2026
7bf83a2
Fix test
MatthewBonanni May 1, 2026
710581e
Put the prefill backend in the metadata
MatthewBonanni May 1, 2026
f42e555
Merge branch 'main' into mla_prefill_abstraction
mergify[bot] May 1, 2026
0a1feb2
Fix test
MatthewBonanni May 1, 2026
f73e58b
Clean up and fix test
MatthewBonanni May 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions vllm/config/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from vllm.config.utils import config
from vllm.logger import init_logger
from vllm.v1.attention.backends.mla.prefill.registry import MLAPrefillBackendEnum
from vllm.v1.attention.backends.registry import AttentionBackendEnum

logger = init_logger(__name__)
Expand Down Expand Up @@ -48,6 +49,12 @@ class AttentionConfig:
disable_flashinfer_q_quantization: bool = False
"""If set, when using fp8 kv, do not quantize Q to fp8."""

mla_prefill_backend: MLAPrefillBackendEnum | None = None
"""MLA prefill backend to use. If None, will be selected automatically.
Valid options: FLASH_ATTN, FLASHINFER, CUDNN, TRTLLM_RAGGED.
This option supersedes use_cudnn_prefill, use_trtllm_ragged_deepseek_prefill,
and disable_flashinfer_prefill which are deprecated."""

def compute_hash(self) -> str:
"""
Provide a hash that uniquely identifies all the configs
Expand All @@ -70,6 +77,14 @@ def validate_backend_before(cls, value: Any) -> Any:
return AttentionBackendEnum[value.upper()]
return value

@field_validator("mla_prefill_backend", mode="before")
@classmethod
def validate_mla_prefill_backend_before(cls, value: Any) -> Any:
"""Enable parsing of the `mla_prefill_backend` enum type from string."""
if isinstance(value, str):
return MLAPrefillBackendEnum[value.upper()]
return value

def _set_from_env_if_set(self, field_name: str, env_var_name: str) -> None:
"""Set field from env var if set, with deprecation warning."""
from vllm import envs
Expand Down Expand Up @@ -112,3 +127,52 @@ def __post_init__(self) -> None:
"disable_flashinfer_q_quantization",
"VLLM_FLASHINFER_DISABLE_Q_QUANTIZATION",
)

# Migrate deprecated MLA prefill flags to mla_prefill_backend
self._migrate_deprecated_mla_prefill_flags()

def _migrate_deprecated_mla_prefill_flags(self) -> None:
"""Migrate deprecated MLA prefill flags to mla_prefill_backend."""
# If the new option is already set, it takes precedence
if self.mla_prefill_backend is not None:
return

# Check for deprecated flags and migrate them
deprecated_flag_used = False

if self.use_cudnn_prefill:
deprecated_flag_used = True
self.mla_prefill_backend = MLAPrefillBackendEnum.CUDNN
logger.warning_once(
"use_cudnn_prefill is deprecated and will be removed in "
"v0.16. Use --attention-config.mla_prefill_backend="
"CUDNN instead."
)

if self.use_trtllm_ragged_deepseek_prefill:
if deprecated_flag_used:
logger.warning_once(
"Multiple deprecated MLA prefill flags are set. "
"use_trtllm_ragged_deepseek_prefill will be ignored in "
"favor of use_cudnn_prefill. Use "
"--attention-config.mla_prefill_backend instead."
)
else:
deprecated_flag_used = True
self.mla_prefill_backend = MLAPrefillBackendEnum.TRTLLM_RAGGED
logger.warning_once(
"use_trtllm_ragged_deepseek_prefill is deprecated and "
"will be removed in v0.16. Use "
"--attention-config.mla_prefill_backend=TRTLLM_RAGGED "
"instead."
)

if self.disable_flashinfer_prefill and not deprecated_flag_used:
# disable_flashinfer_prefill means "use FLASH_ATTN instead"
# This is only relevant if no other backend was explicitly selected
self.mla_prefill_backend = MLAPrefillBackendEnum.FLASH_ATTN
logger.warning_once(
"disable_flashinfer_prefill is deprecated and will be removed "
"in v0.16. Use --attention-config.mla_prefill_backend="
"FLASH_ATTN instead."
)
Loading
Loading