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
48d8707e
Commit
48d8707e
authored
Oct 24, 2025
by
zhuwenwen
Browse files
use _apply_rotary_emb_torch for z100l&k100
parent
46dd30e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
vllm/model_executor/layers/rotary_embedding.py
vllm/model_executor/layers/rotary_embedding.py
+7
-3
No files found.
vllm/model_executor/layers/rotary_embedding.py
View file @
48d8707e
...
...
@@ -39,10 +39,11 @@ from vllm.model_executor.custom_op import CustomOp
from
vllm.platforms
import
current_platform
import
vllm.envs
as
envs
from
vllm.utils
import
direct_register_custom_op
from
vllm.utils
import
SUPPORT_TC
if
current_platform
.
is_cuda
():
from
vllm.vllm_flash_attn.layers.rotary
import
apply_rotary_emb
if
current_platform
.
is_rocm
():
if
current_platform
.
is_rocm
()
and
SUPPORT_TC
:
from
flash_attn.layers.rotary
import
apply_rotary_emb
...
...
@@ -91,10 +92,13 @@ def _apply_rotary_emb(x: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor,
positional embeddings.
"""
if
current_platform
.
is_cuda
():
if
SUPPORT_TC
:
return
apply_rotary_emb
(
x
.
unsqueeze
(
0
),
cos
,
sin
,
not
is_neox_style
).
squeeze
(
0
)
else
:
return
_apply_rotary_emb_torch
(
x
,
cos
,
sin
,
is_neox_style
)
else
:
return
_apply_rotary_emb_torch
(
x
,
cos
,
sin
,
is_neox_style
)
@
CustomOp
.
register
(
"rotary_embedding"
)
...
...
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