I successfully autotuned my own model following Auto-tuning a convolutional network for ARM CPU. I tried next to use use spatial pack for depthwise convolution
as I my model has depthwise convolution. Autotunning finished without any problem but I get the following TVMError
while compiling.
Compile...
Traceback (most recent call last):
File "tvm_autotuning.py", line 280, in <module>
tune_and_evaluate(tuning_option, args)
File "tvm_autotuning.py", line 233, in tune_and_evaluate
mod, target=target, params=params)
File "/venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/relay/build_module.py", line 244, in build
graph_json, mod, params = bld_mod.build(func, target, target_host, params)
File "/venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/relay/build_module.py", line 109, in build
self._build(func, target, target_host)
File "tvm/_ffi/_cython/./function.pxi", line 304, in tvm._ffi._cy3.core.FunctionBase.__call__
File "tvm/_ffi/_cython/./function.pxi", line 239, in tvm._ffi._cy3.core.FuncCall
File "tvm/_ffi/_cython/./function.pxi", line 228, in tvm._ffi._cy3.core.FuncCall3
File "tvm/_ffi/_cython/./base.pxi", line 160, in tvm._ffi._cy3.core.CALL
tvm._ffi.base.TVMError: Traceback (most recent call last):
[bt] (8) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr_(tvm::relay::CallNode const*)+0xadb) [0x7f3737c1db6b]
[bt] (7) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr(tvm::relay::Expr const&)+0x7d3) [0x7f3737c1a133]
[bt] (6) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr_(tvm::relay::CallNode const*)+0xadb) [0x7f3737c1db6b]
[bt] (5) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr(tvm::relay::Expr const&)+0x7d3) [0x7f3737c1a133]
[bt] (4) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr_(tvm::relay::CallNode const*)+0x699) [0x7f3737c1d729]
[bt] (3) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(+0xa7147b) [0x7f3737bf147b]
[bt] (2) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::CompileEngineImpl::LowerInternal(tvm::relay::CCacheKey const&)+0x2a9) [0x7f3737bfb2b9]
[bt] (1) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(tvm::relay::ScheduleGetter::Create(tvm::relay::Function const&)+0xd15) [0x7f3737bfa915]
[bt] (0) /venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/libtvm.so(+0xc2160b) [0x7f3737da160b]
File "tvm/_ffi/_cython/./function.pxi", line 55, in tvm._ffi._cy3.core.tvm_callback
File "/venv/python3/lib/python3.6/site-packages/tvm-0.6.dev0-py3.6-linux-x86_64.egg/tvm/relay/op/nn/_nn.py", line 204, in schedule_conv2d
assert op is not None
TVMError: AssertionError
The network is an ONNX model, target is llvm -device=arm_cpu -model=bcm2711 -target=armv7l-linux-gnueabihf -mattr+=neon
. If I replace autotvm.apply_history_best(log_file)
by autotvm.FallbackContext()
the model compiles but inference time is worst than the version without spatial pack for depthwise convolution
.
This are the autotuning results for depthwise convolution:
[Task 1/35] Current/Best: 1.17/ 8.09 GFLOPS | Progress: (2144/2560) | 1643.81 s Done.
[Task 2/35] Current/Best: 1.28/ 10.29 GFLOPS | Progress: (2560/2560) | 1496.45 s Done.
[Task 3/35] Current/Best: 3.39/ 8.26 GFLOPS | Progress: (2312/2560) | 1718.44 s Done.
[Task 4/35] Current/Best: 1.39/ 8.92 GFLOPS | Progress: (2120/2560) | 1474.60 s Done.
[Task 5/35] Current/Best: 1.05/ 9.05 GFLOPS | Progress: (2144/2560) | 1366.15 s Done.
[Task 6/35] Current/Best: 1.10/ 8.52 GFLOPS | Progress: (2560/2560) | 1689.54 s Done.
[Task 7/35] Current/Best: 4.24/ 9.62 GFLOPS | Progress: (2400/2560) | 1625.05 s Done.
[Task 8/35] Current/Best: 1.11/ 7.11 GFLOPS | Progress: (1280/1280) | 835.66 s Done.
[Task 9/35] Current/Best: 0.83/ 9.95 GFLOPS | Progress: (1280/1280) | 833.16 s Done.
[Task 10/35] Current/Best: 4.40/ 9.41 GFLOPS | Progress: (1280/1280) | 810.72 s Done.
[Task 11/35] Current/Best: 0.84/ 5.07 GFLOPS | Progress: (1280/1280) | 801.03 s Done.
[Task 12/35] Current/Best: 1.04/ 4.14 GFLOPS | Progress: (1280/1280) | 799.61 s Done.
[Task 13/35] Current/Best: 4.57/ 8.76 GFLOPS | Progress: (1280/1280) | 943.46 s Done.
[Task 14/35] Current/Best: 10.85/ 11.91 GFLOPS | Progress: (1280/1280) | 2783.76 s Done.
[Task 15/35] Current/Best: 1.21/ 3.07 GFLOPS | Progress: (1280/1280) | 775.91 s Done.
[Task 16/35] Current/Best: 1.86/ 10.14 GFLOPS | Progress: (1280/1280) | 838.59 s Done.
[Task 17/35] Current/Best: 3.56/ 9.22 GFLOPS | Progress: (1280/1280) | 724.95 s Done.
[Task 18/35] Current/Best: 2.47/ 13.34 GFLOPS | Progress: (1280/1280) | 836.99 s Done.
[Task 19/35] Current/Best: 1.31/ 6.85 GFLOPS | Progress: (1280/1280) | 722.19 s Done.
[Task 20/35] Current/Best: 1.70/ 2.04 GFLOPS | Progress: (1280/1280) | 746.78 s Done.
[Task 21/35] Current/Best: 3.70/ 15.53 GFLOPS | Progress: (1280/1280) | 806.78 s Done.
[Task 22/35] Current/Best: 4.60/ 8.40 GFLOPS | Progress: (1280/1280) | 681.94 s Done.
[Task 23/35] Current/Best: 1.25/ 12.40 GFLOPS | Progress: (1280/1280) | 790.07 s Done.
[Task 24/35] Current/Best: 1.00/ 9.41 GFLOPS | Progress: (1280/1280) | 706.78 s Done.
[Task 25/35] Current/Best: 3.21/ 4.69 GFLOPS | Progress: (1280/1280) | 698.19 s Done.
[Task 26/35] Current/Best: 0.89/ 14.79 GFLOPS | Progress: (1280/1280) | 773.43 s Done.
[Task 27/35] Current/Best: 1.35/ 9.71 GFLOPS | Progress: (1280/1280) | 717.41 s Done.
[Task 28/35] Current/Best: 4.33/ 6.39 GFLOPS | Progress: (1280/1280) | 670.52 s Done.
[Task 29/35] Current/Best: 0.80/ 10.05 GFLOPS | Progress: (1280/1280) | 757.61 s Done.
[Task 30/35] Current/Best: 0.31/ 8.98 GFLOPS | Progress: (1280/1280) | 710.69 s Done.
[Task 31/35] Current/Best: 2.29/ 9.90 GFLOPS | Progress: (1280/1280) | 737.44 s Done.
[Task 32/35] Current/Best: 1.52/ 7.09 GFLOPS | Progress: (1280/1280) | 901.05 s Done.
[Task 33/35] Current/Best: 0.77/ 10.12 GFLOPS | Progress: (1280/1280) | 856.93 s Done.
[Task 34/35] Current/Best: 1.52/ 10.51 GFLOPS | Progress: (1280/1280) | 913.27 s Done.
[Task 35/35] Current/Best: 3.61/ 9.73 GFLOPS | Progress: (1280/1280) | 829.45 s Done.
Is there a way in which I can solve the AssertionError? Thank you.