[AZ-180] Fix INT8 conversion: set FP16 flag alongside INT8 for TensorRT 10.x

In TensorRT 10.x, INT8 conversion requires FP16 to be set as a fallback for
network layers (e.g. normalization ops in detection models) that have no INT8
kernel implementation. Without FP16, build_serialized_network can return None
on Jetson for YOLO-type models. INT8 flag is still the primary precision;
FP16 is only the layer-level fallback within the same engine.

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-02 07:32:16 +03:00
parent 7a7f2a4cdd
commit 3984507221
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -158,6 +158,8 @@ cdef class TensorRTEngine(InferenceEngine):
constants_inf.log(<str>'Converting to INT8 with calibration cache')
calibrator = _CacheCalibrator(calib_cache_path)
config.set_flag(trt.BuilderFlag.INT8)
if builder.platform_has_fast_fp16:
config.set_flag(trt.BuilderFlag.FP16)
config.int8_calibrator = calibrator
elif builder.platform_has_fast_fp16:
constants_inf.log(<str>'Converting to supported fp16')