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
c3c2903e
Unverified
Commit
c3c2903e
authored
Jun 13, 2024
by
Li, Jiang
Committed by
GitHub
Jun 12, 2024
Browse files
[Bugfix] Add device assertion to TorchSDPA (#5402)
parent
1a8bfd92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
vllm/attention/selector.py
vllm/attention/selector.py
+3
-0
No files found.
vllm/attention/selector.py
View file @
c3c2903e
...
@@ -58,6 +58,9 @@ def get_attn_backend(
...
@@ -58,6 +58,9 @@ def get_attn_backend(
ROCmFlashAttentionBackend
)
ROCmFlashAttentionBackend
)
return
ROCmFlashAttentionBackend
return
ROCmFlashAttentionBackend
elif
backend
==
_Backend
.
TORCH_SDPA
:
elif
backend
==
_Backend
.
TORCH_SDPA
:
# TODO: make XPU backend available here.
assert
is_cpu
(),
RuntimeError
(
"Torch SDPA backend is only used for the CPU device."
)
logger
.
info
(
"Using Torch SDPA backend."
)
logger
.
info
(
"Using Torch SDPA backend."
)
from
vllm.attention.backends.torch_sdpa
import
TorchSDPABackend
from
vllm.attention.backends.torch_sdpa
import
TorchSDPABackend
return
TorchSDPABackend
return
TorchSDPABackend
...
...
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