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
bb517fe3
Unverified
Commit
bb517fe3
authored
Nov 04, 2025
by
Yuan Luo
Committed by
GitHub
Nov 04, 2025
Browse files
[HotFix] Disable torch dynamo for mrope_triton kernel (#12593)
Co-authored-by:
luoyuan.luo
<
luoyuan.luo@antgroup.com
>
parent
0e82fd3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
python/sglang/srt/layers/rotary_embedding.py
python/sglang/srt/layers/rotary_embedding.py
+26
-3
No files found.
python/sglang/srt/layers/rotary_embedding.py
View file @
bb517fe3
...
...
@@ -1302,6 +1302,31 @@ def triton_mrope(
return
q
,
k
@
torch
.
_dynamo
.
disable
()
def
triton_mrope_wrapper
(
query
,
key
,
cos
,
sin
,
mrope_section
,
head_size
,
rotary_dim
,
mrope_interleaved
,
is_neox_style
,
):
return
triton_mrope
(
query
,
key
,
cos
,
sin
,
mrope_section
,
head_size
,
rotary_dim
,
mrope_interleaved
,
is_neox_style
,
)
class
MRotaryEmbedding
(
RotaryEmbedding
):
"""Rotary Embedding with Multimodal Sections."""
...
...
@@ -1460,8 +1485,7 @@ class MRotaryEmbedding(RotaryEmbedding):
if
positions
.
ndim
==
2
:
assert
self
.
mrope_section
torch
.
_dynamo
.
graph_break
()
q
,
k
=
triton_mrope
(
q
,
k
=
triton_mrope_wrapper
(
query
,
key
,
cos
,
...
...
@@ -1472,7 +1496,6 @@ class MRotaryEmbedding(RotaryEmbedding):
self
.
mrope_interleaved
,
self
.
is_neox_style
,
)
torch
.
_dynamo
.
graph_break
()
return
q
.
reshape
(
query_shape
),
k
.
reshape
(
key_shape
)
...
...
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