Skip to content

Commit 32f8ec9

Browse files
committed
minor
1 parent 4623fb0 commit 32f8ec9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modelopt/torch/quantization/model_calib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,13 @@ def postprocess(module):
369369
for name, module in model.named_modules():
370370
if is_quantized_linear(module):
371371
if not hasattr(module.input_quantizer, "_amax"):
372-
print_rank_0(f"Warning: {name} is not calibrated, skip smoothing")
372+
warnings.warn(f"{name} is not calibrated, skip smoothing")
373373
continue
374374
if module.input_quantizer.num_bits != 8 or module.weight_quantizer.num_bits != 8:
375-
print_rank_0(f"Warning: only int8 smoothing is supported, skip {name}")
375+
warnings.warn(f"Only int8 smoothing is supported, skip {name}")
376376
continue
377377
if module.input_quantizer.axis != -1:
378-
print_rank_0(f"Warning: only per-channel smoothing is supported, skip {name}")
378+
warnings.warn(f"Only per-channel smoothing is supported, skip {name}")
379379
continue
380380

381381
assert module.input_quantizer._amax.numel() > 1, (

modelopt/torch/quantization/model_quant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def forward_loop(model):
108108
for name, module in model.named_modules():
109109
if isinstance(module, TensorQuantizer):
110110
for attr_name in ["_amax", "_bias", "_pre_quant_scale"]:
111-
module.validate_attr(attr_name=attr_name, raise_error=True, name=name)
111+
module.validate_attr(attr_name=attr_name, warn_error=True, name=name)
112112

113113
# TODO: Re-enable when the CUDA error: unspecified launch failure is fixed.
114114
# clear_cuda_cache()

0 commit comments

Comments
 (0)