-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Handle optional inputs and remove more empty shape nodes in TensorRT EP #3455
Conversation
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc
Outdated
Show resolved
Hide resolved
const auto name = input.second->Name(); | ||
if (!name.empty()){ | ||
meta_def->inputs.push_back(name); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: tabs
meta_def->inputs.push_back(input.second->Name()); | ||
const auto name = input.second->Name(); | ||
if (!name.empty()){ | ||
meta_def->inputs.push_back(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking input.second->Exists() may be clearer/simpler.
for (const auto& tensor : init_tensors) { | ||
graph_build.AddInitializedTensor(*(tensor.second)); | ||
} | ||
|
||
ORT_ENFORCE(graph_build.Resolve().IsOK()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge master to get the Windows GPU CI passing.
When TRT EP partitions a graph for TRT, optional input of operators become subgraph's input, which will cause problem since it doesn't have name/type/values. This PR removed optional inputs from subgraph input list.
TRT doesn't support empty shape in current release. When a model has Nonzero op, there is a chance that Nonzero's output has empty shape during runtime. This mostly happened in RCNN models. As a workaround this PR excluded empty shape related nodes from TRT subgraph. New TRT release 7.1 will fix the issue and support empty shape.