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
5e0a9b09
Unverified
Commit
5e0a9b09
authored
Apr 15, 2025
by
Ke Bao
Committed by
GitHub
Apr 14, 2025
Browse files
Apply deepseek cuda rope (#5385)
Co-authored-by:
Yineng Zhang
<
me@zhyncs.com
>
parent
bdde2375
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
python/sglang/srt/layers/rotary_embedding.py
python/sglang/srt/layers/rotary_embedding.py
+12
-1
No files found.
python/sglang/srt/layers/rotary_embedding.py
View file @
5e0a9b09
...
@@ -645,7 +645,18 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbedding):
...
@@ -645,7 +645,18 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbedding):
cache
=
torch
.
cat
((
cos
,
sin
),
dim
=-
1
)
cache
=
torch
.
cat
((
cos
,
sin
),
dim
=-
1
)
return
cache
return
cache
def
forward
(
def
forward_hip
(
self
,
*
args
,
**
kwargs
):
return
self
.
forward_native
(
*
args
,
**
kwargs
)
def
forward
(
self
,
*
args
,
**
kwargs
):
if
torch
.
_dynamo
.
is_compiling
:
return
self
.
forward_native
(
*
args
,
**
kwargs
)
if
_is_cuda_available
:
return
self
.
forward_cuda
(
*
args
,
**
kwargs
)
else
:
return
self
.
forward_native
(
*
args
,
**
kwargs
)
def
forward_native
(
self
,
self
,
positions
:
torch
.
Tensor
,
positions
:
torch
.
Tensor
,
query
:
torch
.
Tensor
,
query
:
torch
.
Tensor
,
...
...
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