Failed to extract_tasks for VGG model on samsung Galaxy S10+

Hi, I try to use TVM to auto-scheduler VGG model on samsung galxy S10+, to test the performance of samsung GPU.

I build tvm_runtime.so with support of LLVM, and build android_rpc with a OpenCL stub library. Then I install the tvmrpc-release.apk on the mobilephone.

Then I use the python script modified from here: h-t-t-p-s://tvm.apache.org/docs/tutorials/auto_scheduler/tune_network_mali.html

But it failed to extrack tasks. The error shows that TypeError: conv2d_winograd_nhwc_mali() takes from 6 to 7 positional arguments but 8 were given. While when i set the target as mali cpu, it will successfully run.

Plz help me, I paste the core code about the python script as below, and the error messages.

network = "vgg_float.tflite"
batch_size = 1
layout = "NHWC"
# Set this to True if you use ndk tools for cross compiling
use_ndk = True
# Path to cross compiler
os.environ["TVM_NDK_CC"] = "/opt/android-ndk/android-ndk-r21e/android-toolchain-arm64/bin/aarch64-linux-android-g++"
target_host = tvm.target.Target("llvm -mtriple=aarch64-linux-android") # haizhu.shao
# target_host = tvm.target.Target("llvm -mtriple=aarch64-linux-gnu")
target = tvm.target.Target("opencl -device=mali")
#target = tvm.target.Target("llvm -mtriple=aarch64-linux-gnu -mattr=+neon")
#target = tvm.target.bifrost()
target = tvm.target.mali()
dtype = "float32"

mod, params, input_shape = get_network(network, batch_size, layout, dtype=dtype)

#...
hardware_params = auto_scheduler.HardwareParams(-1, 16, 64, max_shared_memory_per_block, max_local_memory_per_block, max_threads_per_block, max_vthread_extent, warp_size)

tasks, task_weights = auto_scheduler.extract_tasks(mod["main"], params, target, target_host, hardware_params)

Below is the error messages:

shaohaizhu@tvm:~/workspace/tvm/profile$ python3 ./tune_vgg.py
before get_network...
after get_network...
before get hardware params......
after get hardware params......
Extract tasks...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/auto_scheduler/relay_integration.py", line 65, in call_all_topi_funcs
    opt_mod, _ = relay.optimize(mod, target, params)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/build_module.py", line 323, in optimize
    mod, params = bld_mod.optimize(mod, target, params)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/build_module.py", line 171, in optimize
    mod = self._optimize(mod, target)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
    raise get_last_ffi_error()
TypeError: Traceback (most recent call last):
  [bt] (8) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)+0x8e) [0x7f3f112d9a6e]
  [bt] (7) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)+0x82) [0x7f3f112dee72]
  [bt] (6) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>::InitVTable()::{lambda(tvm::runtime::ObjectRef const&, tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>*)#6}::_FUN(tvm::runtime::ObjectRef const&, tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>*)+0x27) [0x7f3f1114f1c7]
  [bt] (5) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::MixedModeMutator::VisitExpr_(tvm::relay::CallNode const*)+0x96) [0x7f3f110cb016]
  [bt] (4) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::ForwardRewriter::Rewrite_(tvm::relay::CallNode const*, tvm::RelayExpr const&)+0x16ea) [0x7f3f11123e9a]
  [bt] (3) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::runtime::TypedPackedFunc<tvm::RelayExpr (tvm::relay::Call const&, tvm::runtime::Array<tvm::RelayExpr, void> const&, tvm::runtime::ObjectRef const&)>::AssignTypedLambda<tvm::RelayExpr (*)(tvm::relay::Call const&, tvm::runtime::Array<tvm::RelayExpr, void> const&, tvm::runtime::ObjectRef const&)>(tvm::RelayExpr (*)(tvm::relay::Call const&, tvm::runtime::Array<tvm::RelayExpr, void> const&, tvm::runtime::ObjectRef const&))::{lambda(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}::operator()(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*) const+0x425) [0x7f3f11085335]
  [bt] (2) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::RelayExpr tvm::relay::LayoutRewriter<tvm::relay::alter_op_layout::AlterTransformMemorizer>(tvm::relay::Call const&, tvm::runtime::Array<tvm::RelayExpr, void> const&, tvm::runtime::ObjectRef const&)+0xf70) [0x7f3f11083300]
  [bt] (1) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::alter_op_layout::AlterTransformMemorizer::CallWithNewLayouts(tvm::relay::Call const&, std::vector<tvm::RelayExpr, std::allocator<tvm::RelayExpr> > const&)+0x86b) [0x7f3f1108088b]
  [bt] (0) /home/shaohaizhu/workspace/tvm/build/libtvm.so(+0x1a477bb) [0x7f3f113e27bb]
  File "/home/shaohaizhu/workspace/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 81, in cfun
    rv = local_pyfunc(*pyargs)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/op/nn/_nn.py", line 168, in alter_op_layout_conv2d
    return topi.nn.conv2d_alter_layout(attrs, inputs, tinfos, out_type)
  File "<decorator-gen-55>", line 2, in conv2d_alter_layout
  File "/home/shaohaizhu/workspace/tvm/python/tvm/target/generic_func.py", line 275, in dispatch_func
    return dispatch_dict[k](*args, **kwargs)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/topi/mali/conv2d.py", line 489, in _alter_conv2d_layout
    relay.op.get("nn.conv2d"), attrs, tinfos, out_type, target
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/backend/compile_engine.py", line 205, in select_implementation
    outs = best_plevel_impl.compute(attrs, inputs, out_type)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/op/op.py", line 90, in compute
    return _OpImplementationCompute(self, attrs, inputs, out_type)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
    raise get_last_ffi_error()
  [bt] (3) /home/shaohaizhu/workspace/tvm/build/libtvm.so(TVMFuncCall+0x5f) [0x7f3f113e5d2f]
  [bt] (2) /home/shaohaizhu/workspace/tvm/build/libtvm.so(+0x1957ce8) [0x7f3f112f2ce8]
  [bt] (1) /home/shaohaizhu/workspace/tvm/build/libtvm.so(tvm::relay::OpImplementation::Compute(tvm::Attrs const&, tvm::runtime::Array<tvm::te::Tensor, void> const&, tvm::Type const&)+0xb1) [0x7f3f112f2ab1]
  [bt] (0) /home/shaohaizhu/workspace/tvm/build/libtvm.so(+0x1a477bb) [0x7f3f113e27bb]
  File "/home/shaohaizhu/workspace/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 81, in cfun
    rv = local_pyfunc(*pyargs)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/relay/op/strategy/generic.py", line 230, in _compute_conv2d
    return [topi_compute(*args)]
  File "<decorator-gen-57>", line 2, in conv2d_winograd_nhwc
  File "/home/shaohaizhu/workspace/tvm/python/tvm/target/generic_func.py", line 275, in dispatch_func
    return dispatch_dict[k](*args, **kwargs)
TypeError: conv2d_winograd_nhwc_mali() takes from 6 to 7 positional arguments but 8 were given

Begin tuning...
Traceback (most recent call last):
  File "./tune_vgg.py", line 162, in <module>
    tune_and_evaluate()
  File "./tune_vgg.py", line 115, in tune_and_evaluate
    tuner = auto_scheduler.TaskScheduler(tasks, task_weights)
  File "/home/shaohaizhu/workspace/tvm/python/tvm/auto_scheduler/task_scheduler.py", line 243, in __init__
    assert len(self.tasks) != 0, "No tasks"
AssertionError: No tasks