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
f9ecbb18
Unverified
Commit
f9ecbb18
authored
Dec 17, 2024
by
Isotr0py
Committed by
GitHub
Dec 17, 2024
Browse files
[Misc] Allow passing logits_soft_cap for xformers backend (#11252)
Signed-off-by:
Isotr0py
<
2037008807@qq.com
>
parent
02222a02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
vllm/attention/backends/xformers.py
vllm/attention/backends/xformers.py
+3
-5
No files found.
vllm/attention/backends/xformers.py
View file @
f9ecbb18
...
@@ -17,9 +17,7 @@ from vllm.attention.backends.utils import (
...
@@ -17,9 +17,7 @@ from vllm.attention.backends.utils import (
is_all_cross_attn_metadata_set
,
is_all_encoder_attn_metadata_set
)
is_all_cross_attn_metadata_set
,
is_all_encoder_attn_metadata_set
)
from
vllm.attention.ops.paged_attn
import
(
PagedAttention
,
from
vllm.attention.ops.paged_attn
import
(
PagedAttention
,
PagedAttentionMetadata
)
PagedAttentionMetadata
)
from
vllm.logger
import
init_logger
from
vllm.utils
import
print_warning_once
logger
=
init_logger
(
__name__
)
class
XFormersBackend
(
AttentionBackend
):
class
XFormersBackend
(
AttentionBackend
):
...
@@ -386,8 +384,8 @@ class XFormersImpl(AttentionImpl[XFormersMetadata]):
...
@@ -386,8 +384,8 @@ class XFormersImpl(AttentionImpl[XFormersMetadata]):
raise
ValueError
(
raise
ValueError
(
"XFormers does not support block-sparse attention."
)
"XFormers does not support block-sparse attention."
)
if
logits_soft_cap
is
not
None
:
if
logits_soft_cap
is
not
None
:
raise
ValueError
(
print_warning_once
(
"XFormers does not support logits soft cap. "
"XFormers does not support attention logits soft capping
."
)
"Outputs may be slightly off
."
)
self
.
num_heads
=
num_heads
self
.
num_heads
=
num_heads
self
.
head_size
=
head_size
self
.
head_size
=
head_size
self
.
scale
=
float
(
scale
)
self
.
scale
=
float
(
scale
)
...
...
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