[core/model] Use explicit model arch for Llama4 attention backend auto-selection (#24232)

This commit is contained in:
Lucia Fang
2026-05-01 15:49:30 -07:00
committed by GitHub
parent 8a530468fd
commit 05de73efd1
+5 -1
View File
@@ -81,6 +81,10 @@ MIMO_V2_MODEL_ARCHS = (
"MiMoV2ForCausalLM",
"MiMoV2FlashForCausalLM",
)
LLAMA4_MODEL_ARCHS = (
"Llama4ForConditionalGeneration",
"Llama4ForCausalLM",
)
SAMPLING_BACKEND_CHOICES = {"flashinfer", "pytorch", "ascend"}
@@ -2034,7 +2038,7 @@ class ServerArgs:
logger.warning(
"Disable hybrid SWA memory for Step3p5ForCausalLM model with hierarchical cache"
)
elif "Llama4" in model_arch and self.device != "cpu":
elif model_arch in LLAMA4_MODEL_ARCHS and self.device != "cpu":
# Auto-select attention backend for Llama4 if not specified
if self.attention_backend is None:
if is_sm100_supported():