From a63a48639bd8d5eda351d443c7ea4f8f2bfdfdbf Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Fri, 22 Oct 2021 21:52:11 +0000 Subject: [PATCH] Workaround for using module.benchmark() on micro targets Workaround for error: Traceback (most recent call last): File "/home/gromero/scripts/./test.py", line 50, in times = module.benchmark(dev, number=1, repeat=1) File "/home/gromero/git/tvm/python/tvm/contrib/graph_executor.py", line 407, in benchmark return self.module.time_evaluator( File "/home/gromero/git/tvm/python/tvm/runtime/module.py", line 292, in evaluator blob = feval(*args) File "tvm/_ffi/_cython/./packed_func.pxi", line 323, in tvm._ffi._cy3.core.PackedFuncBase.__call__ File "tvm/_ffi/_cython/./packed_func.pxi", line 257, in tvm._ffi._cy3.core.FuncCall File "tvm/_ffi/_cython/./packed_func.pxi", line 246, in tvm._ffi._cy3.core.FuncCall3 File "tvm/_ffi/_cython/./base.pxi", line 163, in tvm._ffi._cy3.core.CALL tvm._ffi.base.TVMError: Traceback (most recent call last): 3: TVMFuncCall 2: _ZNSt17_Function_handlerIFvN3tvm 1: tvm::runtime::WrapTimeEvaluator(tvm::runtime::PackedFunc, DLDevice, int, int, int, tvm::runtime::PackedFunc)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) 0: tvm::runtime::Timer::Start(DLDevice) File "/home/gromero/git/tvm/include/tvm/runtime/device_api.h", line 272 TVMError: unknown type =129 --- include/tvm/runtime/device_api.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/tvm/runtime/device_api.h b/include/tvm/runtime/device_api.h index c3d83bf2993f9..4b6833cd56f05 100644 --- a/include/tvm/runtime/device_api.h +++ b/include/tvm/runtime/device_api.h @@ -268,6 +268,8 @@ inline const char* DeviceName(int type) { return "webgpu"; case kDLHexagon: return "hexagon"; + case 129: + return "micro"; default: LOG(FATAL) << "unknown type =" << type; return "Unknown";