-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Changes Remove ONNXGraph and place all its methods into module onnx_helper.py To optimize performance four mappings are introduced for ONNX model manipulation. `get_node_mapping(model: onnx.ModelProto) -> Dict[str, onnx.NodeProto]` Mapping from node name to the corresponding node. This needs to not iterate through all nodes of a model. `get_edge_info_mapping(model: onnx.ModelProto) -> Dict[str, onnx.ValueInfoProto]` Mapping from edge name to corresponding edge information. This needs to not iterate through all edge infos of a model. `get_children_node_mapping(model: onnx.ModelProto) -> Dict[str, List[onnx.NodeProto]]` Mapping from edge name and corresponding nodes that consume that edge as an input. Used to traverse forwardwith the optimal performance. `get_parents_node_mapping(model: onnx.ModelProto) -> Dict[str, onnx.NodeProto]` Mapping from edge name to node which outputs this edge. Used to traverse backward with the optimal performance. Locally measured perf difference after removing ONNXGraph. Model | PR time (sec) | develop time (sec) | SpeedUp -- | -- | -- | -- swinv2_cr_tiny_224| 91.434 | 105.73 | 15.64% visformer_small | 57.265 | 59.097 | 3.2% deit3_small_patch16_224 | 52.31 | 55.503 | 6.1% ### Reason for changes Code refactor ### Related tickets 96982 ### Tests N/A
- Loading branch information
Showing
12 changed files
with
490 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.