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
e028af69
Unverified
Commit
e028af69
authored
Oct 22, 2025
by
Xun Sun
Committed by
GitHub
Oct 22, 2025
Browse files
Fix mooncake dispatcher (#11908)
parent
80b2b320
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
python/sglang/srt/layers/moe/fused_moe_triton/layer.py
python/sglang/srt/layers/moe/fused_moe_triton/layer.py
+1
-1
python/sglang/srt/layers/moe/token_dispatcher/mooncake.py
python/sglang/srt/layers/moe/token_dispatcher/mooncake.py
+7
-1
No files found.
python/sglang/srt/layers/moe/fused_moe_triton/layer.py
View file @
e028af69
...
@@ -86,7 +86,7 @@ def create_moe_dispatcher(moe_runner_config: MoeRunnerConfig) -> BaseDispatcher:
...
@@ -86,7 +86,7 @@ def create_moe_dispatcher(moe_runner_config: MoeRunnerConfig) -> BaseDispatcher:
a2a_backend
=
get_moe_a2a_backend
()
a2a_backend
=
get_moe_a2a_backend
()
if
a2a_backend
.
is_none
():
if
a2a_backend
.
is_none
():
return
StandardDispatcher
(
moe_runner_config
)
return
StandardDispatcher
(
moe_runner_config
)
elif
a2a_backend
.
is_deepep
():
elif
a2a_backend
.
is_deepep
()
or
a2a_backend
.
is_mooncake
()
:
return
MaybeTboDeepEPDispatcher
(
return
MaybeTboDeepEPDispatcher
(
group
=
get_tp_group
().
device_group
,
group
=
get_tp_group
().
device_group
,
router_topk
=
moe_runner_config
.
top_k
,
router_topk
=
moe_runner_config
.
top_k
,
...
...
python/sglang/srt/layers/moe/token_dispatcher/mooncake.py
View file @
e028af69
...
@@ -36,7 +36,7 @@ class MooncakeDispatchOutput(NamedTuple):
...
@@ -36,7 +36,7 @@ class MooncakeDispatchOutput(NamedTuple):
"""Mooncake EP dispatch output."""
"""Mooncake EP dispatch output."""
hidden_states
:
torch
.
Tensor
hidden_states
:
torch
.
Tensor
hidden_states_scale
:
torch
.
Tensor
hidden_states_scale
:
Optional
[
torch
.
Tensor
]
topk_ids
:
torch
.
Tensor
topk_ids
:
torch
.
Tensor
topk_weights
:
torch
.
Tensor
topk_weights
:
torch
.
Tensor
masked_m
:
torch
.
Tensor
masked_m
:
torch
.
Tensor
...
@@ -205,8 +205,14 @@ class _MooncakeEPDispatcherImpl:
...
@@ -205,8 +205,14 @@ class _MooncakeEPDispatcherImpl:
masked_m
masked_m
)
)
if
isinstance
(
hidden_states
,
tuple
):
hidden_states
,
hidden_states_scale
=
hidden_states
else
:
hidden_states_scale
=
None
return
MooncakeDispatchOutput
(
return
MooncakeDispatchOutput
(
hidden_states
,
hidden_states
,
hidden_states_scale
,
topk_ids
,
topk_ids
,
topk_weights
,
topk_weights
,
masked_m
,
masked_m
,
...
...
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