A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 01:45 UTC
[Bug] Raise error explicitly if using incompatible backend (#27424)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Oct 29, 2025 at 13:29 UTC
5b0448104fa16ca28711e715f4866d9b2805f171
1 file changed
+15
vllm/platforms/cuda.py
+15
@@ -261,6 +261,21 @@ class CudaPlatformBase(Platform):
261
from vllm.attention.backends.registry import _Backend
262
263
if use_mla:
264
+ # explicitly reject non-MLA backends when MLA is enabled to avoid
265
+ # silently selecting an incompatible backend (e.g., FLASHINFER).
266
+ if selected_backend in {
267
+ _Backend.FLASHINFER,
268
+ _Backend.FLASH_ATTN,
269
+ _Backend.TRITON_ATTN,
270
+ _Backend.TREE_ATTN,
271
+ _Backend.XFORMERS,
272
+ }:
273
+ raise ValueError(
274
+ f"Attention backend {selected_backend} incompatible with MLA. "
275
+ "Please use one of the MLA backends: FLASHINFER_MLA, CUTLASS_MLA, "
276
+ "FLASHMLA, FLASH_ATTN_MLA, or TRITON_MLA. Alternatively, set "
277
+ "VLLM_MLA_DISABLE=1 to disable MLA for this model."
278
+ )
279
if not use_v1:
280
raise RuntimeError(
281
"MLA attention backends require the V1 engine. "