InstantiationError("Skipped because of invalid gpu kernel") and AttributeError: Invalid config option, cannot recognize \'target\'. Candidates are:',),),

I’m trying to autotune on a jetson board using RPC tracker. I get the following errors.

Extract tasks...
Start tuning...
[Task  1/28]  Current/Best:    0.00/   0.00 GFLOPS | Progress: (156/2000) | 3.67 s

WARNING:autotvm:Too many errors happen in the tuning. Now is in debug mode

DEBUG:autotvm:No: 157	GFLOPS: 0.00/0.00	result: MeasureResult(costs=(AttributeError('Traceback (most recent call last):
  [bt] (5) /home/can/tvm/build/libtvm.so(TVMFuncCall+0x65) [0x7f874a3f97f5]
  [bt] (4) /home/can/tvm/build/libtvm.so(+0x95b84b) [0x7f8749e6c84b]
  [bt] (3) /home/can/tvm/build/libtvm.so(tvm::Target::Create(tvm::runtime::String const&)+0x388) [0x7f8749e6c3f8]
  [bt] (2) /home/can/tvm/build/libtvm.so(tvm::Target::CreateTarget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x336) [0x7f8749e69cc6]
  [bt] (1) /home/can/tvm/build/libtvm.so(tvm::TargetIdNode::ParseAttrsFromRaw(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const+0xe36) [0x7f8749e722d6]
  [bt] (0) /home/can/tvm/build/libtvm.so(+0x95f2d2) [0x7f8749e702d2]
  system-lib
  model
  mcpu
  device
  keys
  libs
  mattr
  mtriple
  File "../src/target/target_id.cc", line 271
AttributeError: Invalid config option, cannot recognize \'target\'. Candidates are:',),), error_no=2, all_cost=0.01634359359741211, timestamp=1595859962.5469337)	[('tile_f', [-1, 2, 9, 1]), ('tile_y', [-1, 1, 1, 13]), ('tile_x', [-1, 1, 1, 13]), ('tile_rc', [-1, 16]), ('tile_ry', [-1, 1]), ('tile_rx', [-1, 1]), ('auto_unroll_max_step', 0), ('unroll_explicit', 0)],None,3176

DEBUG:autotvm:No: 158	GFLOPS: 0.00/0.00	result: MeasureResult(costs=(InstantiationError('Traceback (most recent call last):
  [bt] (4) /home/can/tvm/build/libtvm.so(TVMFuncCall+0x65) [0x7f874a3f97f5]
  [bt] (3) /home/can/tvm/build/libtvm.so(+0x5dd086) [0x7f8749aee086]
  [bt] (2) /home/can/tvm/build/libtvm.so(tvm::transform::SequentialNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const+0x2c8) [0x7f8749aece98]
  [bt] (1) /home/can/tvm/build/libtvm.so(tvm::tir::transform::PrimFuncPassNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const+0xa6f) [0x7f8749cec86f]
  [bt] (0) /home/can/tvm/build/libtvm.so(+0xee50fb) [0x7f874a3f60fb]
  File "tvm/_ffi/_cython/./packed_func.pxi", line 55, in tvm._ffi._cy3.core.tvm_callback
  File "/home/can/tvm/python/tvm/autotvm/measure/measure_methods.py", line 653, in verify_pass
    raise InstantiationError("Skipped because of invalid gpu kernel")
tvm.autotvm.task.space.InstantiationError: Skipped because of invalid gpu kernel',),), error_no=1, all_cost=0.01835775375366211, timestamp=1595859962.5470707)	[('tile_f', [-1, 2, 3, 3]), ('tile_y', [-1, 1, 13, 1]), ('tile_x', [-1, 1, 13, 1]), ('tile_rc', [-1, 256]), ('tile_ry', [-1, 1]), ('tile_rx', [-1, 1]), ('auto_unroll_max_step', 0), ('unroll_explicit', 1)],None,24751

Can you tell us what is the exact target string that you use and that causes the error?

-target is migrated to -mtriple AFAIK

1 Like

@aurel333 and @junrushao1994, sorry for late reply, I don’t know why I didn’t get notifications.

I use target = tvm.target.create('cuda') as target and target_host = 'llvm -target=aarch64-linux-gnu' for target_host.

Should I use with -mtriple ?

1 Like

Yes @junrushao1994 is right. You can see which options are usable for each target at the end of the target_id.cc file (https://github.com/apache/incubator-tvm/blob/master/src/target/target_id.cc).

1 Like

I have changed target_host = 'llvm -target=aarch64-linux-gnu' to target_host = 'llvm -mtriple=aarch64-linux-gnu' only and everything looks okay now. Thanks.

1 Like