Error building model with tvm and llvm-7.0


#1

hi,
we installed tvm and ran it from tvm/build and running command:
a = np.random.randn(2,3,256,256)
import nnvm.compiler
target = ‘llvm’
shape_dict = {‘0’: a.shape}
opt_level = 0
with nnvm.compiler.build_config(opt_level=opt_level):
** graph, lib, params = nnvm.compiler.build(sym, target, shape_dict,params=params)**

we see this issue:

WARNING:autotvm:Cannot find config for target=llvm, workload=(‘conv2d’, (2, 3, 256, 256, ‘float32’), (32, 3, 3, 3, ‘float32’), (1, 1), (1, 1), ‘NCHW’, ‘NCHW’, ‘float32’). A fallback configuration is used, which may bring great performance regression.
Traceback (most recent call last):
** File “”, line 2, in **
** File “/workspace/tvm/nnvm/python/nnvm/compiler/build_module.py”, line 306, in build**
** File “/workspace/tvm/nnvm/python/nnvm/graph.py”, line 234, in apply**
** check_call(_LIB.NNGraphApplyPasses(self.handle, npass, cpass, ctypes.byref(ghandle)))**
** File “/workspace/tvm/nnvm/python/nnvm/_base.py”, line 75, in check_call**
** raise NNVMError(py_str(_LIB.NNGetLastError()))**
nnvm._base.NNVMError: TVMCall CFunc Error:
Traceback (most recent call last):
** File “/workspace/tvm/python/tvm/_ffi/_ctypes/function.py”, line 55, in cfun**
** rv = local_pyfunc(pyargs)*
** File “/workspace/tvm/nnvm/python/nnvm/top/nn.py”, line 141, in compute_conv2d**
** inputs[0], kernel, strides, padding, layout, out_dtype=out_dtype)**
** File “”, line 2, in conv2d**
** File “/workspace/tvm/python/tvm/target.py”, line 356, in dispatch_func**
** return dispatch_dict[k](args, kwargs)
** File “”, line 2, in config_dispatcher
*
** File “/workspace/tvm/python/tvm/autotvm/task/dispatcher.py”, line 199, in dispatch_func**
** return dispatch_dict[‘direct’](cfg, args, kwargs)
** File “/workspace/tvm/python/tvm/autotvm/task/topi_integration.py”, line 267, in template_call
*
** node = f(cfg, args, kwargs)
** File “/workspace/tvm/topi/python/topi/x86/conv2d.py”, line 74, in _declaration_conv
*
** padding, dilation, layout, out_dtype)**
** File “/workspace/tvm/topi/python/topi/x86/conv2d.py”, line 102, in _declaration_conv_impl**
** dilated_kernel_h = (kernel_height - 1) * dilation_h + 1**
TypeError: must be str, not int

ENV:
we configured it with LLVM 7.0 and running from inside docker (ubuntu16.04).

gjgarrea@5168744e88d3:$ echo $PATH
/opt/conda/bin:/usr/local/cuda-9.0/bin:/usr/local/nvidia/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/lib/llvm-7/cmake
gjgarrea@5168744e88d3:$ echo $PYTHONPATH
/workspace/tvm/python:/workspace/tvm/topi/python:/workspace/tvm/nnvm/python:/opt/conda/lib/python3.6/site-packages
gjgarrea@5168744e88d3:$ echo $LD_LIBRARY_PATH
/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/opt/conda/lib:/usr/lib

Anyone has any idea what we are doing wrong?


#2

It looks like the shape being passed is not in the expected format; can you inspect kernel.shape and data.shape at this point in the execution?