Skip to content

Commit 3775e49

Browse files
authored
Staging for the 10.4-GA release (#995)
Signed-off-by: poweiw <[email protected]>
1 parent efd73c8 commit 3775e49

16 files changed

+455
-353
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ add_definitions("-DSOURCE_LENGTH=${SOURCE_LENGTH}")
2828
# Version information
2929
#--------------------------------------------------
3030
set(ONNX2TRT_MAJOR 10)
31-
set(ONNX2TRT_MINOR 3)
31+
set(ONNX2TRT_MINOR 4)
3232
set(ONNX2TRT_PATCH 0)
3333
set(ONNX2TRT_VERSION "${ONNX2TRT_MAJOR}.${ONNX2TRT_MINOR}.${ONNX2TRT_PATCH}" CACHE STRING "ONNX2TRT version")
3434

ImporterContext.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ void ImporterContext::registerLayer(nvinfer1::ILayer* layer, std::string const&
134134
mConstantLayers.insert({uniqueName, static_cast<nvinfer1::IConstantLayer*>(layer)});
135135
}
136136
}
137-
if (node != nullptr && layer != nullptr)
137+
// Set metadata only if the layer is associated with an ONNX node.
138+
// Skip constant layers because constants are represented as initializers in ONNX and should not be associated
139+
// with any ONNX node.
140+
if (node != nullptr && layer != nullptr && layer->getType() != nvinfer1::LayerType::kCONSTANT)
138141
{
139142
processMetadata(this, *node, layer);
140143
}

ModelImporter.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,17 @@ Status importLocalFunctions(ImporterContext* ctx, ::ONNX_NAMESPACE::ModelProto c
439439
return Status::success();
440440
}
441441

442+
// Internal helper function used for ONNXRT-TRT EP to filter out DDS nodes
443+
bool isDDSOp(char const* op_name)
444+
{
445+
auto is = [op_name](char const* name) { return std::strcmp(op_name, name) == 0; };
446+
if (is("NonMaxSuppression") || is("NonZero") || is("RoiAlign"))
447+
{
448+
return true;
449+
}
450+
return false;
451+
}
452+
442453
std::pair<bool, ModelImporter::SubGraphSupportVector_t> ModelImporter::doSupportsModel(
443454
void const* serialized_onnx_model, size_t serialized_onnx_model_size, char const* model_path)
444455
{
@@ -514,9 +525,10 @@ std::pair<bool, ModelImporter::SubGraphSupportVector_t> ModelImporter::doSupport
514525
// 1. It is not a node that requires DDS
515526
// 2. It is not directly connected to an unsupported input
516527
// 3. The importer function did not throw an assertion
528+
bool unsupportedDDS = isDDSOp(node.op_type().c_str());
517529
bool unsupportedInput = (input_node.empty()) ? false : checkForInput(node);
518530
bool unsuccessfulParse = node_idx == error_node;
519-
if (!unsupportedInput && !unsuccessfulParse)
531+
if (!unsupportedDDS && !unsupportedInput && !unsuccessfulParse)
520532
{
521533
if (newSubGraph)
522534
{

ModelRefitter.cpp

+69-109
Large diffs are not rendered by default.

ModelRefitter.hpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ class ModelRefitter : public nvonnxparser::IParserRefitter
6060
//! TConvertFunc is a functor for converting ShapedWeights to an array of type T.
6161
//! It should return a T*.
6262
template <typename T, typename TConvertFunc>
63-
ValueOrStatus<size_t> batchnormWeightRefitter(
63+
size_t batchnormWeightRefitter(
6464
::ONNX_NAMESPACE::NodeProto const& node, std::vector<ShapedWeights>& inputs, TConvertFunc&& f);
6565

66-
Status refitOnnxWeights(::ONNX_NAMESPACE::ModelProto const& onnx_model);
67-
Status refitOnnxGraph(::ONNX_NAMESPACE::GraphProto const& graph);
68-
Status refitOnnxNode(::ONNX_NAMESPACE::NodeProto const& node, ::ONNX_NAMESPACE::GraphProto const& graph);
69-
Status refitOnnxConstantNode(::ONNX_NAMESPACE::NodeProto const& node, std::string const& graphName);
70-
Status refitOnnxBatchNormNode(::ONNX_NAMESPACE::NodeProto const& node, ::ONNX_NAMESPACE::GraphProto const& graph);
71-
Status refitOnnxIfNode(::ONNX_NAMESPACE::NodeProto const& node);
72-
Status refitOnnxLoopNode(::ONNX_NAMESPACE::NodeProto const& node);
73-
Status refitOnnxScanNode(::ONNX_NAMESPACE::NodeProto const& node);
66+
void refitOnnxWeights(::ONNX_NAMESPACE::ModelProto const& onnx_model);
67+
void refitOnnxGraph(::ONNX_NAMESPACE::GraphProto const& graph);
68+
void refitOnnxNode(::ONNX_NAMESPACE::NodeProto const& node, ::ONNX_NAMESPACE::GraphProto const& graph);
69+
void refitOnnxConstantNode(::ONNX_NAMESPACE::NodeProto const& node, std::string const& graphName);
70+
void refitOnnxBatchNormNode(::ONNX_NAMESPACE::NodeProto const& node, ::ONNX_NAMESPACE::GraphProto const& graph);
71+
void refitOnnxIfNode(::ONNX_NAMESPACE::NodeProto const& node);
72+
void refitOnnxLoopNode(::ONNX_NAMESPACE::NodeProto const& node);
73+
void refitOnnxScanNode(::ONNX_NAMESPACE::NodeProto const& node);
7474

7575
public:
7676
ModelRefitter(nvinfer1::IRefitter* refitter, nvinfer1::ILogger* logger)

OnnxAttrs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ onnx2trt::ShapedWeights OnnxAttrs::get<onnx2trt::ShapedWeights>(std::string cons
129129
std::string extName = this->at(key)->ref_attr_name();
130130
bool isExtAttr = isExternalAttribute(extName, mCtx);
131131

132-
::ONNX_NAMESPACE::TensorProto const& onnx_weights_tensor = isExtAttr ? mCtx->localFunctionStack().back().second.at(extName)->t() : this->at(key)->t();
132+
::ONNX_NAMESPACE::TensorProto const& onnxTensor = isExtAttr ? mCtx->localFunctionStack().back().second.at(extName)->t() : this->at(key)->t();
133133
onnx2trt::ShapedWeights weights;
134-
bool success = mCtx->getWeightsContext().convertOnnxWeights(onnx_weights_tensor, &weights);
134+
bool success = mCtx->getWeightsContext().convertOnnxWeights(onnxTensor, &weights, true);
135135
if (!success)
136136
{
137137
throw std::runtime_error{"Unable to convert ONNX weights"};

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For press and other inquiries, please contact Hector Marinez at hmarinez@nvidia.
1616

1717
## Supported TensorRT Versions
1818

19-
Development on the this branch is for the latest version of [TensorRT 10.2](https://developer.nvidia.com/nvidia-tensorrt-download) with full-dimensions and dynamic shape support.
19+
Development on the this branch is for the latest version of [TensorRT 10.4](https://developer.nvidia.com/nvidia-tensorrt-download) with full-dimensions and dynamic shape support.
2020

2121
For previous versions of TensorRT, refer to their respective branches.
2222

@@ -29,8 +29,8 @@ Current supported ONNX operators are found in the [operator support matrix](docs
2929
### Dependencies
3030

3131
- [Protobuf >= 3.0.x](https://github.com/google/protobuf/releases)
32-
- [TensorRT 10.2](https://developer.nvidia.com/tensorrt)
33-
- [TensorRT 10.2 open source libaries] (https://github.com/NVIDIA/TensorRT/)
32+
- [TensorRT 10.4](https://developer.nvidia.com/tensorrt)
33+
- [TensorRT 10.4 open source libaries] (https://github.com/NVIDIA/TensorRT/)
3434

3535
### Building
3636

@@ -82,7 +82,7 @@ Refer to the link or run `polygraphy run -h` for more information on CLI options
8282

8383
Python bindings for the ONNX-TensorRT parser are packaged in the shipped `.whl` files.
8484

85-
TensorRT 10.1 supports ONNX release 1.16.0. Install it with:
85+
TensorRT 10.4 supports ONNX release 1.16.0. Install it with:
8686

8787
python3 -m pip install onnx==1.16.0
8888

ShapeTensor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ nvinfer1::ISliceLayer* addSlice(ImporterContext* ctx, nvinfer1::ITensor& data, c
542542
constexpr int32_t minDim = std::numeric_limits<int32_t>::min();
543543
constexpr int32_t maxDim = std::numeric_limits<int32_t>::max();
544544
nvinfer1::ISliceLayer* slice = N_CHECK(ctx->network()->addSlice(data,
545-
shapeTensorToDims(starts, "slice start", 0, maxDim), shapeTensorToDims(sizes, "slice size", 0, maxDim),
545+
shapeTensorToDims(starts, "slice start", minDim, maxDim), shapeTensorToDims(sizes, "slice size", 0, maxDim),
546546
shapeTensorToDims(strides, "slide strides", minDim, maxDim)));
547547
setShapeInputIfDynamic(ctx, slice, 1, starts);
548548
setShapeInputIfDynamic(ctx, slice, 2, sizes);

Status.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ static std::ostream& operator<<(std::ostream& stream, nvinfer1::DataType const&
203203
case nvinfer1::DataType::kBOOL: return stream << "bool";
204204
case nvinfer1::DataType::kFP8: return stream << "float8";
205205
case nvinfer1::DataType::kINT4: return stream << "int4";
206+
206207
default: throw std::runtime_error("Unknown dtype");
207208
}
208209
}

docs/Changelog.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
# ONNX-TensorRT Changelog
44

5+
# TensorRT 10.4 GA Release - 2024-9-5
6+
For more details, see the 10.4 GA release notes.
7+
8+
- Added support for tensor `axes` for `Pad` operations
9+
- Added support for `BlackmanWindow`, `HammingWindow`, and `HannWindow` operations
10+
- Improved error handling in `IParserRefitter`
11+
- Fixed kernel shape inference in multi-input convolutions
12+
513
# TensorRT 10.3 GA Release - 2024-8-7
614
For more details, see the 10.3 GA release notes.
715

@@ -14,13 +22,14 @@ For more details, see the 10.2 GA release notes.
1422
- Improved error handling with new macros and classes
1523
- Minor changes to op importers for `GRU` and `Squeeze`
1624

17-
# TensorRT 10.1 GA Release - 2024-6-17
25+
# TensorRT 10.1 GA Release - 2024-6-10
1826
For more details, see the 10.1 GA release notes.
1927

2028
- Added `supportsModelV2` API
2129
- Added support for `DeformConv` operation
2230
- Added support for `PluginV3` TensorRT Plugins
2331
- Marked all IParser and IParserRefitter APIs as `noexcept`
32+
- Shape inputs can be passed to custom ops supported by `IPluginV3`-based plugins by indicating the input indices to be interpreted as shape inputs by a node attribute named `tensorrt_plugin_shape_input_indices`.
2433

2534
# TensorRT 10.0 GA Release - 2024-4-25
2635
For more details, see the 10.0 GA release notes.

docs/operators.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Supported ONNX Operators
44

5-
TensorRT 10.0 supports operators in the inclusive range of opset 9 to opset 20. Latest information of ONNX operators can be found [here](https://github.com/onnx/onnx/blob/main/docs/Operators.md). More details and limitations are documented in the chart below.
5+
TensorRT 10.4 supports operators in the inclusive range of opset 9 to opset 20. Latest information of ONNX operators can be found [here](https://github.com/onnx/onnx/blob/main/docs/Operators.md). More details and limitations are documented in the chart below.
66

77
TensorRT supports the following ONNX data types: DOUBLE, FLOAT32, FLOAT16, BFLOAT16, INT32, INT64, FP8, INT8, INT4, UINT8, and BOOL
88

@@ -36,7 +36,7 @@ TensorRT supports the following ONNX data types: DOUBLE, FLOAT32, FLOAT16, BFLOA
3636
| BitwiseNot | N |
3737
| BitwiseOr | N |
3838
| BitwiseXor | N |
39-
| BlackmanWindow | N |
39+
| BlackmanWindow | Y |
4040
| Cast | Y | FP32, FP16, BF16, INT32, INT64, UINT8, BOOL | |
4141
| CastLike | Y | FP32, FP16, BF16, INT32, INT64, UINT8, BOOL | |
4242
| Ceil | Y | FP32, FP16, BF16 |
@@ -85,8 +85,8 @@ TensorRT supports the following ONNX data types: DOUBLE, FLOAT32, FLOAT16, BFLOA
8585
| GridSample | Y | FP32, FP16 | Input must be 4D input.
8686
| GroupNormalization | Y | FP32, FP16, BF16 |
8787
| GRU | Y | FP32, FP16, BF16 | For bidirectional GRUs, activation functions must be the same for both the forward and reverse pass
88-
| HammingWindow | N |
89-
| HannWindow | N |
88+
| HammingWindow | Y |
89+
| HannWindow | Y |
9090
| HardSigmoid | Y | FP32, FP16, BF16 |
9191
| HardSwish | Y | FP32, FP16, BF16 |
9292
| Hardmax | Y | FP32, FP16, BF16 | `axis` dimension of input must be a build-time constant
@@ -132,7 +132,7 @@ TensorRT supports the following ONNX data types: DOUBLE, FLOAT32, FLOAT16, BFLOA
132132
| OptionalGetElement | N |
133133
| OptionalHasElement | N |
134134
| Or | Y | BOOL |
135-
| Pad | Y | FP32, FP16, BF16, INT32, INT64 | `axes` must be an initializer |
135+
| Pad | Y | FP32, FP16, BF16, INT32, INT64 |
136136
| ParametricSoftplus | Y | FP32, FP16, BF16 |
137137
| Pow | Y | FP32, FP16, BF16 |
138138
| PRelu | Y | FP32, FP16, BF16 |
@@ -184,7 +184,7 @@ TensorRT supports the following ONNX data types: DOUBLE, FLOAT32, FLOAT16, BFLOA
184184
| Sin | Y | FP32, FP16, BF16 |
185185
| Sinh | Y | FP32, FP16, BF16 |
186186
| Size | Y | FP32, FP16, BF16, INT32, INT64, BOOL |
187-
| Slice | Y | FP32, FP16, BF16, INT32, INT64, BOOL |
187+
| Slice | Y | FP32, FP16, BF16, INT32, INT64, BOOL |
188188
| Softmax | Y | FP32, FP16, BF16 |
189189
| SoftmaxCrossEntropyLoss | N |
190190
| Softplus | Y | FP32, FP16, BF16 |

0 commit comments

Comments
 (0)