I have tried to learn to how to tune in arm board. And changing little code in tutorial tune,The Tuning is the good . But the Compiling failed.
The code related is as flollowing:
`def tune_and_evaluate(tuning_opt):
extract workloads from nnvm graph
print(“Extract tasks…”)
rnn_shape = (1,128)
#net, params, input_shape, out_shape = get_network(network, batch_size=1)
net, params, input_shape, out_shape = get_crnn_network(network, batch_size=1)
tasks = autotvm.task.extract_from_graph(net, target=target, target_host=target_host,
shape={‘data’: input_shape,
‘l0_init_h’:rnn_shape,‘l0_init_c’:rnn_shape,
‘l1_init_h’:rnn_shape,‘l1_init_c’:rnn_shape,
‘l2_init_h’:rnn_shape,‘l2_init_c’:rnn_shape,
‘l3_init_h’:rnn_shape,‘l3_init_c’:rnn_shape},
dtype=dtype,
symbols=(nnvm.sym.conv2d, nnvm.sym.dense))
run tuning tasks
print(“Tuning…”)
tune_tasks(tasks, **tuning_opt)
compile kernels with history best records
with autotvm.apply_history_best(log_file):
print(“Compile…”)
with nnvm.compiler.build_config(opt_level=3):
graph, lib, params = nnvm.compiler.build(
net, target=target, target_host=target_host,
shape={‘data’: input_shape,
‘l0_init_h’:rnn_shape,‘l0_init_c’:rnn_shape,
‘l1_init_h’:rnn_shape,‘l1_init_c’:rnn_shape,
‘l2_init_h’:rnn_shape,‘l2_init_c’:rnn_shape,
‘l3_init_h’:rnn_shape,‘l3_init_c’:rnn_shape},
params=params, dtype=dtype)
print(“compile finished”)`
The output is as following:
Extract tasks…
Tuning…
Compile…
Traceback (most recent call last):
File “tune_nnvm_mobile_gpu.py”, line 386, in
tune_and_evaluate(tuning_option)
File “tune_nnvm_mobile_gpu.py”, line 344, in tune_and_evaluate
params=params, dtype=dtype)
File “/usr/local/lib/python2.7/dist-packages/nnvm-0.8.0-py2.7.egg/nnvm/compiler/build_module.py”, line 305, in build
graph = graph.apply(“GraphCompile”)
File “/usr/local/lib/python2.7/dist-packages/nnvm-0.8.0-py2.7.egg/nnvm/graph.py”, line 234, in apply
check_call(_LIB.NNGraphApplyPasses(self.handle, npass, cpass, ctypes.byref(ghandle)))
File “/usr/local/lib/python2.7/dist-packages/nnvm-0.8.0-py2.7.egg/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 “tvm/_ffi/_cython/function.pxi”, line 38, in core.tvm_callback (tvm/_ffi/_cython/core.cpp:3305)
File “/usr/local/lib/python2.7/dist-packages/nnvm-0.8.0-py2.7.egg/nnvm/compiler/build_module.py”, line 124, in _build
return tvm.build(funcs, target=target, target_host=target_host)
File “/usr/local/lib/python2.7/dist-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/build_module.py”, line 585, in build
fhost, mdev = _build_for_device(flist, tar, target_host)
File “/usr/local/lib/python2.7/dist-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/build_module.py”, line 414, in _build_for_device
“Did you forget to bind?” % func.name)
ValueError: Direct host side access to device memory is detected in fuse__contrib_conv2d_winograd_weight_transform_4. Did you forget to bind?
The only change frome baseline is multiple input. The program crashed When I cancel the added input in nnvm.compiler.build function.