File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
modelopt/torch/quantization Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -369,13 +369,13 @@ def postprocess(module):
369
369
for name , module in model .named_modules ():
370
370
if is_quantized_linear (module ):
371
371
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" )
373
373
continue
374
374
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 } " )
376
376
continue
377
377
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 } " )
379
379
continue
380
380
381
381
assert module .input_quantizer ._amax .numel () > 1 , (
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ def forward_loop(model):
108
108
for name , module in model .named_modules ():
109
109
if isinstance (module , TensorQuantizer ):
110
110
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 )
112
112
113
113
# TODO: Re-enable when the CUDA error: unspecified launch failure is fixed.
114
114
# clear_cuda_cache()
You can’t perform that action at this time.
0 commit comments