-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[TIR] Add preserve_unit_iters option to blockize/tensorize #13579
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
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
shingjan
left a comment
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.
Overall LGTM except some nits. Really appreciate @vinx13 for sending out this fix! mobilenet_v2 being blocked on main is a headache.
|
|
||
| BlockRealize BlockizeImpl(const ScheduleState& self, const StmtSRef& loop_sref, | ||
| Map<Block, Block>* block_sref_reuse, arith::Analyzer* analyzer) { | ||
| bool preserve_unit_iters, Map<Block, Block>* block_sref_reuse, |
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.
nit: put preserve_unit_iters at the end of argument like other functions with preserve_unit_iters introduced.
| for i5_0, i6_0, i7_0, i8_0, i9_0_0, i0_2, i1_2, i2_2, i3_2, i4_0_2, i5_1, i6_1, i7_1, i8_1, i9_0_1, i0_3, i1_3, i2_3, i3_3, i4_0_3 in T.grid(1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1): | ||
| with T.block("conv2d_NCHWc_int8_o"): | ||
| n = T.axis.spatial(1, 0) | ||
| n = T.axis.spatial(1, i0_2 + i0_3 + i0_0 + i0_1) |
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 the result of trivial iters being preserved instead of simplified right?
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.
yes
58e99d6 to
28af660
Compare
28af660 to
d0ef417
Compare
This PR added an option
preserve_unit_itersto blockize and tensorize, which helps to maintain stability of the loop structure during tuning. It also added an optionsimplify_trivial_iteratortoSubspaceDivide, similar to what's already supported inDetectIterMap.cc @junrushao @spectrometerHBH @masahi
fixed #13517