Skip to content

Commit a4c8511

Browse files
committed
Merge branch 'master' of https://github.com/NVIDIA/TRTorch
Signed-off-by: Naren Dasan <[email protected]>
2 parents e1c5416 + bbcf2ca commit a4c8511

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/conversion/conversionctx/ConversionCtx.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ std::ostream& operator<<(std::ostream& os, const BuilderSettings& s) {
1313
<< "\n Operating Precision: " << s.op_precision \
1414
<< "\n Make Refittable Engine: " << s.refit \
1515
<< "\n Debuggable Engine: " << s.debug \
16-
<< "\n Strict Type: " << s.strict_types \
16+
<< "\n Strict Types: " << s.strict_types \
1717
<< "\n Allow GPU Fallback (if running on DLA): " << s.allow_gpu_fallback \
1818
<< "\n Min Timing Iterations: " << s.num_min_timing_iters \
1919
<< "\n Avg Timing Iterations: " << s.num_avg_timing_iters \
@@ -51,7 +51,9 @@ ConversionCtx::ConversionCtx(BuilderSettings build_settings)
5151
case nvinfer1::DataType::kINT8:
5252
TRTORCH_CHECK(builder->platformHasFastInt8(), "Requested inference in INT8 but platform does support INT8");
5353
cfg->setFlag(nvinfer1::BuilderFlag::kINT8);
54-
cfg->setFlag(nvinfer1::BuilderFlag::kFP16);
54+
if (!settings.strict_types) {
55+
cfg->setFlag(nvinfer1::BuilderFlag::kFP16);
56+
}
5557
input_type = nvinfer1::DataType::kFLOAT;
5658
TRTORCH_CHECK(settings.calibrator != nullptr, "Requested inference in INT8 but no calibrator provided, set the ptq_calibrator field in the ExtraInfo struct with your calibrator");
5759
cfg->setInt8Calibrator(settings.calibrator);

0 commit comments

Comments
 (0)