tlopex opened a new pull request, #19801:
URL: https://github.com/apache/tvm/pull/19801

   BlockBuilder::AddFunction deduplicates context functions through a map whose 
hash (StructuralHashIgnoreNDarray) intentionally ignores tensor content for 
speed. Its equality, however, was the default ffi::StructuralEqual, whose 
operator() also skips tensor content. As a result two grouped functions that 
differ only in their bound constants -- e.g. two conv layers with different 
weights produced by FuseOpsByPattern(bind_constants=True) -- compared equal and 
were merged, silently dropping all but the first constant and miscompiling the 
result.
   
   A hash may be approximate, but the dedup equality must be exact. This pr 
adds a value-aware equality functor (skip_tensor_content=false) and use it as 
the map's KeyEqual, keeping the fast content-ignoring hash. Functions with 
identical constants still dedup; functions with differing constants no longer 
do.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to