@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 699bca76c0
Fork 0

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 12, 14:45 UTC

[UX] Raise error for attn backend of batch invariant (#29348)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Nov 24, 2025 at 19:49 UTC 699bca76c00b81ba6c7ead38fed01712f5f56aa1
1 file changed +7 -7
vllm/model_executor/layers/batch_invariant.py
+7 -7
@@ -812,19 +812,19 @@ def override_envs_for_invariance():
812 # "TRITON_MLA",
813 ]
814 if curr_attn_backend not in supported_backends:
815 - warning = (
816 - "Forcibly updating attention backend to"
817 - f" {supported_backends[0]} for batch_invariant. "
818 - f" Supported backends: {supported_backends}."
815 + error = (
816 + "VLLM batch_invariant mode requires an attention backend in "
817 + f"{supported_backends}, but got '{curr_attn_backend}'. "
818 + "Please set the 'VLLM_ATTENTION_BACKEND' environment variable "
819 + "to one of the supported backends before enabling batch_invariant."
820 )
820 - logger.warning_once(warning)
821 - os.environ["VLLM_ATTENTION_BACKEND"] = supported_backends[0]
821 + raise RuntimeError(error)
822 if os.environ["VLLM_ATTENTION_BACKEND"] != supported_backends[0]:
823 warning = (
824 "You are using a decode-invariant form of batch invariance. "
825 "This will not be invariant between prefill and decode."
826 )
827 - logger.warning_once(warning)
827 + logger.warning_once(warning, scope="local")
828 os.environ["VLLM_ALLREDUCE_USE_SYMM_MEM"] = "0"
829
830 os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"