FranckQC commented on pull request #9482:
URL: https://github.com/apache/tvm/pull/9482#issuecomment-1034315546


   > Thanks so much for the clear and complete comments, very much appreciate 
that.
   > 
   > Echo @Hzfengsy suggestion to switch to TVMScript for your tests -- perhaps 
just pretty printing what you already constructs would be a short cut.
   > 
   > The code duplication across PrimExpr & Stmnt in 
CommonSubexpressionElimintor is unfortunate but suspect removing that would 
only obscure things.
   > 
   > In your experience is this mostly firing on the affine index 
sub-expressions, or do you see cse over actual data sub-expressions?
   
   Thank you so much for the compliment, I really appreciate it. It makes me 
happy to know that the code is easy to read!
   
   If I recall well I saw quite a lot of indices (mostly from loop unrolling), 
just like what @wrongtest had here 
https://github.com/apache/tvm/pull/9482#issuecomment-972463175. 
   
   Also some indices due to lowering of memory accesses, for instance:
   C[x,y] = C[x,y] + A[x,k] * B[y,k]
   which can lowered (2D to 1D) to:
   C[x*128+y] = C[x*128+y] + A[x*128+k]*B[y*128+k]
   which gives the opportunity to create first:
   cse_var_1 = x*128+y
   and then in cascade:
   cse_var_2 = x*128
   
   And I also recall a lot of random commoning, like:
   
![result-CSE-realProgram-better](https://user-images.githubusercontent.com/89943638/153308601-ce7edc8e-67be-4b8c-b892-7df78746eaaf.png)
   
   I'll post more if I can find my notes where I had more interesting 
commonings performed in test files.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to