Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
802815e4
Unverified
Commit
802815e4
authored
Jun 25, 2025
by
valarLip
Committed by
GitHub
Jun 25, 2025
Browse files
take aiter get_rope back (#7521)
parent
4c6675c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
python/sglang/srt/layers/rotary_embedding.py
python/sglang/srt/layers/rotary_embedding.py
+5
-1
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+0
-2
No files found.
python/sglang/srt/layers/rotary_embedding.py
View file @
802815e4
...
@@ -19,12 +19,15 @@ from sglang.srt.utils import (
...
@@ -19,12 +19,15 @@ from sglang.srt.utils import (
_is_cuda
=
is_cuda
()
_is_cuda
=
is_cuda
()
_is_hip
=
is_hip
()
_is_hip
=
is_hip
()
_use_aiter
=
get_bool_env_var
(
"SGLANG_USE_AITER"
)
and
_is_hip
_is_npu
=
is_npu
()
_is_npu
=
is_npu
()
_is_cpu_amx_available
=
cpu_has_amx_support
()
_is_cpu_amx_available
=
cpu_has_amx_support
()
_is_cpu
=
is_cpu
()
_is_cpu
=
is_cpu
()
if
_is_cuda
:
if
_is_cuda
:
from
sgl_kernel
import
apply_rope_with_cos_sin_cache_inplace
from
sgl_kernel
import
apply_rope_with_cos_sin_cache_inplace
if
_use_aiter
:
from
aiter.rotary_embedding
import
get_rope
as
aiter_get_rope
if
is_npu
():
if
is_npu
():
import
torch_npu
import
torch_npu
...
@@ -1428,7 +1431,8 @@ def get_rope_wrapper(
...
@@ -1428,7 +1431,8 @@ def get_rope_wrapper(
device
:
Optional
[
str
]
=
None
,
device
:
Optional
[
str
]
=
None
,
):
):
if
device
!=
"cpu"
:
if
device
!=
"cpu"
:
return
get_rope
(
wrapper
=
aiter_get_rope
if
_use_aiter
else
get_rope
return
wrapper
(
head_size
,
head_size
,
rotary_dim
,
rotary_dim
,
max_position
,
max_position
,
...
...
python/sglang/srt/models/deepseek_v2.py
View file @
802815e4
...
@@ -125,8 +125,6 @@ if _is_hip:
...
@@ -125,8 +125,6 @@ if _is_hip:
decode_attention_fwd_grouped_rope
,
decode_attention_fwd_grouped_rope
,
)
)
if
_use_aiter
:
from
aiter.rotary_embedding
import
get_rope
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
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