Hi,
What is the right way to use the new interface for conv2D_NCHWc?
I call it like this:
B1 = topi.nn.conv2d_NCHWc(A1, W1,out_channel,(kernel_height,kernel_width),(stride_height,stride_width), (0,0), ‘NCHW16c’, ‘NCHW16c’)
s1 = topi.generic.schedule_conv2d_NCHWc(out_channel, (kernel_height,kernel_width), (stride_height,stride_width), (0,0),‘NCHW16c’, ‘NCHW16c’, [B1])
But I get an error during build:
tvm/src/codegen/codegen.cc:27: Check failed: bf != nullptr Target llvm is not enabled
The old interface without the explicit arguments for layout was working…
Thanks,
Anand
Can you try this code?
target_name = 'llvm -mcpu=core-avx2'
ctx = tvm.context(target_name, 0);
data = tvm.placeholder((1, 8, 56, 56, 8), name='data');
kernel = tvm.placeholder((8, 8, 3, 3, 8, 8), name='kernel');
a = tvm.nd.array(np.random.rand(1, 8, 56, 56, 8).astype(dtype='float32'), ctx);
b = tvm.nd.array(np.random.rand(8, 8, 3, 3, 8, 8).astype(dtype='float32'), ctx);
with tvm.target.create(target_name):
conv = topi.nn.conv2d_NCHWc(data, kernel, num_filter=64, kernel_size=(3, 3), stride=1, padding=1, layout='NCHWc', out_layout='NCHWc', out_dtype='float32');
sconv = topi.generic.nn.schedule_conv2d_NCHWc(num_filter=64, kernel_size=(3,3), strides=1, padding=1, layout='NCHWc', out_layout='NCHWc', outs=[conv]);
print(tvm.lower(sconv, [data, kernel], simple_mode=True))
Thanks for the code will try it out…