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

   Applying the FuseTransposeMatmul pass on a matmul with a constant weight  
would fail since the bind_constants defaults to true in the FuseOpsByPattern 
pass . This would lead the constant to be moved in to the fused function 
instead of being an input param, however on line 168 in 
/tvm/relax/transform/fuse_transpose_matmul.py
   
   ```pyhton
   out_dtype = function.ret_struct_info.dtype
                   return self.builder_.call_te(
                       te_transposed_matmul,
                       call.args[1],
                       call.args[0],
                       primfunc_name_hint="NT_matmul",
                   )
   ```
   
   , called later in the FuseTransposeMatmul pass, both input and weight are 
expected to be inputs to the fused function leading to a crash.
   
   I fixed it by explicitly setting bind_constants to false and I added a unit 
test to verify correct behavior when the weight is a constant. 


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