Conversation
| std::string string_buf; | ||
| model_proto.SerializeToString(&string_buf); | ||
|
|
||
| if (dump_subgraphs_) { |
There was a problem hiding this comment.
Thanks. One more place we can dump the model for debugging,
GetSupportedList():
after the line: model_proto.SerializeToString(&string_buf)
Here we can capture onnx-tensorrt parser failures during GetCapability.
There was a problem hiding this comment.
Thanks. One more place we can dump the model for debugging,
GetSupportedList():
after the line: model_proto.SerializeToString(&string_buf)
Here we can capture onnx-tensorrt parser failures during GetCapability.
Can I handle that in a separate PR? I have some questions about the GetCapability/GetSupportedList fail path. Also is there potential for duplicate subgraphs getting dumped then.
my main motivation for this PR is to allow dumping of the subgraph corresponding to the fused node referred to by this error message https://github.com/microsoft/onnxruntime/blob/master/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc#L723
also it's useful for visualizing nodes in the subgraph that were executed by TensorRT EP, even for successful executions.
There was a problem hiding this comment.
There are two cases that error could happen in the parser. One is that parser failed when parsing the model. Dumping the model in GetCapability will help this case. The other case is that parser doesn't fail on model parsing, but fail on reporting exceptions to ORT. Then ORT compile (engine creation) will fail. But sure, we can handle the second case in this PR. I will include the first case in next PR.
add debug option (controlled via ORT_TENSORRT_DUMP_SUBGRAPHS environment variable)
to dump subgraphs assigned to TensorRT execution provider.
This is useful for debugging TRT Engine build failures.