-
Notifications
You must be signed in to change notification settings - Fork 87
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
Rework split_reshape simplification to handle multiple reshapes from same slice #2146
Conversation
It seems like this should be written as:
Rather than just stopping. |
Codecov Report
@@ Coverage Diff @@
## develop #2146 +/- ##
========================================
Coverage 91.48% 91.49%
========================================
Files 427 427
Lines 15938 15953 +15
========================================
+ Hits 14581 14596 +15
Misses 1357 1357
|
This build is OK for merge ✅ |
🔴torchvision-inceptionv3_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴cadene-dpn92_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴slim-inceptionv4_1: FAILED: MIGraphX is not within tolerance - check verbose output |
Looks like Matcher was assuming
This part if outputs are more than 1 then it is returning false, but it should return |
That was my initial fix actually. But I figured it was coded this way because we wanted to allow the splits to have other outputs but only simpilfy the instructions leading to the reshapes. I guess its not really doing that though because we just assume single output (and that its cont --> reshape) for each slice when we create vec_rsp. In any case, this would solve the bug but it wont do what @pfultz2 is suggesting. For that we'd have to add more checks for what going into |
This turned into a larger update than intended but here is a summary of changes:
|
Unet accuracy check has failed on compilation. Can you check ? |
This should be fixed in the new run |
// cannot create a valid reshape for simplification | ||
if(input_size % rsp_fixed_size != 0) | ||
{ | ||
return; |
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.
Is it possible to add a unit test for this case?
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.
added
Is there enough comments in the code to help understand why something was done a certain way? If you need to make a code change for any other reason feel free to improve the code comments. |
For more clarity heres an example walking through the code (this simplification wouldnt work with the original implementation):
|
It would be good to add this a test instead of one with |
Can you check this one ? |
This resolves an edge case found in multiple huggingface models where the following happens:
In some cases the
find_split_reshape
matcher will match with reshape2, butvec_rsp
will consist of reshape1 dims causing a shape mismatch error. Solution is to includersp
when checking all reshapes are the same.Added unit test reproduces this issue in the current build.