[Bug] fix(DummyModelLoader): run post_load_weights before process_weights_after_loading (#28665)

This commit is contained in:
Shu Wang
2026-06-19 22:57:45 +00:00
committed by GitHub
parent abf7011cdd
commit c3bae61e16
+6 -6
View File
@@ -1382,6 +1382,12 @@ class DummyModelLoader(BaseModelLoader):
quant_config,
)
# NOTE(woosuk): For accurate performance evaluation, we assign
# random values to the weights.
initialize_dummy_weights(model)
_post_load_weights(model)
for _, module in model.named_modules():
quant_method = getattr(module, "quant_method", None)
if quant_method is not None:
@@ -1393,12 +1399,6 @@ class DummyModelLoader(BaseModelLoader):
continue
quant_method.process_weights_after_loading(module)
# NOTE(woosuk): For accurate performance evaluation, we assign
# random values to the weights.
initialize_dummy_weights(model)
_post_load_weights(model)
return model.eval()