Cookiee235 opened a new issue, #17486:
URL: https://github.com/apache/tvm/issues/17486

   ### Actual behavior
   
   ```
   @I.ir_module
   class Module:
       @R.function
       def main(q: R.Tensor((4, 16, 32, 8), dtype="float32"), k: R.Tensor((4, 
8, 32, 8), dtype="float32"), v: R.Tensor((4, 8, 32, 16), dtype="float32"), 
bias: R.Tensor((4, 32, 16, 8), dtype="float32")) -> R.Tensor((4, 16, 32, 16), 
dtype="float32"):
           gv: R.Tensor((4, 16, 32, 16), dtype="float32") = 
R.nn.attention_bias(q, k, v, bias, scale=T.float32(0.10000000000000001), 
causal_mask="TopLeft", window_size=None)
           return gv
   
   error: module 'tvm.relax.op.nn' has no attribute 'attention_bias'
    --> <str>:9:58
      |  
    9 |          gv: R.Tensor((4, 16, 32, 16), dtype="float32") = 
R.nn.attention_bias(q, k, v, bias, scale=T.float32(0.10000000000000001), 
causal_mask="TopLeft", window_size=None)
      |                                                           
^^^^^^^^^^^^^^^^^^^ 
   ```
   
   ### Steps to reproduce
   ```
   irs= """# from tvm.script import ir as I
   # from tvm.script import tir as T
   # from tvm.script import relax as R
   
   @I.ir_module
   class Module:
       @R.function
       def main(q: R.Tensor((4, 16, 32, 8), dtype="float32"), k: R.Tensor((4, 
8, 32, 8), dtype="float32"), v: R.Tensor((4, 8, 32, 16), dtype="float32"), 
bias: R.Tensor((4, 32, 16, 8), dtype="float32")) -> R.Tensor((4, 16, 32, 16), 
dtype="float32"):
           gv: R.Tensor((4, 16, 32, 16), dtype="float32") = R.nn.attention(q, 
k, v, bias, scale=T.float32(0.10000000000000001), causal_mask="TopLeft", 
window_size=None)
           return gv
   
   import tvm
   mod = tvm.script.from_source(irs)
   mod.show()
   mod_new = tvm.script.from_source(mod.script())   # crash!
   """
   ```
   
   cc @Lunderberg @junrushao @Hzfengsy @tqchen 


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