[Misc] Add --attention-backend auto option (#35738)

Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
Nicolò Lucchesi
2026-03-04 15:12:27 +00:00
committed by GitHub
parent 6cb901093f
commit 18e01a0a10
3 changed files with 54 additions and 9 deletions
+4 -7
View File
@@ -1816,13 +1816,10 @@ class EngineArgs:
"attention_backend and attention_config.backend "
"are mutually exclusive"
)
# Convert string to enum if needed (CLI parsing returns a string)
if isinstance(self.attention_backend, str):
attention_config.backend = AttentionBackendEnum[
self.attention_backend.upper()
]
else:
attention_config.backend = self.attention_backend
# Reuse the validator to handle "auto" and string-to-enum conversion
attention_config.backend = AttentionConfig.validate_backend_before(
self.attention_backend
)
# Kernel config overrides
kernel_config = copy.deepcopy(self.kernel_config)