-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Arith] Updated arith::DetectIterMap to keep extent=1 components #10980
[Arith] Updated arith::DetectIterMap to keep extent=1 components #10980
Conversation
Previously, arith::DetectIterMap simplified the output expression by replacing iteration variables with extent==1 with their value. This prevented the return value from being used in arith::InverseAffineIterMap to solve for the variable, as it no longer existed in the returned expressions. This commit changes arith::DetectIterMap to keep the iteration variable even if extent==1, and adds a motivating unit test that requires this updated behavior.
df4919c
to
bbe87af
Compare
Following a discussion with @vinx13. All tests in |
To avoid breaking existing test cases, updated to maintain the same default behavior, but a flag to maintain trivial iterators in the result.
CI confirms that there are definitely locations that rely on simplifications being performed as part of |
To make the API consistent, could you also update the FFI API https://github.com/apache/tvm/blob/main/src/arith/iter_affine_map.cc#L943-L948? |
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.
LGTM, if you can update the FFI API as @vinx13's suggestion
Certainly, and thank you for catching it! The FFI and the Python API have been updated to expose the |
…che#10980) * [Arith] Updated arith::DetectIterMap to keep extent=1 components Previously, arith::DetectIterMap simplified the output expression by replacing iteration variables with extent==1 with their value. This prevented the return value from being used in arith::InverseAffineIterMap to solve for the variable, as it no longer existed in the returned expressions. This commit changes arith::DetectIterMap to keep the iteration variable even if extent==1, and adds a motivating unit test that requires this updated behavior. * Updated to retain default behavior of DetectIterMap To avoid breaking existing test cases, updated to maintain the same default behavior, but a flag to maintain trivial iterators in the result. * Updated FFI and Python API for DetectIterMap
…che#10980) * [Arith] Updated arith::DetectIterMap to keep extent=1 components Previously, arith::DetectIterMap simplified the output expression by replacing iteration variables with extent==1 with their value. This prevented the return value from being used in arith::InverseAffineIterMap to solve for the variable, as it no longer existed in the returned expressions. This commit changes arith::DetectIterMap to keep the iteration variable even if extent==1, and adds a motivating unit test that requires this updated behavior. * Updated to retain default behavior of DetectIterMap To avoid breaking existing test cases, updated to maintain the same default behavior, but a flag to maintain trivial iterators in the result. * Updated FFI and Python API for DetectIterMap
Previously, arith::DetectIterMap simplified the output expression by replacing iteration variables with extent==1 with their value. This prevented the return value from being used in arith::InverseAffineIterMap to solve for the variable, as it no longer existed in the returned expressions.
This commit changes arith::DetectIterMap to keep the iteration variable even if extent==1, and adds a motivating unit test that requires this updated behavior.