Skip to content

Commit 4088baf

Browse files
Edwardf0t1kevalmorabia97
authored andcommitted
Bugfix for bmm style expert nvfp4 weight scale export (#384)
Signed-off-by: Zhiyu Cheng <[email protected]>
1 parent 71d1036 commit 4088baf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modelopt/torch/export/unified_export_hf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ def _export_quantized_weight(
332332

333333
setattr(sub_module, weight_name, nn.Parameter(quantized_weight, requires_grad=False))
334334

335+
# Register the corrected weight_scale as a buffer
336+
if weight_scale is not None:
337+
sub_module.register_buffer(quantizer_attrs.weight_scale, weight_scale)
338+
335339

336340
def _export_hf_checkpoint(
337341
model: nn.Module, dtype: torch.dtype | None = None

0 commit comments

Comments
 (0)