-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend the optimizer to enable optimizations (such as elimination of redundant Expand/Reshape) when symbolic dimensions are present. This requires propagating symbolic shape values (tensors that carry shape information that is not completely known at compile time) through the optimizer. These optimizations also help fusion optimizations (otherwise, we need more pattern variations and more complex patterns). Handles symbolic shape propagation through Abs, Gather, Concat and uses them in Reshape/Expand. Abs shows up in Expand translation because Torch allows -1 for "no expansion" while ONNX uses 1, but this is not necessary if the input is a symbolic shape where every value is guaranteed to be non-negative. Also fix node-level shape-inference to refine shape by merging best info from pre-existing shape and inferred shape. --------- Co-authored-by: Justin Chu <[email protected]>
- Loading branch information
1 parent
646116c
commit a942e95
Showing
2 changed files
with
222 additions
and
18 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