Unverified Commit 285eaa42 authored by Song Zhixin's avatar Song Zhixin Committed by GitHub
Browse files

[Bugfix] Safeguard against missing backend in AttentionBackendEnum (#28846)


Signed-off-by: default avatarjesse <szxfml@gmail.com>
Signed-off-by: default avatarSong Zhixin <szxfml@gmail.com>
Co-authored-by: default avatargemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent 43936849
...@@ -310,7 +310,8 @@ class Attention(nn.Module, AttentionLayerBase): ...@@ -310,7 +310,8 @@ class Attention(nn.Module, AttentionLayerBase):
kv_sharing_target_layer_name, kv_sharing_target_layer_name,
**extra_impl_args, **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 self.dtype = dtype
# For cuda-alike (CUDA and ROCM) and cpu platforms, we control how # For cuda-alike (CUDA and ROCM) and cpu platforms, we control how
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment