Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems about the onnx-tensorrt source code. #20029

Open
hy846130226 opened this issue Mar 22, 2024 · 6 comments
Open

Some problems about the onnx-tensorrt source code. #20029

hy846130226 opened this issue Mar 22, 2024 · 6 comments
Labels
ep:TensorRT issues related to TensorRT execution provider stale issues that have not been addressed in a while; categorized by a bot

Comments

@hy846130226
Copy link

Describe the issue

Hello.
I am learning the onnx-tensorrt code, I have some questions:

image
I have got the files
image
But I could not open it in netron.app

so my question is:
is this file a standard onnx mode? and what's the difference beteen this model and my source model

image
I could see some variant in compile method:

input_map
output_map
input_indexes
output_indexes

I see after the code build the engine, it will look up the input_map to build the input_indexes.

so my question is:
Is there a need to do this search all over again?
Because the tensorrt model is from my orignal onnx model, Shouldn't his two inputs and outputs be the same?

To reproduce

None

Urgency

No response

Platform

Windows

OS Version

WIN10

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

v1.16.3

ONNX Runtime API

C++

Architecture

X64

Execution Provider

TensorRT

Execution Provider Library Version

No response

@github-actions github-actions bot added ep:TensorRT issues related to TensorRT execution provider platform:windows issues related to the Windows platform labels Mar 22, 2024
@hy846130226
Copy link
Author

And another question:

I see in tensorrt_execution_provider.cc, it has aleady created IBuilder.

image

Why it need create again in compile method?
Why can't you reuse an IBuilder object?

@hy846130226
Copy link
Author

Could Anyone help me?

@chilo-ms
Copy link
Contributor

chilo-ms commented Mar 26, 2024

so my question is:
is this file a standard onnx mode? and what's the difference beteen this model and my source model

This is a standard onnx model and you should be able to open with Netron.
Make sure model_proto->SerializeToOstream(dump) is complete and then check the file otherwise you might get the corrupt onnx file.
This onnx model might be slightly different than your original model.
original model -> ORT graph optimization -> ORT TRT generated onnx model -> TRT parser to get support list.
So, this model is optimized model that will be fed into TRT parser to get support list.

@chilo-ms
Copy link
Contributor

so my question is:
Is there a need to do this search all over again?
Because the tensorrt model is from my orignal onnx model, Shouldn't his two inputs and outputs be the same?

That's a good question.
Theoretically, in most cases, the name or number of inputs/outputs should be the same for onnx model and TRT network.
I wonder if there are some historical reasons or in some cases they are not the same.

@chilo-ms
Copy link
Contributor

And another question:

I see in tensorrt_execution_provider.cc, it has aleady created IBuilder.

image

Why it need create again in compile method? Why can't you reuse an IBuilder object?

We did. Please see ORT 1.17.0 or main branch

@sophies927 sophies927 removed the platform:windows issues related to the Windows platform label Mar 28, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:TensorRT issues related to TensorRT execution provider stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants