From 285eaa42857ba2a8f377fdd0dcd84120260d8f65 Mon Sep 17 00:00:00 2001 From: Song Zhixin Date: Tue, 18 Nov 2025 18:53:44 +0800 Subject: [PATCH] [Bugfix] Safeguard against missing backend in AttentionBackendEnum (#28846) Signed-off-by: jesse Signed-off-by: Song Zhixin Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- vllm/attention/layer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/attention/layer.py b/vllm/attention/layer.py index 37f9a4b383ce9..a8e796a1eab63 100644 --- a/vllm/attention/layer.py +++ b/vllm/attention/layer.py @@ -310,7 +310,8 @@ class Attention(nn.Module, AttentionLayerBase): kv_sharing_target_layer_name, **extra_impl_args, ) - self.backend = AttentionBackendEnum[self.attn_backend.get_name()] + backend_name = self.attn_backend.get_name() + self.backend = AttentionBackendEnum.__members__.get(backend_name) self.dtype = dtype # For cuda-alike (CUDA and ROCM) and cpu platforms, we control how