TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Customized TensorRT operator Col2Im, but parsing failed of TensorRT9.2

Open demuxin opened this issue 1 year ago • 8 comments

Description

I customized TensorRT's Col2Im plugin, recompiled the source code of TensorRT8.5, and generated a new nvinfer_plugin library.

Environment

TensorRT Version: 9.2.0.5

NVIDIA GPU: GeForce GTX 1080 Ti

NVIDIA Driver Version: 535.146.02

CUDA Version: 12.2

CUDNN Version: 8.9.6

Operating System: ubuntu22.04

This issue does not occur on TensorRT8.5, Could you please give me some suggestions.

error: parsers/onnx/ModelImporter.cpp:891: While parsing node number 29 [Col2Im -> "/network.0/network.0.0/attn/Col2Im_output_0"]:
error: parsers/onnx/ModelImporter.cpp:892: --- Begin node ---
input: "/network.0/network.0.0/attn/Reshape_2_output_0"
input: "onnx::Col2Im_386"
input: "onnx::Col2Im_261"
output: "/network.0/network.0.0/attn/Col2Im_output_0"
name: "/network.0/network.0.0/attn/Col2Im"
op_type: "Col2Im"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}

error: parsers/onnx/ModelImporter.cpp:893: --- End node ---
error: parsers/onnx/ModelImporter.cpp:895: ERROR: parsers/onnx/builtin_op_static_checkers.cpp:802 In function checkCol2Im:
[8] false
error: parsers/onnx/ModelImporter.cpp:891: While parsing node number 66 [Col2Im -> "/network.0/network.0.1/attn/Col2Im_output_0"]:
error: parsers/onnx/ModelImporter.cpp:892: --- Begin node ---
input: "/network.0/network.0.1/attn/Reshape_2_output_0"
input: "onnx::Col2Im_386"
input: "onnx::Col2Im_261"
output: "/network.0/network.0.1/attn/Col2Im_output_0"
name: "/network.0/network.0.1/attn/Col2Im"
op_type: "Col2Im"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}

error: parsers/onnx/ModelImporter.cpp:893: --- End node ---
error: parsers/onnx/ModelImporter.cpp:895: ERROR: parsers/onnx/builtin_op_static_checkers.cpp:802 In function checkCol2Im:
[8] false
error: parsers/onnx/ModelImporter.cpp:891: While parsing node number 103 [Col2Im -> "/network.0/network.0.2/attn/Col2Im_output_0"]:
error: parsers/onnx/ModelImporter.cpp:892: --- Begin node ---
input: "/network.0/network.0.2/attn/Reshape_2_output_0"
input: "onnx::Col2Im_386"
input: "onnx::Col2Im_261"
output: "/network.0/network.0.2/attn/Col2Im_output_0"
name: "/network.0/network.0.2/attn/Col2Im"
op_type: "Col2Im"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}

error: parsers/onnx/ModelImporter.cpp:893: --- End node ---
error: parsers/onnx/ModelImporter.cpp:895: ERROR: parsers/onnx/builtin_op_static_checkers.cpp:802 In function checkCol2Im:
[8] false
error: parsers/onnx/ModelImporter.cpp:891: While parsing node number 644 [Add -> "outputs"]:
error: parsers/onnx/ModelImporter.cpp:892: --- Begin node ---
input: "/head/Gemm_output_0"
input: "/Mul_1_output_0"
output: "outputs"
name: "/Add_1"
op_type: "Add"

error: parsers/onnx/ModelImporter.cpp:893: --- End node ---
error: parsers/onnx/ModelImporter.cpp:895: ERROR: parsers/onnx/builtin_op_static_checkers.cpp:802 In function checkCol2Im:
[8] false

demuxin avatar Feb 18 '24 01:02 demuxin

This is the Col2Im node information in the model:

Flameshot_2024-02-18_09:32:38

demuxin avatar Feb 18 '24 01:02 demuxin

Could you please try recompile the plugin with TRT 9.2? Thanks!

zerollzeng avatar Feb 20 '24 09:02 zerollzeng

Could you please try recompile the plugin with TRT 9.2? Thanks!

Hi zerollzeng, I just recompiled the plugin with TRT 9.2, and recompiling it again should be the same result, unless there are any changes to be made.

demuxin avatar Feb 22 '24 01:02 demuxin

Oh I thought you just use the so compiled from TRT 8.5, @samurdhikaru do you have any comments? Thanks!

zerollzeng avatar Feb 27 '24 06:02 zerollzeng

@zerollzeng Do you have any solutions?

demuxin avatar Mar 18 '24 06:03 demuxin

No, I don't know what change has happen from 8.5 to 9.2. @samurdhikaru Could you please kindly help here ^ ^

zerollzeng avatar Mar 23 '24 07:03 zerollzeng

Hmmm @demuxin when we override onnx standard op with a plugin implementation, we have to rebuild the onnx parser with the lines removed.

https://github.com/onnx/onnx-tensorrt/blob/706f02e74366b2cbaacf87be61de95df051a2788/onnxOpCheckers.cpp#L884

DEFINE_OP_CHECKER(Col2Im)
{
    STATIC_CHECK(false, ErrorCode::kUNSUPPORTED_NODE, node, errors, nodeIndex);
}

ttyio avatar Jul 23 '24 23:07 ttyio

I couldn’t find the TensorRT 9.2 SDK version on the official website. Could you let me know where you found it? Alternatively, could you please send me the corresponding SDK version?

Songxinlei avatar Aug 15 '24 10:08 Songxinlei