[Intel]Add 'intel_xpu' attention backend for llama4 (#11051)

This commit is contained in:
gaopengff
2025-11-07 02:33:41 +08:00
committed by GitHub
parent 2cb42dc184
commit 4cc725ac1c
2 changed files with 4 additions and 2 deletions

View File

@@ -1002,7 +1002,8 @@ class ServerArgs:
"aiter",
"triton",
"trtllm_mha",
}, "fa3, aiter, triton, or trtllm_mha is required for Llama4 model"
"intel_xpu",
}, "fa3, aiter, triton, trtllm_mha or intel_xpu is required for Llama4 model"
if is_sm100_supported() and self.attention_backend is None:
self.attention_backend = "trtllm_mha"
logger.warning(

View File

@@ -1831,7 +1831,8 @@ def get_device_capability(device_id: int = 0) -> Tuple[int, int]:
major, minor, *_ = torch.xpu.get_device_capability(device_id)["version"].split(
"."
)
major, minor = int(major), int(minor)
# Currently XPU version does not contain capability information.
major, minor = None, None
if hasattr(torch, "hpu") and torch.hpu.is_available():
try: