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
7df2c0c2
Unverified
Commit
7df2c0c2
authored
Jul 29, 2025
by
fzyzcjy
Committed by
GitHub
Jul 28, 2025
Browse files
Reduce memory usage for fp4 moe (#8413)
parent
69712e6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
python/sglang/srt/layers/quantization/modelopt_quant.py
python/sglang/srt/layers/quantization/modelopt_quant.py
+2
-0
No files found.
python/sglang/srt/layers/quantization/modelopt_quant.py
View file @
7df2c0c2
...
@@ -900,6 +900,7 @@ class ModelOptNvFp4FusedMoEMethod(FusedMoEMethodBase):
...
@@ -900,6 +900,7 @@ class ModelOptNvFp4FusedMoEMethod(FusedMoEMethodBase):
layer
.
w13_blockscale_swizzled
=
Parameter
(
layer
.
w13_blockscale_swizzled
=
Parameter
(
w13_blockscale_swizzled
,
requires_grad
=
False
w13_blockscale_swizzled
,
requires_grad
=
False
)
)
del
layer
.
w13_weight_scale
# This is for quantization, so we need to invert it.
# This is for quantization, so we need to invert it.
layer
.
w13_input_scale_quant
=
Parameter
(
layer
.
w13_input_scale_quant
=
Parameter
(
...
@@ -935,6 +936,7 @@ class ModelOptNvFp4FusedMoEMethod(FusedMoEMethodBase):
...
@@ -935,6 +936,7 @@ class ModelOptNvFp4FusedMoEMethod(FusedMoEMethodBase):
layer
.
w2_blockscale_swizzled
=
Parameter
(
layer
.
w2_blockscale_swizzled
=
Parameter
(
w2_blockscale_swizzled
,
requires_grad
=
False
w2_blockscale_swizzled
,
requires_grad
=
False
)
)
del
layer
.
w2_weight_scale
layer
.
w2_weight
=
Parameter
(
layer
.
w2_weight
.
data
,
requires_grad
=
False
)
layer
.
w2_weight
=
Parameter
(
layer
.
w2_weight
.
data
,
requires_grad
=
False
)
device
=
layer
.
w13_weight
.
device
device
=
layer
.
w13_weight
.
device
...
...
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