yongfeng-nv opened a new pull request #4885: Split node min range is not stringent. URL: https://github.com/apache/incubator-tvm/pull/4885 Previously, PassDownDomain always sets inner IterVar's extent to the split factor, even when the parent extent is less than the factor (usually happens the parent has been reduced to a single point). Although predicates are added to guard bounds, unnecessary likely statements are inserted. They are road blocks for tensorization/intrinsic. The fix is simple -- set the inner IterVar's ext w/ min(r->factor, parent->range). Here is an example from the new test: Before: // attr [EF] storage_scope = "global" allocate EF[float32 * 8] produce E { produce EF { for (i, 0, 8) { EF[i] = (I[i]*2f) } } for (i.inner, 0, 32) { if (likely((i.inner < 8))) { if (likely((i.inner < 8))) { EF[i.inner] = (EF[i.inner]*2f) } } } } After: // attr [EF] storage_scope = "global" allocate EF[float32 * 8] produce E { produce EF { for (i, 0, 8) { EF[i] = (I[i]*2f) } } for (i.inner, 0, 8) { EF[i.inner] = (EF[i.inner]*2f) } } I also have to update an existing test. I have confirmed that the test generates expected and even cleaner code (many if statements are gone) with the fix.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services