Skip to content

Commit 306247b

Browse files
authored
ONNX-TensorRT 9.2 Release (#948)
Signed-off-by: Yuan Yao <[email protected]>
1 parent 877b5dc commit 306247b

12 files changed

+723
-368
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
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 9)
31-
set(ONNX2TRT_MINOR 1)
31+
set(ONNX2TRT_MINOR 2)
3232
set(ONNX2TRT_PATCH 0)
3333
set(ONNX2TRT_VERSION "${ONNX2TRT_MAJOR}.${ONNX2TRT_MINOR}.${ONNX2TRT_PATCH}" CACHE STRING "ONNX2TRT version")
3434

LoopHelpers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ nvinfer1::ITensor* addLoopCounter(IImporterContext* ctx, nvinfer1::ILoop* loop,
1313
nvinfer1::ITensor* initialTensor
1414
= addConstantScalar(ctx, initial, ::ONNX_NAMESPACE::TensorProto::INT64, nvinfer1::Dims{1, 1})->getOutput(0);
1515
nvinfer1::ITensor* one
16-
= addConstantScalar(ctx, 1, ::ONNX_NAMESPACE::TensorProto::INT64, nvinfer1::Dims{1, 1})->getOutput(0);
16+
= addConstantScalar(ctx, static_cast<int64_t>(1), ::ONNX_NAMESPACE::TensorProto::INT64, nvinfer1::Dims{1, 1})
17+
->getOutput(0);
1718

1819
auto counter = loop->addRecurrence(*initialTensor);
1920
nvinfer1::ITensor* addOne = ctx->network()

ModelImporter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ Status parseNode(
208208
}
209209

210210
ASSERT_NODE((node.output().size() <= static_cast<int32_t>(outputs.size())),
211-
"Node has more output tensors than TRT expected.", node, nodeIdx, ErrorCode::kINVALID_GRAPH);
211+
"Node has more output tensors than TRT expected, expected output size is "
212+
<< outputs.size() << ", actual output size is " << node.output().size() << ".",
213+
node, nodeIdx, ErrorCode::kINVALID_GRAPH);
212214

213215
// Set output names and register outputs with the context.
214216
std::ostringstream ssOutputs{};

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Parses ONNX models for execution with [TensorRT](https://developer.nvidia.com/tensorrt).
66

7-
See also the [TensorRT documentation](https://docs.nvidia.com/deeplearning/sdk/#inference).
7+
See also the [TensorRT documentation](https://docs.nvidia.com/deeplearning/tensorrt/).
88

99
For the list of recent changes, see the [changelog](docs/Changelog.md).
1010

@@ -48,8 +48,8 @@ Current supported ONNX operators are found in the [operator support matrix](docs
4848
### Dependencies
4949

5050
- [Protobuf >= 3.0.x](https://github.com/google/protobuf/releases)
51-
- [TensorRT 9.1](https://developer.nvidia.com/tensorrt)
52-
- [TensorRT 9.1 open source libaries] (https://github.com/NVIDIA/TensorRT/)
51+
- [TensorRT 9.2](https://developer.nvidia.com/tensorrt)
52+
- [TensorRT 9.2 open source libaries] (https://github.com/NVIDIA/TensorRT/)
5353

5454
### Building
5555

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

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

102-
TensorRT 9.1 supports ONNX release 1.14.0. Install it with:
102+
TensorRT 9.2 supports ONNX release 1.14.0. Install it with:
103103

104104
python3 -m pip install onnx==1.14.0
105105

Status.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@
3838
#define MAKE_NODE_ERROR(desc, code, node, index) \
3939
onnx2trt::Status((code), (desc), __FILENAME__, __LINE__, __func__, (index), (node.name()), (node.op_type()))
4040

41-
#define ASSERT_NODE(condition, desc, node, index, error_code) \
41+
#define ASSERT_NODE(condition, msg, node, index, error_code) \
4242
do \
4343
{ \
4444
if (!(condition)) \
4545
{ \
46-
std::string error = std::string("Assertion failed: " #condition) + ". " + desc; \
47-
return MAKE_NODE_ERROR((error), (error_code), node, index); \
46+
std::stringstream error; \
47+
error << "Assertion failed: " << #condition << ": " << msg; \
48+
return MAKE_NODE_ERROR((error.str()), (error_code), node, index); \
4849
} \
4950
} while (0)
5051

builtin_op_importers.cpp

Lines changed: 543 additions & 288 deletions
Large diffs are not rendered by default.

builtin_op_static_checkers.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ DEFINE_OP_CHECKER(GRU)
350350
}
351351
}
352352

353+
DEFINE_OP_EMPTY_CHECKER(Hardmax)
354+
353355
DEFINE_OP_EMPTY_CHECKER(HardSigmoid)
354356

355357
DEFINE_OP_EMPTY_CHECKER(Identity)
@@ -830,11 +832,6 @@ DEFINE_OP_CHECKER(Det)
830832
STATIC_CHECK(false, ErrorCode::kUNSUPPORTED_NODE, node, errors, nodeIndex);
831833
}
832834

833-
DEFINE_OP_CHECKER(Hardmax)
834-
{
835-
STATIC_CHECK(false, ErrorCode::kUNSUPPORTED_NODE, node, errors, nodeIndex);
836-
}
837-
838835
DEFINE_OP_CHECKER(ImageDecoder)
839836
{
840837
STATIC_CHECK(false, ErrorCode::kUNSUPPORTED_NODE, node, errors, nodeIndex);

docs/Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
# ONNX-TensorRT Changelog
44

5+
# TensorRT 9.2 GA Release - 2023-12-4
6+
For more details, see the 9.2 GA release notes for the fixes since 9.1 GA.
7+
8+
- Added support for `Hardmax`
9+
- Fixed type inference for few operators to use native ONNX types
10+
511
# TensorRT 9.1 GA Release - 2023-10-18
612
For more details, see the 9.1 GA release notes for the fixes since 9.0 GA.
713

docs/operators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Supported ONNX Operators
44

5-
TensorRT 9.1 supports operators up to Opset 19. Latest information of ONNX operators can be found [here](https://github.com/onnx/onnx/blob/master/docs/Operators.md)
5+
TensorRT 9.2 supports operators up to Opset 19. Latest information of ONNX operators can be found [here](https://github.com/onnx/onnx/blob/master/docs/Operators.md)
66

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

@@ -80,7 +80,7 @@ See below for the support matrix of ONNX operators in ONNX-TensorRT.
8080
| HannWindow | N |
8181
| HardSwish | Y | FP32, FP16, BF16, FP8, INT8 |
8282
| HardSigmoid | Y | FP32, FP16, BF16, FP8, INT8 |
83-
| Hardmax | N |
83+
| Hardmax | Y | FP32, FP16, BF16 | `axis` dimension of input must be a build-time constant
8484
| Identity | Y | FP32, FP16, BF16, INT32, INT64, FP8, INT8, BOOL |
8585
| If | Y | FP32, FP16, BF16, INT32, INT64, BOOL | Output tensors of the two conditional branches must have broadcastable shapes, and must have different names
8686
| ImageScaler | Y | FP32, FP16, BF16|
@@ -116,7 +116,7 @@ See below for the support matrix of ONNX operators in ONNX-TensorRT.
116116
| NonMaxSuppression | Y | FP32, FP16 |
117117
| NonZero | Y | FP32, FP16
118118
| Not | Y | BOOL |
119-
| OneHot | Y | FP32, FP16, BF16, INT32, INT64, BOOL |
119+
| OneHot | Y | FP32, FP16, BF16, INT32, INT64, BOOL | `depth` must be a build-time constant
120120
| Optional | N |
121121
| OptionalGetElement | N |
122122
| OptionalHasElement | N |

0 commit comments

Comments
 (0)