cyx-6 opened a new pull request, #13859:
URL: https://github.com/apache/tvm/pull/13859

   This PR refactors the output of `assert_structural_equal`. Different from 
the direct printing mismatching nodes, in the old version, the improved one 
will print the whole scripts, with mismatching nodes underlined. For example, 
we have following functions
   
   ```python
   @T.prim_func
   def func1(a: T.handle, b: T.handle):
     A = T.match_buffer(a, (128, 128))
     B = T.match_buffer(b, (128, 128))
   
   @T.prim_func
   def func2(a: T.handle, b: T.handle):
     A = T.match_buffer(a, (128, 128))
     B = T.match_buffer(b, (128, 256))
   ```
   
   the log of `assert_structural_equal(func1, func2)` will be like
   
   ```python
   ValueError: StructuralEqual check failed, caused by lhs:
   # from tvm.script import tir as T
   
   @T.prim_func
   def main(a: T.handle, b: T.handle):
     A = T.match_buffer(a, (128, 128))
     B = T.match_buffer(b, (128, 128))
                                 ^^^
     T.evaluate(0)
   and rhs:
   # from tvm.script import tir as T
   
   @T.prim_func
   def main(a: T.handle, b: T.handle):
     A = T.match_buffer(a, (128, 128))
     B = T.match_buffer(b, (128, 256))
                                 ^^^
     T.evaluate(0)
   ```
   
   instead of
   
   ```python
   ValueError: StructuralEqual check failed, caused by lhs:
   128
   and rhs:
   256
   ```
   
   which is not readable sometimes.


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