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
4d53d14c
Commit
4d53d14c
authored
Sep 09, 2025
by
zhuwenwen
Browse files
update flash-attn interface to support keye
parent
a5f106eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
vllm/model_executor/models/keye.py
vllm/model_executor/models/keye.py
+5
-1
No files found.
vllm/model_executor/models/keye.py
View file @
4d53d14c
...
...
@@ -54,6 +54,7 @@ from .utils import (AutoWeightsLoader, WeightsMapper,
init_vllm_registered_model
,
is_pp_missing_parameter
,
maybe_prefix
,
merge_multimodal_embeddings
)
from
.vision
import
get_vit_attn_backend
from
vllm.platforms
import
current_platform
logger
=
init_logger
(
__name__
)
...
...
@@ -330,7 +331,10 @@ def apply_rotary_pos_emb_flashatt(
cos
=
cos
.
chunk
(
2
,
dim
=-
1
)[
0
].
contiguous
()
sin
=
sin
.
chunk
(
2
,
dim
=-
1
)[
0
].
contiguous
()
if
not
current_platform
.
is_rocm
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
else
:
from
flash_attn.layers.rotary
import
apply_rotary_emb
q_embed
=
apply_rotary_emb
(
q
.
float
(),
cos
.
float
(),
sin
.
float
()).
type_as
(
q
)
k_embed
=
apply_rotary_emb
(
k
.
float
(),
cos
.
float
(),
sin
.
float
()).
type_as
(
k
)
...
...
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