Uh oh!
There was an error while loading. Please reload this page.
[Arith][GPU]Rewrite simplify fix for Vectorized Cooperative Fetching - #5924
Conversation
Thanks @jcf94 we should add a testcase to test_arith_rewrite_simplify, by constructing the case and
|
Uh oh!
There was an error while loading. Please reload this page.
| return broadcast(floordiv(b1, c2), lanes).Eval(); | ||
| } | ||
| // If all indices can be guaranteed to settle inside a coeff range | ||
| if (c2val % bmod->coeff == 0 && bmod->base + (lanes.Eval() - 1) * c1val < bmod->coeff) { |
There was a problem hiding this comment.
Please add a unit test in tests_arith_rewrite_simplify to cover this rule.
jcf94
commented
Jun 26, 2020
Commemts are all addressed.
|
merrymercy
commented
Jun 26, 2020
@jcf94 Did our old rule affect the correctness of common operators? |
Yes, with those rules several other UTs will fail. Our rules make it to be |
tqchen
commented
Jun 26, 2020
Thanks @jcf94@merrymercy . this PR is now merged |
This pr is part of #5883 , fix for the rewrite_simplify error when doing vectorized cooperative fetching in some cases.
Code generated with bug is shown like this:
Which will finally lower to wrong CUDA C instructions.
This should be simplified to generate the correct RampNode:
Then main problems inside this expression are:
should be simplified to:
@merrymercy Our former simplify rules will cause some extra bug, I find a better way to fix this.
@tqchen For the UTs, I'm not sure if there's any better way to check if all of the inner AST blocks are RampNode, the current UTs I added can still pass even if the vectorize failed.
cc @minminsun@FrozenGene@yangjunpro