-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Bugfix][Arith] Avoid flaky test with TryCombineSplitFromSameSource #15128
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
This commit resolves a flaky test failure that was introduced in apache#15081. The unit test `tests/python/unittest/test_meta_schedule_schedule_rule_mlt_tc.py::test_padded_matmul_relu` failed approximately 30% of the time. The error was due to changes in `IterMapRewriter::NormalizeToIterWithOffset`. When attempting a simplfication with `TryCombineSplitFromSameSource`, if the returned `Optional<IterSumExpr>` is defined, but the `args.size() < 1` check fails, then the `expr` argument is still overwritten, and presumably can cause a later `TryFuseIters(expr)` to fail. This commit replaces `expr = opt.value();` with `auto combined = opt.value();`, preserving the original argument.
|
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 |
1 similar comment
|
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 |
junrushao
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.
Thanks for the quick fix!
|
No problem! Once I had it bisected down, it was relatively quick to apply a fix as well. |
|
And I spoke too soon. The original "fix" also prevent several simplifications that are needed for index simplification. |
|
Interesting, @Lunderberg can you send the simplification formula around the regression? i can take a look as well. Ideally the thing should be deterministic, and seems right now they are not |
|
I took a look and send in a fix here #15131 |
|
I'm not sure at the moment which expression is failing to simplify on main. For some of the choices of split factors, it resulted in the buffer With the buggy fix, it broke simplification of |
|
For complete-ness, it looks like the failure can be traced back to the call to |
|
Might be useful for us to send a regression |
This commit resolves a flaky test failure that was introduced in #15081. The unit test
tests/python/unittest/test_meta_schedule_schedule_rule_mlt_tc.py::test_padded_matmul_relufailed approximately 30% of the time.The error was due to changes in
IterMapRewriter::NormalizeToIterWithOffset. When attempting a simplfication withTryCombineSplitFromSameSource, if the returnedOptional<IterSumExpr>is defined, but theargs.size() < 1check fails, then theexprargument is still overwritten, and presumably can cause a laterTryFuseIters(expr)to fail.This commit replaces
expr = opt.value();withauto combined = opt.value();, preserving the original argument.