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
b57d87c2
"vscode:/vscode.git/clone" did not exist on "b9a7f32674a28069a8d08a8bd544193b834977be"
Unverified
Commit
b57d87c2
authored
Jun 14, 2025
by
fzyzcjy
Committed by
GitHub
Jun 14, 2025
Browse files
Fix shared experts fusion + weight requant (#7177)
parent
98538822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+9
-8
No files found.
python/sglang/srt/models/deepseek_v2.py
View file @
b57d87c2
...
...
@@ -1960,14 +1960,15 @@ class DeepseekV2ForCausalLM(nn.Module):
)
if
layer_id
in
moe_layers
:
shared_experts
=
layer
.
mlp
.
shared_experts
for
module
in
[
shared_experts
.
gate_up_proj
,
shared_experts
.
down_proj
,
]:
requant_weight_ue8m0_inplace
(
module
.
weight
,
module
.
weight_scale_inv
,
weight_block_size
)
shared_experts
=
getattr
(
layer
.
mlp
,
"shared_experts"
,
None
)
if
shared_experts
is
not
None
:
for
module
in
[
shared_experts
.
gate_up_proj
,
shared_experts
.
down_proj
,
]:
requant_weight_ue8m0_inplace
(
module
.
weight
,
module
.
weight_scale_inv
,
weight_block_size
)
experts
=
layer
.
mlp
.
experts
if
isinstance
(
experts
,
DeepEPMoE
):
...
...
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