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
6c0a30bc
Commit
6c0a30bc
authored
Sep 10, 2025
by
zhuwenwen
Browse files
update flash-attn interface of apply_rotary_emb
parent
b0dfa004
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
1 deletion
+9
-1
vllm/model_executor/layers/rotary_embedding.py
vllm/model_executor/layers/rotary_embedding.py
+2
-0
vllm/model_executor/layers/rotary_embedding/common.py
vllm/model_executor/layers/rotary_embedding/common.py
+3
-1
vllm/model_executor/models/ernie45_vl.py
vllm/model_executor/models/ernie45_vl.py
+2
-0
vllm/model_executor/models/qwen2_vl.py
vllm/model_executor/models/qwen2_vl.py
+2
-0
No files found.
vllm/model_executor/layers/rotary_embedding.py
View file @
6c0a30bc
...
...
@@ -40,6 +40,8 @@ from vllm.platforms import current_platform
if
current_platform
.
is_cuda
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
if
current_platform
.
is_rocm
():
from
flash_attn.layers.rotary
import
apply_rotary_emb
def
_rotate_neox
(
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
...
...
vllm/model_executor/layers/rotary_embedding/common.py
View file @
6c0a30bc
...
...
@@ -9,6 +9,8 @@ from vllm.platforms import current_platform
if
current_platform
.
is_cuda
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
if
current_platform
.
is_rocm
():
from
flash_attn.layers.rotary
import
apply_rotary_emb
# common functions
...
...
vllm/model_executor/models/ernie45_vl.py
View file @
6c0a30bc
...
...
@@ -115,6 +115,8 @@ def apply_rotary_pos_emb_vision(t: torch.Tensor,
apply_rotary_emb
=
apply_rotary_emb_torch
if
current_platform
.
is_cuda
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
if
current_platform
.
is_rocm
():
from
flash_attn.layers.rotary
import
apply_rotary_emb
output
=
apply_rotary_emb
(
t_
,
cos
,
sin
).
type_as
(
t
)
return
output
...
...
vllm/model_executor/models/qwen2_vl.py
View file @
6c0a30bc
...
...
@@ -244,6 +244,8 @@ def apply_rotary_pos_emb_vision(t: torch.Tensor,
apply_rotary_emb
=
apply_rotary_emb_torch
if
current_platform
.
is_cuda
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
if
current_platform
.
is_rocm
():
from
flash_attn.layers.rotary
import
apply_rotary_emb
output
=
apply_rotary_emb
(
t_
,
cos
,
sin
).
type_as
(
t
)
return
output
...
...
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