-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Description
On d7a9a7c, the following script segfaults:
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 parameterThe 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.
Reactions are currently unavailable