FranckQC commented on PR #12761:
URL: https://github.com/apache/tvm/pull/12761#issuecomment-1319338998

   I was finally able to take some time this week to have a closer look at this 
PR. It is definitely better than it was before, as it leaves the current 
DeepEqual unchanged, which was very important for me. That was my initial point 
3 in my earlier comment, which I consider being addressed, thank you :).
   
   However, I agree with @masahi comments. The implementation could have a lot 
more comments and documentation about the variables being used, what the 
function do, and what parts of the algorithm do. It would help a lot reading 
the code, which increases the confidence one can have in the implementation.
   
   It's a great thing that there is quite a lot of tests, thanks for taking the 
time to write many of them. However, I'd also like to be able to see a real 
usage for new equivalence relation (that was point 2 in my earlier comment). 
TVM is a compiler, not a tool for just doing algebraic manipulations of 
mathematical terms like Matlab, so I would really like to see some natural use 
cases for this, where this get used/integrated into a pass, or into something 
else that ultimately lead to improvements in the code produced by the 
compilation of some ML models.
   
   **More minor thing:** Finally, I'd like to know how one is supposed to use 
this `CommutativeDeepEqual` along the `Analyzer::Simplify()` function that 
performs other kind of simplification (simplification of neutral elements, 
applying distributivity, etc, but which unfortunately can't handle 
commutativity, as discussed earlier in the thread), in order to have a function 
that uses all the algebraic properties available. I imagine it would call 
Simplify() on both sides and then uses this new `CommutativeDeepEqual`. Would 
that be enough for being complete?
   The reason behind that is the following: I believe most of the people who 
could be interested in equality-modulo-commutativity will be coming here after 
having discovered that `Analyzer::Simplify()` can't do all the simplifications 
for them. So when they will learn that there is this `CommutativeDeepEqual` 
equivalence relation for dealing with commutativity, their first question will 
likely be "how do I combine both?". So I think demonstrating that could be 
useful.
   
   The most important thing for me at this stage for this PR are to add 
comments to the code, and to show some real use case/integration for this. 
Thank you for your work!


-- 
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