weiya711 / sam

MIT License
15 stars 4 forks source link

[Compiler] Can't generate SAM graph for 4-tensor expression #69

Open lrubens opened 1 year ago

lrubens commented 1 year ago

I can't seem to be able to generate the SAM graph for this 4-tensor expression: "X(i,j,k,l)=B(i,k,j,m)*C(i,l,j,m) -f=X:ssss -f=B:ssss -f=C:ssss".

weiya711 commented 1 year ago

You're using TACO wrong since right now all of those formats CANNOT be run in concordant traversal. Since you specified the formats for X to be in i -> j -> k -> l order but B must be in i -> k -> j -> m order, which creates a conflict between j,k. The same is true between X and C creating a conflict between j,l.

To fix this you have to specify the mode orderings. you can do this by -f=B:ssss:0,2,1,3 and do the correct mode ordering for C such that everything is in concordant traversal when the loops are sorted topologically (i, j, k, l, m).