-
Notifications
You must be signed in to change notification settings - Fork 0
taco: bug for user-defined fused function xor(and(A, C), and(B, C)) #29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
There is a simple fix to this which is to define the iteration algebra as:
The bug is fundamentally caused by the fact that the iteration lattice construction algorithm is incorrect when taking the cartesian product of points for the two input iteration lattices. Discussed this with @rohany @fredrikbk and @RawnH. The intersection rule in As an example:
To check for non-overlapping points when taking the cartesian product,
Therefore, the quick fix works since the iteration algebra does not need to merge two iteration lattices that have the same input tensor since the computation is (~A U ~C) merged with (~B) only. The algorithm fix for this in taco can be found in the branch: https://github.com/tensor-compiler/taco/tree/array_algebra_iter_const |
When generating code for
xor(and(A, C), and(B, C))
in taco certain implementations do not match numpy.The below statement produces the correct code that matches dense numpy and pydata/sparse. For
data/image/no/image1.jpg
it produces 816 nnzs:This (supposedly) equivalent statement produces too many zeros. For
data/image/no/image1.jpg
it produces 2646 nnzs:This (supposedly) equivalent statement also produces too many zeros and produces the same result as 2). For
data/image/no/image1.jpg
it produces 2646 nnzs:For case 3) the generated code from the lowerer is:
Where the case statement
if ((jA0 == j && jC0 == j) && jB0 == j)
does not seem correct since the intersection of all three tensors (A, B, and C) should not be included in the defined fused iteration space ofxor(and(A, C), and(B, C))
.The above ops are defined as:
The text was updated successfully, but these errors were encountered: