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
a589a071
Unverified
Commit
a589a071
authored
Jul 20, 2025
by
Atream
Committed by
GitHub
Jul 19, 2025
Browse files
fix moe gate dtype, fix tbo, fix fake dispatch (#7825)
parent
f62d75b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
python/sglang/srt/eplb/expert_location_dispatch.py
python/sglang/srt/eplb/expert_location_dispatch.py
+1
-1
python/sglang/srt/layers/moe/topk.py
python/sglang/srt/layers/moe/topk.py
+1
-1
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+1
-1
No files found.
python/sglang/srt/eplb/expert_location_dispatch.py
View file @
a589a071
...
...
@@ -66,7 +66,7 @@ def transform_select_experts_inputs(
info
:
Optional
[
ExpertLocationDispatchInfo
],
):
if
(
info
is
not
None
)
and
(
info
.
ep_dispatch_algorithm
==
"fake"
):
router_logits
=
torch
.
randn_like
(
router_logits
)
router_logits
.
uniform_
(
5
,
10
)
if
correction_bias
is
not
None
:
correction_bias
=
torch
.
zeros_like
(
correction_bias
)
return
router_logits
,
correction_bias
...
...
python/sglang/srt/layers/moe/topk.py
View file @
a589a071
...
...
@@ -499,7 +499,7 @@ def biased_grouped_topk_gpu(
and
is_power_of_two
(
correction_bias
.
shape
[
0
])
):
topk_weights
,
topk_ids
=
moe_fused_gate
(
gating_output
,
gating_output
.
to
(
dtype
=
torch
.
float32
)
,
correction_bias
,
num_expert_group
,
topk_group
,
...
...
python/sglang/srt/models/deepseek_v2.py
View file @
a589a071
...
...
@@ -229,7 +229,7 @@ class MoEGate(nn.Module):
)
if
config
.
topk_method
==
"noaux_tc"
:
self
.
e_score_correction_bias
=
nn
.
Parameter
(
torch
.
empty
((
config
.
n_routed_experts
))
torch
.
empty
((
config
.
n_routed_experts
)
,
dtype
=
torch
.
float32
)
)
else
:
self
.
e_score_correction_bias
=
None
...
...
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