tkonolige opened a new issue #7292:
URL: https://github.com/apache/tvm/issues/7292


   On d7a9a7c5bc5952e43db2ac0113fd40cc77453fbe, the following script segfaults:
   ```python
   import tvm
   import numpy as np
   def gen_ir(out_ptr):
       irb = tvm.tir.ir_builder.create()
       out = irb.buffer_ptr(out_ptr)
       out[0] = tvm.tir.const(0, "uint64")
       return irb.get()
   
   target = "cuda"
   ctx = tvm.gpu()
   out = tvm.tir.decl_buffer((1,), dtype="uint64")
   f = tvm.te.extern([out.shape], [], lambda ins, outs: gen_ir(outs[0]), 
dtype="uint64", out_buffers=[out])
   s = tvm.te.create_schedule([f.op])
   p = tvm.te.placeholder((1,), "uint64")
   out_ary = tvm.nd.array(np.zeros((1,), "uint64"), ctx)
   tvm.build(s, [p], target=target)(out_ary) # this should have [f] as the 
second parameter
   ```
   The cause is that the wrong `Tensor` was passed to `tvm.build`.
   
   Actionable item: we need to fix `tvm.build` so it provides a useful error 
message when the incorrect `Tensor` is provided instead of segfaulting.
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to