-device=arm_cpu fails on Arm64 server

I am running AutoTVM natively on ARM64 with llvm. Specifically I am taking an autotvm python script that worked fine on x86 and changed the line:

target = tvm.target.create('llvm -mcpu=core-avx2')

to this:

target = tvm.target.create('llvm -device=arm_cpu -target=aarch64-linux-gnu')

The output I’m getting is long and ends like this:

DEBUG:autotvm:No: 1433 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=10.541214942932129, timestamp=1591629369.3417928) [(‘tile_co’, [-1, 1]), (‘tile_oh’, [-1, 22]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1432 DEBUG:autotvm:No: 1434 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=10.797586679458618, timestamp=1591629369.8138237) [(‘tile_co’, [-1, 2]), (‘tile_oh’, [-1, 22]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1433 DEBUG:autotvm:No: 1435 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=10.52986478805542, timestamp=1591629369.5780299) [(‘tile_co’, [-1, 1]), (‘tile_oh’, [-1, 24]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1434 DEBUG:autotvm:No: 1436 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=10.753106594085693, timestamp=1591629370.050331) [(‘tile_co’, [-1, 2]), (‘tile_oh’, [-1, 24]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1435 DEBUG:autotvm:No: 1437 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=11.51386022567749, timestamp=1591629370.2912793) [(‘tile_co’, [-1, 1]), (‘tile_oh’, [-1, 30]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1436 DEBUG:autotvm:No: 1438 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=11.517874956130981, timestamp=1591629370.5257022) [(‘tile_co’, [-1, 2]), (‘tile_oh’, [-1, 30]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1437 DEBUG:autotvm:No: 1439 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=11.961278438568115, timestamp=1591629370.7580543) [(‘tile_co’, [-1, 1]), (‘tile_oh’, [-1, 33]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1438 DEBUG:autotvm:No: 1440 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Traceback (most recent call last):\n [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7]\n [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf]\n [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8]\n [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d]\n [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd]\n [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87]\n [bt] (2) /home/gal/code/TVM/tvm/build/li’,),), error_no=4, all_cost=11.604460000991821, timestamp=1591629370.9938722) [(‘tile_co’, [-1, 2]), (‘tile_oh’, [-1, 33]), (‘tile_ow’, [-1, 7]), (‘reorder_0’, [0, 1, 2, 3, 4, 5, 6, 9, 7, 8]), (‘ann_reduce’, [‘unroll’, ‘none’]), (‘ann_spatial’, [‘none’, ‘none’, ‘none’])],direct,None,1439 DEBUG:autotvm:Early stopped. Best iter: 0. Now should pick best DEBUG:autotvm:Finish loading 7200 records INFO:autotvm:Extract 0 best records from the [device].2D_CNN_CE.log.tmp DEBUG:autotvm:Finish loading 0 records Compile… WARNING:topi:Does not support weight pre-transform for dilated convolution. WARNING:topi:Does not support weight pre-transform for dilated convolution. WARNING:topi:Does not support weight pre-transform for dilated convolution. WARNING:topi:Does not support weight pre-transform for dilated convolution. finished compiling Traceback (most recent call last):

File “2D_CNN_CE.py”, line 215, in tune_and_evaluate(tuning_option)

File “2D_CNN_CE.py”, line 179, in tune_and_evaluate rlib = remote.load_module(filename)

File “/home/gal/code/TVM/tvm/python/tvm/rpc/client.py”, line 148, in load_module return base._LoadRemoteModule(self._sess, path)

File “/home/gal/code/TVM/tvm/python/tvm/_ffi/_ctypes/function.py”, line 207, in call raise get_last_ffi_error()

tvm._ffi.base.TVMError: Traceback (most recent call last): [bt] (8) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::ServerLoop()+0x107) [0x7f41addabed7] [bt] (7) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x17f) [0x7f41addabbdf] [bt] (6) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x2a8) [0x7f41addb1fb8] [bt] (5) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x36d) [0x7f41addb195d] [bt] (4) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x37d) [0x7f41addb03dd] [bt] (3) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x2f7) [0x7f41addaaf87] [bt] (2) /home/gal/code/TVM/tvm/build/libtvm.so(void tvm::runtime::RPCSession::EventHandler::CallHandler<void ()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue)>(void ()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue))+0x7e) [0x7f41addafbee] [bt] (1) /home/gal/code/TVM/tvm/build/libtvm.so(tvm::runtime::RPCModuleLoad(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)+0xc3) [0x7f41addaa493] [bt] (0) /home/gal/code/TVM/tvm/build/libtvm.so(+0xb2a28b) [0x7f41add3c28b] File “/home/gal/code/TVM/tvm/python/tvm/_ffi/_ctypes/function.py”, line 72, in cfun rv = local_pyfunc(*pyargs) File “/home/gal/code/TVM/tvm/python/tvm/rpc/server.py”, line 69, in load_module m = _load_module(path) File “/home/gal/code/TVM/tvm/python/tvm/module.py”, line 266, in load _cc.create_shared(path + “.so”, files) File “/home/gal/code/TVM/tvm/python/tvm/contrib/cc.py”, line 48, in create_shared _linux_compile(output, objects, options, cc) File “/home/gal/code/TVM/tvm/python/tvm/contrib/cc.py”, line 132, in _linux_compile raise RuntimeError(msg) TVMError: Except caught from RPC call: RuntimeError: Compilation error: /usr/bin/ld: /tmp/tmpuzxvm646/net/lib.o: Relocations in generic ELF (EM: 183) /usr/bin/ld: /tmp/tmpuzxvm646/net/lib.o: Relocations in generic ELF (EM: 183) /usr/bin/ld: /tmp/tmpuzxvm646/net/lib.o: Relocations in generic ELF (EM: 183) /usr/bin/ld: /tmp/tmpuzxvm646/net/lib.o: Relocations in generic ELF (EM: 183) /usr/bin/ld: /tmp/tmpuzxvm646/net/lib.o: Relocations in generic ELF (EM: 183) /tmp/tmpuzxvm646/net/lib.o: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status

Any idea what is going on here? Thanks!

According to File in wrong format , it might be some mis-settings on ARM machine. You may check 1) if you built the TVM with the LLVM for ARM CPU; 2) if your target string is correct (reference: https://github.com/apache/incubator-tvm/issues/376); 3) if a model can be compiled and executed without running AutoTVM.