onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

Handle duplicate constant names in local functions

Open olesalscheider opened this issue 8 months ago • 0 comments

Description

The dynamo based ONNX export of pytorch 2 can create ONNX graphs with local functions where the names of constants are only unique within the function but not within the whole ONNX model (it seems).

This leads to weights being (wrongly) reused. Amongst other things, it can cause this error message

[TRT] [E] [network.cpp::setWeightsName::3797] Error Code 1: Internal Error (Error: Weights of same values but of different counts are used in the network!)

I think the correct solution might be to prefix all weights with the name of the local function?

Environment

TensorRT Version: 10.0.1.6 ONNX-TensorRT Version / Branch: main GPU Type: RTX A6000 Nvidia Driver Version: 550 CUDA Version: 12.4 CUDNN Version: 9 Operating System + Version: Ubuntu 22.04 Python Version (if applicable): 3.10.12 TensorFlow + TF2ONNX Version (if applicable): - PyTorch Version (if applicable): nightly Baremetal or Container (if container which image + tag): baremetal

olesalscheider avatar Jun 04 '24 15:06 olesalscheider