Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
b1b5e045
Unverified
Commit
b1b5e045
authored
Feb 23, 2026
by
Yan Ma
Committed by
GitHub
Feb 23, 2026
Browse files
[XPU] allow TORCH_SDPA/TRITON_ATTN as XPU vit Backend (#35010)
Signed-off-by:
Yan Ma
<
yan.ma@intel.com
>
parent
5f68464f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
vllm/model_executor/layers/attention/mm_encoder_attention.py
vllm/model_executor/layers/attention/mm_encoder_attention.py
+11
-4
vllm/platforms/xpu.py
vllm/platforms/xpu.py
+1
-0
No files found.
vllm/model_executor/layers/attention/mm_encoder_attention.py
View file @
b1b5e045
...
...
@@ -249,7 +249,14 @@ class MMEncoderAttention(CustomOp):
cu_seqlens
:
torch
.
Tensor
|
None
=
None
,
max_seqlen
:
torch
.
Tensor
|
None
=
None
,
# Only used for Flash Attention
)
->
torch
.
Tensor
:
assert
self
.
is_flash_attn_backend
,
(
"XPU only supports FLASH_ATTN for vision attention."
)
return
self
.
_forward_fa
(
query
,
key
,
value
,
cu_seqlens
,
max_seqlen
)
if
self
.
attn_backend
==
AttentionBackendEnum
.
FLASH_ATTN
:
return
self
.
_forward_fa
(
query
,
key
,
value
,
cu_seqlens
,
max_seqlen
)
elif
self
.
attn_backend
==
AttentionBackendEnum
.
TRITON_ATTN
:
return
self
.
_forward_triton
(
query
,
key
,
value
,
cu_seqlens
,
max_seqlen
)
elif
self
.
attn_backend
==
AttentionBackendEnum
.
TORCH_SDPA
:
return
self
.
_forward_sdpa
(
query
,
key
,
value
,
cu_seqlens
)
else
:
raise
ValueError
(
f
"Unsupported multi-modal encoder attention backend for XPU: "
f
"
{
self
.
attn_backend
}
."
)
vllm/platforms/xpu.py
View file @
b1b5e045
...
...
@@ -89,6 +89,7 @@ class XPUPlatform(Platform):
def
get_supported_vit_attn_backends
(
cls
)
->
list
[
"AttentionBackendEnum"
]:
return
[
AttentionBackendEnum
.
FLASH_ATTN
,
AttentionBackendEnum
.
TRITON_ATTN
,
AttentionBackendEnum
.
TORCH_SDPA
,
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment