onnxruntime
211d5fa2 - Check for non-empty ep_nodes before resizing index_to_ep_node in EpGraph::CreateImpl(). (#26001)

Commit
101 days ago
Check for non-empty ep_nodes before resizing index_to_ep_node in EpGraph::CreateImpl(). (#26001) ### Description <!-- Describe your changes. --> Check for non-empty `ep_nodes` before resizing `index_to_ep_node` in `EpGraph::CreateImpl()`. In this code: https://github.com/microsoft/onnxruntime/blob/502416772611825f2e80fb14a865ebf72670689d/onnxruntime/core/graph/ep_api_types.cc#L663-L683 If there are no nodes to process, the values of `min_node_index` and `max_node_index` will not be updated and this assertion in `IndexToEpNodeMap::Resize()` will fail. https://github.com/microsoft/onnxruntime/blob/502416772611825f2e80fb14a865ebf72670689d/onnxruntime/core/graph/ep_api_types.cc#L538 ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Fix debug assertion failure in [`If.ConditionalBranchesOnlyContainConstantNodes_ThenBranchExecution`](https://github.com/microsoft/onnxruntime/blob/502416772611825f2e80fb14a865ebf72670689d/onnxruntime/test/providers/cpu/controlflow/if_test.cc#L406-L411) when running unit test with a plugin EP (see #25689).
Author
Parents
Loading