-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix slice to empty not being converted to FullOp #3882
base: main
Are you sure you want to change the base?
Conversation
!test |
Review updated until commit ed89fbe Description
Changes walkthrough 📝
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
auto tv0 = makeSymbolicTensor(1); | ||
fusion.addInput(tv0); | ||
|
||
auto tv1 = slice(tv0, {{fusion.zeroVal(), fusion.zeroVal()}}); |
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.
Note that we could probably detect patterns like this in the slice
op and just translate those to FullOp
right away without relying on concretization. I think the attached fix should handle cases where the slice arguments are dynamic.
!test |
This fixes an issue noticed by @naoyam, where a simple fusion containing a dynamic slice does not get properly converted to a NoOp in the case when the output size is zero. This was happening because the resized iterdomain was being concretized as
Iteration
first, after which the extent was replaced by zero. However, the extent that was replaced in that case was the old one, not the extent of the replaced IterDomain. The fix is to first concretize empty extents as zero before doing anything else, then taking care to respect mutated extents when doing other concretizations. In particular, we need to doctor the extents that get resized if their inputs' extents have already been concretized.