-
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
Tighten split's extent #4931
Tighten split's extent #4931
Conversation
19f6d96
to
15b4e8f
Compare
@merrymercy, I have updated this PR description and refactor the code. All tests are clear. Please review it. Thank you. |
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.
Use const reference when possible.
The logic looks good to me.
cc @tqchen for double check.
Thank you for the careful review. I forgot to check references after refactoring. |
13747ff
to
79c5ecf
Compare
I don't understand the current failure: https://ci.tvm.ai/blue/organizations/jenkins/tvm/detail/PR-4931/7/pipeline. How do I handle it? |
This CI failure has been fixed several hours ago. Rebasing this branch to upstream and the errors should be gone. |
79c5ecf
to
90d7381
Compare
…arts, but only when PassDownDomain is called with allow_missing == false, i.e. by InferBound. Add a helper PassUpThreadBinding() to get a map telling whether an IterVar has at least one leaf IterVar deriving from it binding to a thread. Add two unit tests.
…from testtopi/tests/python/test_topi_transform.py::test_tile.
…t's range to the factor or nparts.
I need some help to reproduce the failure locally. I tried the CI twice and both ended with the same failure (e.g. https://ci.tvm.ai/blue/organizations/jenkins/tvm/detail/PR-4931/9/pipeline/). But neither I or fellow engineer was able to reproduce the failure on our local machines. Any suggestion? I don't mind adding a few temporary debugging dumping code to my change and the test, but the test is the very last one in the entire CI and takes 2-3 hours to reach. Is there any way to get me quickly to this test in CI? |
The error appears to be a flaky test error that may not have things to do with the PR, please try to send a dummy commit to retrigger |
f97f5d7
to
40ecacc
Compare
@merrymercy, I have made your recommended changes. Please review it again. Can you share your use case hitting this issue? @tqchen, the flaky test finally passed. Thank you for the help. Please double check the logic of this PR and share your thoughts. |
This PR is among one of the PRs affected by the github squash commit bug. We take every contribution serious in the TVM community. The community has decided to use revert/redo approach to amend the contributions as per #5015 @yongfeng-nv Please let us know if you would like us to revert the PR and resend the contribution. Thank you. cc @merrymercy |
@tqchen Sure. Thanks. |
@merrymercy can you followup by reverting this PR first? Then @yongfeng-nv can send another PR back |
This reverts commit 585f9ce.
@yongfeng-nv the revert PR has been merged. Please send another PR back :) |
* Set split node's range to minimum of ext and split factor or split nparts, but only when PassDownDomain is called with allow_missing == false, i.e. by InferBound. Add a helper PassUpThreadBinding() to get a map telling whether an IterVar has at least one leaf IterVar deriving from it binding to a thread. Add two unit tests. * Enhance LoopVectorizer for vectorizing by 0. Found at least one case from testtopi/tests/python/test_topi_transform.py::test_tile. * Revert changes vectorize_loop.cc; when parent's ext is zero, set split's range to the factor or nparts. * Update with comments. * Refactor the ext tightening predicate. * Fix reference types. * Integrate tvm.te changes. * Trivial comment change to trigger CI. * Trivial comment correction to trigger testing.
This reverts commit 585f9ce.
* Set split node's range to minimum of ext and split factor or split nparts, but only when PassDownDomain is called with allow_missing == false, i.e. by InferBound. Add a helper PassUpThreadBinding() to get a map telling whether an IterVar has at least one leaf IterVar deriving from it binding to a thread. Add two unit tests. * Enhance LoopVectorizer for vectorizing by 0. Found at least one case from testtopi/tests/python/test_topi_transform.py::test_tile. * Revert changes vectorize_loop.cc; when parent's ext is zero, set split's range to the factor or nparts. * Update with comments. * Refactor the ext tightening predicate. * Fix reference types. * Integrate tvm.te changes. * Trivial comment change to trigger CI. * Trivial comment correction to trigger testing.
This reverts commit 585f9ce.
PassDownDomain always sets inner IterVar's extent to the split factor, even if the parent extent is less than the factor (usually happens when 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.
Here is an example from the new test:
Before:
After:
Solution:
Tighten iv's extent to min(parent_extent, factor_or_nparts), only if all of the
following three conditions are met:
to force an IterVar extent to match the number of allocated threads to fuse stages
that require different number of threads. We don't want to change these extents.
rather than by an early compiler phase, such as rfactor(). We don't want to tighten an
IterVar in an early phase allowing missing IterVars, because it may bind to a thread later.
zero-sized dimension. Split creates iv with a positive extent to avoid zero-extent
IterVar. We don't touch it.
An earlier attempt to this issue is in this PR (#4885). This PR also reports it (#4932).
Follow-up to the discussion in #4885: