From 8af13d1b106f58df1e98945a5e7c851ddb5f0791 Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Fri, 24 Mar 2023 11:57:12 -0700 Subject: [PATCH] Rename kVERSION_COMPATIBLE to kNATIVE_INSTANCENORM Signed-off-by: Kevin Chen --- NvOnnxParser.h | 10 +++++----- builtin_op_importers.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/NvOnnxParser.h b/NvOnnxParser.h index 8913ccf1..fcc93ce8 100644 --- a/NvOnnxParser.h +++ b/NvOnnxParser.h @@ -88,11 +88,11 @@ using OnnxParserFlags = uint32_t; enum class OnnxParserFlag : int32_t { - //! Parse the ONNX model into the INetworkDefinition with the intention of building a version-compatible engine in - //! TensorRT 8.6. This flag is planned to be deprecated in TensorRT 8.7, and removed in TensorRT 9.0. This will - //! choose TensorRT's native InstanceNormalization implementation over the plugin implementation. There may be - //! performance degradations when this flag is enabled. - kVERSION_COMPATIBLE = 0 + //! Parse the ONNX model into the INetworkDefinition with the intention of using TensorRT's native layer + //! implementation over the plugin implementation for InstanceNormalization nodes. This flag is planned to be + //! deprecated in TensorRT 8.7 and removed in TensorRT 9.0. This flag is required when building version-compatible + //! or hardware-compatible engines. There may be performance degradations when this flag is enabled. + kNATIVE_INSTANCENORM = 0 }; //! diff --git a/builtin_op_importers.cpp b/builtin_op_importers.cpp index 6a3bb3bc..abc60fd3 100644 --- a/builtin_op_importers.cpp +++ b/builtin_op_importers.cpp @@ -2204,11 +2204,11 @@ DEFINE_BUILTIN_OP_IMPORTER(ImageScaler) DEFINE_BUILTIN_OP_IMPORTER(InstanceNormalization) { - // Choose plugin implementation for non-VC engines, and native implementation - // for VC engines. + // Choose plugin implementation for non-VC and non-HC engines, and native implementation + // for VC and HC engines. auto flags = ctx->getFlags(); - uint32_t vcFlag = 1U << static_cast(nvonnxparser::OnnxParserFlag::kVERSION_COMPATIBLE); - if (flags & vcFlag) + uint32_t nativeInstanceNormFlag = 1U << static_cast(nvonnxparser::OnnxParserFlag::kNATIVE_INSTANCENORM); + if (flags & nativeInstanceNormFlag) { return normalizationHelper(ctx, node, inputs); }