Skip to content

Commit 315d381

Browse files
committed
added logging statements
Signed-off-by: Suguna Velury <[email protected]>
1 parent 28073c8 commit 315d381

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/llm_qat/export.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from modelopt.torch.export.unified_export_hf import _export_hf_checkpoint
2626
from modelopt.torch.opt.conversion import restore_from_modelopt_state
2727
from modelopt.torch.quantization.utils import set_quantizer_state_dict
28+
from modelopt.torch.utils import print_rank_0
2829

2930
RAND_SEED = 1234
3031

@@ -46,12 +47,13 @@ def get_lora_model(
4647
# Restore modelopt state
4748
modelopt_state = torch.load(f"{ckpt_path}/modelopt_state_calib.pth", weights_only=False)
4849
restore_from_modelopt_state(model, modelopt_state)
50+
print_rank_0("Restored modelopt state")
4951

5052
# Restore modelopt quantizer state dict
5153
modelopt_weights = modelopt_state.pop("modelopt_state_weights", None)
5254
if modelopt_weights is not None:
53-
print("Restoring modelopt weights")
5455
set_quantizer_state_dict(model, modelopt_weights)
56+
print_rank_0("Restored modelopt quantizer state dict")
5557

5658
return model
5759

0 commit comments

Comments
 (0)