Skip to content

Commit d7a136f

Browse files
committed
Added warning for void flag
Signed-off-by: gcunhase <[email protected]>
1 parent 35462a7 commit d7a136f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modelopt/onnx/quantization/quantize.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,16 @@ def quantize(
426426
quantize_mode,
427427
)
428428
trt_plugins = update_trt_ep_support(calibration_eps, has_dds_op, has_custom_op, trt_plugins) # type: ignore[arg-type]
429+
430+
# Update list with op types to exclude from FP16/BF16 conversion
429431
op_types_to_exclude_fp16 = list(
430432
dict.fromkeys((op_types_to_exclude_fp16 or []) + list(custom_ops_to_cast_fp32.keys()))
431433
)
434+
if high_precision_dtype == "fp32" and op_types_to_exclude_fp16:
435+
logger.warning(
436+
"Nodes were detected for exclusion from FP16/BF16 conversion, but 'high_precision_dtype' is set to FP32. "
437+
"Since the model won't be converted to a lower precision, this flag is void."
438+
)
432439

433440
# Use random scales if calibration data is not supplied
434441
if calibration_data is None:

0 commit comments

Comments
 (0)