-
Notifications
You must be signed in to change notification settings - Fork 111
AIMIGRAPHX-279 Fix BF16/FP16 Quantization - Concat pass to remove zero element inputs #4512
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
Open
TedThemistokleous
wants to merge
17
commits into
develop
Choose a base branch
from
concat_pass_remove_zero_elements
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+303
−1
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6eba8ef
Add matcher for empty literal and concats
TedThemistokleous d107dc0
Comment out literal find matcher
TedThemistokleous dfff5a5
Cleanup changes and remove literal pass
TedThemistokleous ff8983e
[AI Generated] Add comprehensive tests for find_concat_zero_element_i…
TedThemistokleous 914330c
Update format
TedThemistokleous 8326e91
Fix tidy warning with size used as empty
TedThemistokleous fe972dc
Remove unused module m2 in test
TedThemistokleous 31c7b86
Updated changelog
TedThemistokleous dfe2b1e
Cleanup matcher
TedThemistokleous 5e84c77
Update test/simplify_reshapes_test.cpp
TedThemistokleous caf5e88
Update matcher, tests and concat ot handle zero input values
TedThemistokleous 33a7a57
Stub out all zero case test - Needs further discussion
TedThemistokleous 242e0bd
Format
TedThemistokleous 6a1dfe6
Handle new_inputs == 1 case to make this a simple noop for the concat
TedThemistokleous 0ac321f
Update Changelog
TedThemistokleous efd04b5
Update license for concat op
TedThemistokleous 1a97049
Format
TedThemistokleous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should not be creating shapes with zero elements. This is a problem in the onnx parser. It should not be fixed in the optimization passes.
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.
This is what I thought at first but this is actually valid onnx and infact 0 is a valid index /input to the ConstantOfShape call which is what's used here in conjunction with concat.
Customer models we've been given are using zero input shapes to stub out inputs/parameters though and this pattern of concats is used to aggregate the inputs to make the final input.
We can't ask them to change the model as this is how they're toggling/flipping between parameters being removed from the model.
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.
It should still be fixed in the onnx parser since our operators are not written to handle empty elements. We can extend
parse_genericto skip zero element tensors and then if the arguments are empty return an undefined instruction instead.