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
efedbe6c
"git@developer.sourcefind.cn:OpenDAS/nerfacc.git" did not exist on "29c59cab0228b91117b360cf5a5d9bf80ee38572"
Unverified
Commit
efedbe6c
authored
Sep 12, 2025
by
fzyzcjy
Committed by
GitHub
Sep 12, 2025
Browse files
Fix global input scale incompatible with CuTe DSL moe (#10370)
parent
3a77c80b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
python/sglang/srt/layers/quantization/modelopt_quant.py
python/sglang/srt/layers/quantization/modelopt_quant.py
+15
-0
No files found.
python/sglang/srt/layers/quantization/modelopt_quant.py
View file @
efedbe6c
...
...
@@ -1187,6 +1187,21 @@ class ModelOptNvFp4FusedMoEMethod(FusedMoEMethodBase):
if
self
.
enable_flashinfer_cutlass_moe
or
self
.
enable_flashinfer_trtllm_moe
:
w13_input_scale
=
layer
.
w13_input_scale
.
max
().
to
(
torch
.
float32
)
w2_input_scale
=
layer
.
w2_input_scale
.
max
().
to
(
torch
.
float32
)
elif
self
.
enable_flashinfer_cutedsl_moe
:
w13_input_scale
=
layer
.
w13_input_scale
.
max
(
dim
=
1
).
values
.
to
(
torch
.
float32
)
w2_input_scale
=
layer
.
w2_input_scale
def
_slice_scale
(
w
):
assert
w
.
shape
==
(
layer
.
num_experts
,)
assert
layer
.
moe_ep_size
*
layer
.
num_local_experts
==
layer
.
num_experts
return
w
[
layer
.
moe_ep_rank
*
layer
.
num_local_experts
:
(
layer
.
moe_ep_rank
+
1
)
*
layer
.
num_local_experts
]
w13_input_scale
=
_slice_scale
(
w13_input_scale
)
w2_input_scale
=
_slice_scale
(
w2_input_scale
)
else
:
w13_input_scale
=
layer
.
w13_input_scale
.
max
(
dim
=
1
).
values
.
to
(
torch
.
float32
)
w2_input_scale
=
layer
.
w2_input_scale
...
...
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