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

   The current codegen of relay to TIR will introduce undefined variables for 
topi implementation lie mentioned in #12993. This 
[line](https://github.com/apache/tvm/blob/a85e2a8b230bd22b00636e758d3190d242e81af8/include/tvm/topi/transform.h#L2050)
 in the embedding_bag implementation could introduce undefined variables in the 
generated TIR from relay graph like shown in #12995. However 
`reduce_axis(Range())` should expect inputs as `PrimExpr` and therefore 
generates valid TIR. 
   
   This issue blocks #12993 and is related to #12995
   
   ### Environment
   
   #12993
   
   ### Steps to reproduce
   
   ```
   import tvm
   from tvm import relay
   
   indices = relay.var("indices", relay.TensorType((13,), "int32"))
   weights = relay.var("weights", relay.TensorType((1, 13), "int32"))
   offsets = relay.var("offsets", relay.TensorType((13,), "int32"))
   per_sample_weights = relay.var("per_sample_weights", relay.TensorType((13,), 
"int32"))
   res = relay.op.transform.embedding_bag(
       indices=indices,
       weights=weights,
       offsets=offsets,
       mode=0,
       padding_idx=-1,
       per_sample_weights=per_sample_weights,
       include_last_offset=True,
   )
   func = relay.Function([indices, weights, offsets, per_sample_weights], res)
   mod = tvm.IRModule.from_expr(func)
   f = relay.build(mod, tvm.target.Target("llvm --num-cores=12"))
   ```
   
   ### Triage
   
   * needs-triage
   


-- 
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: commits-unsubscr...@tvm.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to