Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
4d0a1541
Unverified
Commit
4d0a1541
authored
May 30, 2025
by
Michael Goin
Committed by
GitHub
May 30, 2025
Browse files
[Bugfix] Remove NVFP4 scales assertions to fix load_format=dummy (#18861)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
77b6e74f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
vllm/model_executor/layers/quantization/modelopt.py
vllm/model_executor/layers/quantization/modelopt.py
+5
-3
vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py
...el_executor/layers/quantization/utils/marlin_utils_fp4.py
+6
-1
No files found.
vllm/model_executor/layers/quantization/modelopt.py
View file @
4d0a1541
...
@@ -585,9 +585,11 @@ class ModelOptNvFp4FusedMoE(FusedMoEMethodBase):
...
@@ -585,9 +585,11 @@ class ModelOptNvFp4FusedMoE(FusedMoEMethodBase):
def
process_weights_after_loading
(
self
,
layer
:
torch
.
nn
.
Module
)
->
None
:
def
process_weights_after_loading
(
self
,
layer
:
torch
.
nn
.
Module
)
->
None
:
# GEMM 1
# GEMM 1
assert
torch
.
allclose
(
if
not
torch
.
allclose
(
layer
.
w13_weight_scale_2
[:,
0
],
layer
.
w13_weight_scale_2
[:,
0
],
layer
.
w13_weight_scale_2
[:,
1
]),
(
layer
.
w13_weight_scale_2
[:,
1
]):
"w1_weight_scale_2 must match w3_weight_scale_2"
)
logger
.
warning_once
(
"w1_weight_scale_2 must match w3_weight_scale_2. "
"Accuracy may be affected."
)
w13_weight_scale_2
=
layer
.
w13_weight_scale_2
[:,
0
]
w13_weight_scale_2
=
layer
.
w13_weight_scale_2
[:,
0
]
layer
.
w13_weight_scale_2
=
Parameter
(
w13_weight_scale_2
,
layer
.
w13_weight_scale_2
=
Parameter
(
w13_weight_scale_2
,
...
...
vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py
View file @
4d0a1541
...
@@ -22,7 +22,12 @@ def is_fp4_marlin_supported():
...
@@ -22,7 +22,12 @@ def is_fp4_marlin_supported():
def
fp4_marlin_process_scales
(
marlin_scales
):
def
fp4_marlin_process_scales
(
marlin_scales
):
assert
(
marlin_scales
>=
0
).
all
()
if
not
(
marlin_scales
>=
0
).
all
():
logger
.
warning_once
(
"NVFP4 Marlin assumes the scales to be >=0, but has encountered "
"negative scales. Accuracy will likely be degraded. This is "
"because it changes the scales from FP8-S1E4M3 to a special "
"FP8-S0E5M3 format to speedup the dequantization."
)
# convert to half first, we would convert to fp8 later
# convert to half first, we would convert to fp8 later
marlin_scales
=
marlin_scales
.
to
(
torch
.
half
)
marlin_scales
=
marlin_scales
.
to
(
torch
.
half
)
...
...
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