From 081841006c20eada3bd2988772e0d4807a669a84 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 15:27:58 -0700 Subject: [PATCH 01/13] refactor --- NEWS.md | 2 +- apps/microtvm/zephyr/aot_demo/src/main.c | 32 +++++++++---------- .../zephyr/aot_demo/src/zephyr_uart.c | 8 ++--- src/runtime/crt/host/main.cc | 28 ++++++++-------- src/runtime/rpc/rpc_endpoint.cc | 4 +-- tests/micro/zephyr/test_zephyr.py | 4 +-- tests/python/relay/aot/test_crt_aot.py | 2 +- tutorials/get_started/install.py | 2 +- 8 files changed, 41 insertions(+), 41 deletions(-) diff --git a/NEWS.md b/NEWS.md index a5da068c895c..c1f0276ee713 100644 --- a/NEWS.md +++ b/NEWS.md @@ -36,7 +36,7 @@ v0.7 brings many major features. The community works together to refactor the in * Intial Hexagon support * Bring your own codegen (BYOC) support -The community also continues to bring high quality improvements to the existing modules including, but not limited to: better frontend coverage, performance, quantization, uTVM and dynamic shape support. +The community also continues to bring high quality improvements to the existing modules including, but not limited to: better frontend coverage, performance, quantization, microTVM and dynamic shape support. ## New Features ### Automatic Scheduling (Experimental) diff --git a/apps/microtvm/zephyr/aot_demo/src/main.c b/apps/microtvm/zephyr/aot_demo/src/main.c index b92366a7098b..7ee812ffc33e 100644 --- a/apps/microtvm/zephyr/aot_demo/src/main.c +++ b/apps/microtvm/zephyr/aot_demo/src/main.c @@ -83,26 +83,26 @@ void timer_expiry_function(struct k_timer* timer_id) { return; } #define MILLIS_TIL_EXPIRY 200 #define TIME_TIL_EXPIRY (K_MSEC(MILLIS_TIL_EXPIRY)) -struct k_timer g_utvm_timer; -uint32_t g_utvm_start_time; -int g_utvm_timer_running = 0; +struct k_timer g_microtvm_timer; +uint32_t g_microtvm_start_time; +int g_microtvm_timer_running = 0; // Called to start system timer. tvm_crt_error_t TVMPlatformTimerStart() { - if (g_utvm_timer_running) { + if (g_microtvm_timer_running) { TVMLogf("timer already running"); return kTvmErrorPlatformTimerBadState; } - k_timer_start(&g_utvm_timer, TIME_TIL_EXPIRY, TIME_TIL_EXPIRY); - g_utvm_start_time = k_cycle_get_32(); - g_utvm_timer_running = 1; + k_timer_start(&g_microtvm_timer, TIME_TIL_EXPIRY, TIME_TIL_EXPIRY); + g_microtvm_start_time = k_cycle_get_32(); + g_microtvm_timer_running = 1; return kTvmErrorNoError; } // Called to stop system timer. tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { - if (!g_utvm_timer_running) { + if (!g_microtvm_timer_running) { TVMLogf("timer not running"); return kTvmErrorSystemErrorMask | 2; } @@ -110,11 +110,11 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { uint32_t stop_time = k_cycle_get_32(); // compute how long the work took - uint32_t cycles_spent = stop_time - g_utvm_start_time; - if (stop_time < g_utvm_start_time) { + uint32_t cycles_spent = stop_time - g_microtvm_start_time; + if (stop_time < g_microtvm_start_time) { // we rolled over *at least* once, so correct the rollover it was *only* // once, because we might still use this result - cycles_spent = ~((uint32_t)0) - (g_utvm_start_time - stop_time); + cycles_spent = ~((uint32_t)0) - (g_microtvm_start_time - stop_time); } uint32_t ns_spent = (uint32_t)k_cyc_to_ns_floor64(cycles_spent); @@ -122,13 +122,13 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { // need to grab time remaining *before* stopping. when stopped, this function // always returns 0. - int32_t time_remaining_ms = k_timer_remaining_get(&g_utvm_timer); - k_timer_stop(&g_utvm_timer); + int32_t time_remaining_ms = k_timer_remaining_get(&g_microtvm_timer); + k_timer_stop(&g_microtvm_timer); // check *after* stopping to prevent extra expiries on the happy path if (time_remaining_ms < 0) { return kTvmErrorSystemErrorMask | 3; } - uint32_t num_expiries = k_timer_status_get(&g_utvm_timer); + uint32_t num_expiries = k_timer_status_get(&g_microtvm_timer); uint32_t timer_res_ms = ((num_expiries * MILLIS_TIL_EXPIRY) + time_remaining_ms); double approx_num_cycles = (double)k_ticks_to_cyc_floor32(1) * (double)k_ms_to_ticks_ceil32(timer_res_ms); @@ -140,7 +140,7 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { *elapsed_time_seconds = hw_clock_res_us / 1e6; } - g_utvm_timer_running = 0; + g_microtvm_timer_running = 0; return kTvmErrorNoError; } @@ -172,7 +172,7 @@ void main(void) { g_cmd_buf_ind = 0; memset((char*)cmd_buf, 0, sizeof(cmd_buf)); TVMPlatformUARTInit(); - k_timer_init(&g_utvm_timer, NULL, NULL); + k_timer_init(&g_microtvm_timer, NULL, NULL); // Wake up host side. TVMPlatformWriteSerial(g_wakeup_sequence, sizeof(g_wakeup_sequence)); diff --git a/apps/microtvm/zephyr/aot_demo/src/zephyr_uart.c b/apps/microtvm/zephyr/aot_demo/src/zephyr_uart.c index 1f4dde1de4b9..c9eec8751100 100644 --- a/apps/microtvm/zephyr/aot_demo/src/zephyr_uart.c +++ b/apps/microtvm/zephyr/aot_demo/src/zephyr_uart.c @@ -23,7 +23,7 @@ #include "crt_config.h" -static const struct device* g_utvm_uart; +static const struct device* g_microtvm_uart; #define RING_BUF_SIZE_BYTES (TVM_CRT_MAX_PACKET_SIZE_BYTES + 100) // Ring buffer used to store data read from the UART on rx interrupt. @@ -68,7 +68,7 @@ uint32_t TVMPlatformUartRxRead(uint8_t* data, uint32_t data_size_bytes) { uint32_t TVMPlatformWriteSerial(const char* data, uint32_t size) { for (uint32_t i = 0; i < size; i++) { - uart_poll_out(g_utvm_uart, data[i]); + uart_poll_out(g_microtvm_uart, data[i]); } return size; } @@ -76,6 +76,6 @@ uint32_t TVMPlatformWriteSerial(const char* data, uint32_t size) { // Initialize UART void TVMPlatformUARTInit() { // Claim console device. - g_utvm_uart = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console))); - uart_rx_init(&uart_rx_rbuf, g_utvm_uart); + g_microtvm_uart = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console))); + uart_rx_init(&uart_rx_rbuf, g_microtvm_uart); } diff --git a/src/runtime/crt/host/main.cc b/src/runtime/crt/host/main.cc index 0b0c81169756..18b43d5edc21 100644 --- a/src/runtime/crt/host/main.cc +++ b/src/runtime/crt/host/main.cc @@ -69,29 +69,29 @@ tvm_crt_error_t TVMPlatformMemoryFree(void* ptr, DLDevice dev) { return memory_manager->Free(memory_manager, ptr, dev); } -steady_clock::time_point g_utvm_start_time; -int g_utvm_timer_running = 0; +steady_clock::time_point g_microtvm_start_time; +int g_microtvm_timer_running = 0; tvm_crt_error_t TVMPlatformTimerStart() { - if (g_utvm_timer_running) { + if (g_microtvm_timer_running) { std::cerr << "timer already running" << std::endl; return kTvmErrorPlatformTimerBadState; } - g_utvm_start_time = std::chrono::steady_clock::now(); - g_utvm_timer_running = 1; + g_microtvm_start_time = std::chrono::steady_clock::now(); + g_microtvm_timer_running = 1; return kTvmErrorNoError; } tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { - if (!g_utvm_timer_running) { + if (!g_microtvm_timer_running) { std::cerr << "timer not running" << std::endl; return kTvmErrorPlatformTimerBadState; } - auto utvm_stop_time = std::chrono::steady_clock::now(); + auto microtvm_stop_time = std::chrono::steady_clock::now(); std::chrono::microseconds time_span = - std::chrono::duration_cast(utvm_stop_time - g_utvm_start_time); + std::chrono::duration_cast(microtvm_stop_time - g_microtvm_start_time); *elapsed_time_seconds = static_cast(time_span.count()) / 1e6; - g_utvm_timer_running = 0; + g_microtvm_timer_running = 0; return kTvmErrorNoError; } @@ -117,7 +117,7 @@ static char** g_argv = NULL; int testonly_reset_server(TVMValue* args, int* type_codes, int num_args, TVMValue* out_ret_value, int* out_ret_tcode, void* resource_handle) { execvp(g_argv[0], g_argv); - perror("utvm runtime: error restarting"); + perror("microtvm runtime: error restarting"); return -1; } @@ -141,7 +141,7 @@ int main(int argc, char** argv) { (TVMFunctionHandle)&testonly_reset_server, 0); if (error) { fprintf(stderr, - "utvm runtime: internal error (error#: %x) registering global packedfunc; exiting\n", + "microtvm runtime: internal error (error#: %x) registering global packedfunc; exiting\n", error); return 2; } @@ -153,10 +153,10 @@ int main(int argc, char** argv) { uint8_t c; int ret_code = read(STDIN_FILENO, &c, 1); if (ret_code < 0) { - perror("utvm runtime: read failed"); + perror("microtvm runtime: read failed"); return 2; } else if (ret_code == 0) { - fprintf(stderr, "utvm runtime: 0-length read, exiting!\n"); + fprintf(stderr, "microtvm runtime: 0-length read, exiting!\n"); return 2; } uint8_t* cursor = &c; @@ -167,7 +167,7 @@ int main(int argc, char** argv) { break; } else if (err != kTvmErrorNoError) { char buf[1024]; - snprintf(buf, sizeof(buf), "utvm runtime: UTvmRpcServerLoop error: %08x", err); + snprintf(buf, sizeof(buf), "microtvm runtime: UTvmRpcServerLoop error: %08x", err); perror(buf); return 2; } diff --git a/src/runtime/rpc/rpc_endpoint.cc b/src/runtime/rpc/rpc_endpoint.cc index 9bb782b384dd..e83f062795e4 100644 --- a/src/runtime/rpc/rpc_endpoint.cc +++ b/src/runtime/rpc/rpc_endpoint.cc @@ -204,7 +204,7 @@ class RPCEndpoint::EventHandler : public dmlc::Stream { using Stream::WriteArray; void MessageStart(uint64_t packet_nbytes) { - // Unused here, implemented for uTVM framing layer. + // Unused here, implemented for microTVM framing layer. } bool Read(RPCCode* code) { @@ -219,7 +219,7 @@ class RPCEndpoint::EventHandler : public dmlc::Stream { } void MessageDone() { - // Unused here, implemented for uTVM framing layer. + // Unused here, implemented for microTVM framing layer. } template diff --git a/tests/micro/zephyr/test_zephyr.py b/tests/micro/zephyr/test_zephyr.py index 96bcdfe5d86d..cf9447bc2b10 100644 --- a/tests/micro/zephyr/test_zephyr.py +++ b/tests/micro/zephyr/test_zephyr.py @@ -334,8 +334,8 @@ def check_result( tvm.testing.assert_allclose(out.numpy(), results[idx], rtol=TOL, atol=TOL) -def test_byoc_utvm(platform, west_cmd, skip_build, tvm_debug): - """This is a simple test case to check BYOC capabilities of uTVM""" +def test_byoc_microtvm(platform, west_cmd, skip_build, tvm_debug): + """This is a simple test case to check BYOC capabilities of microTVM""" model, zephyr_board = PLATFORMS[platform] build_config = {"skip_build": skip_build, "debug": tvm_debug} x = relay.var("x", shape=(10, 10)) diff --git a/tests/python/relay/aot/test_crt_aot.py b/tests/python/relay/aot/test_crt_aot.py index 4f8de450d9f1..ccdc7160881c 100644 --- a/tests/python/relay/aot/test_crt_aot.py +++ b/tests/python/relay/aot/test_crt_aot.py @@ -340,7 +340,7 @@ def visit_call(self, call): @pytest.mark.parametrize("use_calculated_workspaces", [True, False]) @pytest.mark.parametrize("target_options", [""]) -def test_byoc_utvm(use_calculated_workspaces, target_options): +def test_byoc_microtvm(use_calculated_workspaces, target_options): """This is a simple test case to check BYOC capabilities of AOT""" x = relay.var("x", shape=(10, 10)) w0 = relay.var("w0", shape=(10, 10)) diff --git a/tutorials/get_started/install.py b/tutorials/get_started/install.py index efc951a52709..e022e4b1ae2e 100644 --- a/tutorials/get_started/install.py +++ b/tutorials/get_started/install.py @@ -32,7 +32,7 @@ # ---------------------- # Installing from source is the recommended method for installing TVM. It will # allow you to enable specific features such as GPU support, microcontroller -# support (uTVM), and a debugging runtime, and other features. You will also +# support (microTVM), and a debugging runtime, and other features. You will also # want to install from source if you want to actively contribute to the TVM # project. The full instructions are on the `Install TVM From Source # `_ page. From 4cf205e36572332e4a1f5588e6629853ea557482 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 15:39:48 -0700 Subject: [PATCH 02/13] rename utvm_rpc_server.h --- apps/microtvm/zephyr/host_driven/src/main.c | 32 +++++++++---------- ...tvm_rpc_server.h => microtvm_rpc_server.h} | 8 ++--- src/runtime/crt/host/main.cc | 12 +++---- src/runtime/crt/utvm_rpc_server/rpc_server.cc | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) rename include/tvm/runtime/crt/{utvm_rpc_server.h => microtvm_rpc_server.h} (94%) diff --git a/apps/microtvm/zephyr/host_driven/src/main.c b/apps/microtvm/zephyr/host_driven/src/main.c index 637a58ae92fd..d9d8bff0c691 100644 --- a/apps/microtvm/zephyr/host_driven/src/main.c +++ b/apps/microtvm/zephyr/host_driven/src/main.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -146,14 +146,14 @@ tvm_crt_error_t TVMPlatformMemoryFree(void* ptr, DLDevice dev) { #define MILLIS_TIL_EXPIRY 200 #define TIME_TIL_EXPIRY (K_MSEC(MILLIS_TIL_EXPIRY)) -K_TIMER_DEFINE(g_utvm_timer, /* expiry func */ NULL, /* stop func */ NULL); +K_TIMER_DEFINE(g_microtvm_timer, /* expiry func */ NULL, /* stop func */ NULL); -uint32_t g_utvm_start_time; -int g_utvm_timer_running = 0; +uint32_t g_microtvm_start_time; +int g_microtvm_timer_running = 0; // Called to start system timer. tvm_crt_error_t TVMPlatformTimerStart() { - if (g_utvm_timer_running) { + if (g_microtvm_timer_running) { TVMLogf("timer already running"); return kTvmErrorPlatformTimerBadState; } @@ -161,15 +161,15 @@ tvm_crt_error_t TVMPlatformTimerStart() { #ifdef CONFIG_LED gpio_pin_set(led0_pin, LED0_PIN, 1); #endif - k_timer_start(&g_utvm_timer, TIME_TIL_EXPIRY, TIME_TIL_EXPIRY); - g_utvm_start_time = k_cycle_get_32(); - g_utvm_timer_running = 1; + k_timer_start(&g_microtvm_timer, TIME_TIL_EXPIRY, TIME_TIL_EXPIRY); + g_microtvm_start_time = k_cycle_get_32(); + g_microtvm_timer_running = 1; return kTvmErrorNoError; } // Called to stop system timer. tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { - if (!g_utvm_timer_running) { + if (!g_microtvm_timer_running) { TVMLogf("timer not running"); return kTvmErrorSystemErrorMask | 2; } @@ -180,11 +180,11 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { #endif // compute how long the work took - uint32_t cycles_spent = stop_time - g_utvm_start_time; - if (stop_time < g_utvm_start_time) { + uint32_t cycles_spent = stop_time - g_microtvm_start_time; + if (stop_time < g_microtvm_start_time) { // we rolled over *at least* once, so correct the rollover it was *only* // once, because we might still use this result - cycles_spent = ~((uint32_t)0) - (g_utvm_start_time - stop_time); + cycles_spent = ~((uint32_t)0) - (g_microtvm_start_time - stop_time); } uint32_t ns_spent = (uint32_t)k_cyc_to_ns_floor64(cycles_spent); @@ -192,14 +192,14 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { // need to grab time remaining *before* stopping. when stopped, this function // always returns 0. - int32_t time_remaining_ms = k_timer_remaining_get(&g_utvm_timer); - k_timer_stop(&g_utvm_timer); + int32_t time_remaining_ms = k_timer_remaining_get(&g_microtvm_timer); + k_timer_stop(&g_microtvm_timer); // check *after* stopping to prevent extra expiries on the happy path if (time_remaining_ms < 0) { TVMLogf("negative time remaining"); return kTvmErrorSystemErrorMask | 3; } - uint32_t num_expiries = k_timer_status_get(&g_utvm_timer); + uint32_t num_expiries = k_timer_status_get(&g_microtvm_timer); uint32_t timer_res_ms = ((num_expiries * MILLIS_TIL_EXPIRY) + time_remaining_ms); double approx_num_cycles = (double)k_ticks_to_cyc_floor32(1) * (double)k_ms_to_ticks_ceil32(timer_res_ms); @@ -211,7 +211,7 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { *elapsed_time_seconds = hw_clock_res_us / 1e6; } - g_utvm_timer_running = 0; + g_microtvm_timer_running = 0; return kTvmErrorNoError; } diff --git a/include/tvm/runtime/crt/utvm_rpc_server.h b/include/tvm/runtime/crt/microtvm_rpc_server.h similarity index 94% rename from include/tvm/runtime/crt/utvm_rpc_server.h rename to include/tvm/runtime/crt/microtvm_rpc_server.h index b4fb2b8ad03b..f3ade3dc3f55 100644 --- a/include/tvm/runtime/crt/utvm_rpc_server.h +++ b/include/tvm/runtime/crt/microtvm_rpc_server.h @@ -18,12 +18,12 @@ */ /*! - * \file utvm_rpc_server.h + * \file microtvm_rpc_server.h * \brief MicroTVM RPC Server */ -#ifndef TVM_RUNTIME_CRT_UTVM_RPC_SERVER_H_ -#define TVM_RUNTIME_CRT_UTVM_RPC_SERVER_H_ +#ifndef TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_ +#define TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_ #include #include @@ -74,4 +74,4 @@ tvm_crt_error_t UTvmRpcServerLoop(utvm_rpc_server_t server, uint8_t** new_data, } #endif -#endif // TVM_RUNTIME_CRT_UTVM_RPC_SERVER_H_ +#endif // TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_ diff --git a/src/runtime/crt/host/main.cc b/src/runtime/crt/host/main.cc index 18b43d5edc21..347e1d58d635 100644 --- a/src/runtime/crt/host/main.cc +++ b/src/runtime/crt/host/main.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -117,7 +117,7 @@ static char** g_argv = NULL; int testonly_reset_server(TVMValue* args, int* type_codes, int num_args, TVMValue* out_ret_value, int* out_ret_tcode, void* resource_handle) { execvp(g_argv[0], g_argv); - perror("microtvm runtime: error restarting"); + perror("microTVM runtime: error restarting"); return -1; } @@ -141,7 +141,7 @@ int main(int argc, char** argv) { (TVMFunctionHandle)&testonly_reset_server, 0); if (error) { fprintf(stderr, - "microtvm runtime: internal error (error#: %x) registering global packedfunc; exiting\n", + "microTVM runtime: internal error (error#: %x) registering global packedfunc; exiting\n", error); return 2; } @@ -153,10 +153,10 @@ int main(int argc, char** argv) { uint8_t c; int ret_code = read(STDIN_FILENO, &c, 1); if (ret_code < 0) { - perror("microtvm runtime: read failed"); + perror("microTVM runtime: read failed"); return 2; } else if (ret_code == 0) { - fprintf(stderr, "microtvm runtime: 0-length read, exiting!\n"); + fprintf(stderr, "microTVM runtime: 0-length read, exiting!\n"); return 2; } uint8_t* cursor = &c; @@ -167,7 +167,7 @@ int main(int argc, char** argv) { break; } else if (err != kTvmErrorNoError) { char buf[1024]; - snprintf(buf, sizeof(buf), "microtvm runtime: UTvmRpcServerLoop error: %08x", err); + snprintf(buf, sizeof(buf), "microTVM runtime: UTvmRpcServerLoop error: %08x", err); perror(buf); return 2; } diff --git a/src/runtime/crt/utvm_rpc_server/rpc_server.cc b/src/runtime/crt/utvm_rpc_server/rpc_server.cc index 1736f98dad12..76d4d850ad47 100644 --- a/src/runtime/crt/utvm_rpc_server/rpc_server.cc +++ b/src/runtime/crt/utvm_rpc_server/rpc_server.cc @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include "../../minrpc/minrpc_server.h" #include "crt_config.h" From 015b165dce857d328e84a981a64f1af4d3104668 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 15:47:29 -0700 Subject: [PATCH 03/13] rename file --- .../micro/standalone/{utvm_runtime.h => microtvm_runtime.h} | 6 +++--- src/runtime/micro/standalone/utvm_runtime.cc | 2 +- ...andalone_test.cc => microtvm_runtime_standalone_test.cc} | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename include/tvm/runtime/micro/standalone/{utvm_runtime.h => microtvm_runtime.h} (89%) rename tests/cpp/{utvm_runtime_standalone_test.cc => microtvm_runtime_standalone_test.cc} (98%) diff --git a/include/tvm/runtime/micro/standalone/utvm_runtime.h b/include/tvm/runtime/micro/standalone/microtvm_runtime.h similarity index 89% rename from include/tvm/runtime/micro/standalone/utvm_runtime.h rename to include/tvm/runtime/micro/standalone/microtvm_runtime.h index ef6cd4023dba..216f5cf6cc8f 100644 --- a/include/tvm/runtime/micro/standalone/utvm_runtime.h +++ b/include/tvm/runtime/micro/standalone/microtvm_runtime.h @@ -17,8 +17,8 @@ * under the License. */ -#ifndef TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_H_ -#define TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_H_ +#ifndef TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_H_ +#define TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_H_ #include #include @@ -41,4 +41,4 @@ TVM_MICRO_RUNTIME_API_API void UTVMRuntimeDSOModuleDestroy(void* module); #undef TVM_MICRO_RUNTIME_API_API -#endif // TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_H_ +#endif // TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_H_ diff --git a/src/runtime/micro/standalone/utvm_runtime.cc b/src/runtime/micro/standalone/utvm_runtime.cc index 585da9300128..f3241c2b5018 100644 --- a/src/runtime/micro/standalone/utvm_runtime.cc +++ b/src/runtime/micro/standalone/utvm_runtime.cc @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -#include "tvm/runtime/micro/standalone/utvm_runtime.h" +#include "tvm/runtime/micro/standalone/microtvm_runtime.h" #include diff --git a/tests/cpp/utvm_runtime_standalone_test.cc b/tests/cpp/microtvm_runtime_standalone_test.cc similarity index 98% rename from tests/cpp/utvm_runtime_standalone_test.cc rename to tests/cpp/microtvm_runtime_standalone_test.cc index e674c3b74144..f56140466165 100644 --- a/tests/cpp/utvm_runtime_standalone_test.cc +++ b/tests/cpp/microtvm_runtime_standalone_test.cc @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include From 87eac7480d73acbb1f9015feedf77c6a9e4921b0 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 15:56:30 -0700 Subject: [PATCH 04/13] rename --- .../micro/standalone/microtvm_runtime.h | 14 +++++++------- ..._executor.cc => microtvm_graph_executor.cc} | 2 +- ...ph_executor.h => microtvm_graph_executor.h} | 6 +++--- .../{utvm_runtime.cc => microtvm_runtime.cc} | 16 ++++++++-------- tests/cpp/microtvm_runtime_standalone_test.cc | 18 +++++++++--------- 5 files changed, 28 insertions(+), 28 deletions(-) rename src/runtime/micro/standalone/{utvm_graph_executor.cc => microtvm_graph_executor.cc} (99%) rename src/runtime/micro/standalone/{utvm_graph_executor.h => microtvm_graph_executor.h} (95%) rename src/runtime/micro/standalone/{utvm_runtime.cc => microtvm_runtime.cc} (77%) diff --git a/include/tvm/runtime/micro/standalone/microtvm_runtime.h b/include/tvm/runtime/micro/standalone/microtvm_runtime.h index 216f5cf6cc8f..6cbae5c15770 100644 --- a/include/tvm/runtime/micro/standalone/microtvm_runtime.h +++ b/include/tvm/runtime/micro/standalone/microtvm_runtime.h @@ -25,19 +25,19 @@ #define TVM_MICRO_RUNTIME_API_API extern "C" __attribute__((visibility("default"))) -TVM_MICRO_RUNTIME_API_API void* UTVMRuntimeCreate(const char* json, size_t json_len, void* module); +TVM_MICRO_RUNTIME_API_API void* MicroTVMRuntimeCreate(const char* json, size_t json_len, void* module); -TVM_MICRO_RUNTIME_API_API void UTVMRuntimeDestroy(void* handle); +TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeDestroy(void* handle); -TVM_MICRO_RUNTIME_API_API void UTVMRuntimeSetInput(void* handle, int index, void* tensor); +TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeSetInput(void* handle, int index, void* tensor); -TVM_MICRO_RUNTIME_API_API void UTVMRuntimeRun(void* handle); +TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeRun(void* handle); -TVM_MICRO_RUNTIME_API_API void UTVMRuntimeGetOutput(void* handle, int index, void* tensor); +TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeGetOutput(void* handle, int index, void* tensor); -TVM_MICRO_RUNTIME_API_API void* UTVMRuntimeDSOModuleCreate(const char* so, size_t so_len); +TVM_MICRO_RUNTIME_API_API void* MicroTVMRuntimeDSOModuleCreate(const char* so, size_t so_len); -TVM_MICRO_RUNTIME_API_API void UTVMRuntimeDSOModuleDestroy(void* module); +TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeDSOModuleDestroy(void* module); #undef TVM_MICRO_RUNTIME_API_API diff --git a/src/runtime/micro/standalone/utvm_graph_executor.cc b/src/runtime/micro/standalone/microtvm_graph_executor.cc similarity index 99% rename from src/runtime/micro/standalone/utvm_graph_executor.cc rename to src/runtime/micro/standalone/microtvm_graph_executor.cc index 920faa134cf5..d91d0ea74ba4 100644 --- a/src/runtime/micro/standalone/utvm_graph_executor.cc +++ b/src/runtime/micro/standalone/microtvm_graph_executor.cc @@ -17,7 +17,7 @@ * under the License. */ -#include "utvm_graph_executor.h" +#include "microtvm_graph_executor.h" #include diff --git a/src/runtime/micro/standalone/utvm_graph_executor.h b/src/runtime/micro/standalone/microtvm_graph_executor.h similarity index 95% rename from src/runtime/micro/standalone/utvm_graph_executor.h rename to src/runtime/micro/standalone/microtvm_graph_executor.h index afede6a7b30a..0925b95fb004 100644 --- a/src/runtime/micro/standalone/utvm_graph_executor.h +++ b/src/runtime/micro/standalone/microtvm_graph_executor.h @@ -17,8 +17,8 @@ * under the License. */ -#ifndef TVM_RUNTIME_MICRO_STANDALONE_UTVM_GRAPH_EXECUTOR_H_ -#define TVM_RUNTIME_MICRO_STANDALONE_UTVM_GRAPH_EXECUTOR_H_ +#ifndef TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_GRAPH_EXECUTOR_H_ +#define TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_GRAPH_EXECUTOR_H_ #include @@ -164,4 +164,4 @@ class MicroGraphExecutor { } // namespace micro } // namespace tvm -#endif // TVM_RUNTIME_MICRO_STANDALONE_UTVM_GRAPH_EXECUTOR_H_ +#endif // TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_GRAPH_EXECUTOR_H_ diff --git a/src/runtime/micro/standalone/utvm_runtime.cc b/src/runtime/micro/standalone/microtvm_runtime.cc similarity index 77% rename from src/runtime/micro/standalone/utvm_runtime.cc rename to src/runtime/micro/standalone/microtvm_runtime.cc index f3241c2b5018..a51be1414b68 100644 --- a/src/runtime/micro/standalone/utvm_runtime.cc +++ b/src/runtime/micro/standalone/microtvm_runtime.cc @@ -20,34 +20,34 @@ #include -#include "utvm_graph_executor.h" +#include "microtvm_graph_executor.h" -void* UTVMRuntimeCreate(const char* json, size_t json_len, void* module) { +void* MicroTVMRuntimeCreate(const char* json, size_t json_len, void* module) { return new tvm::micro::MicroGraphExecutor(std::string(json, json + json_len), reinterpret_cast(module)); } -void UTVMRuntimeDestroy(void* handle) { +void MicroTVMRuntimeDestroy(void* handle) { delete reinterpret_cast(handle); } -void UTVMRuntimeSetInput(void* handle, int index, void* tensor) { +void MicroTVMRuntimeSetInput(void* handle, int index, void* tensor) { reinterpret_cast(handle)->SetInput( index, reinterpret_cast(tensor)); } -void UTVMRuntimeRun(void* handle) { +void MicroTVMRuntimeRun(void* handle) { reinterpret_cast(handle)->Run(); } -void UTVMRuntimeGetOutput(void* handle, int index, void* tensor) { +void MicroTVMRuntimeGetOutput(void* handle, int index, void* tensor) { reinterpret_cast(handle)->CopyOutputTo( index, reinterpret_cast(tensor)); } -void* UTVMRuntimeDSOModuleCreate(const char* so, size_t so_len) { +void* MicroTVMRuntimeDSOModuleCreate(const char* so, size_t so_len) { return new tvm::micro::DSOModule(std::string(so, so + so_len)); } -void UTVMRuntimeDSOModuleDestroy(void* module) { +void MicroTVMRuntimeDSOModuleDestroy(void* module) { delete reinterpret_cast(module); } diff --git a/tests/cpp/microtvm_runtime_standalone_test.cc b/tests/cpp/microtvm_runtime_standalone_test.cc index f56140466165..0da88cfe64e5 100644 --- a/tests/cpp/microtvm_runtime_standalone_test.cc +++ b/tests/cpp/microtvm_runtime_standalone_test.cc @@ -107,23 +107,23 @@ TEST(MicroStandaloneRuntime, BuildModule) { const auto ret = system(ss.c_str()); ASSERT_EQ(ret, 0); // Now, execute the minimal runtime. - auto* dsoModule = UTVMRuntimeDSOModuleCreate(so_fname.c_str(), so_fname.size()); + auto* dsoModule = MicroTVMRuntimeDSOModuleCreate(so_fname.c_str(), so_fname.size()); ASSERT_NE(dsoModule, nullptr); - auto* handle = UTVMRuntimeCreate(json.c_str(), json.size(), dsoModule); + auto* handle = MicroTVMRuntimeCreate(json.c_str(), json.size(), dsoModule); ASSERT_NE(handle, nullptr); - UTVMRuntimeSetInput(handle, 0, const_cast(A.operator->())); - UTVMRuntimeSetInput(handle, 1, const_cast(B.operator->())); - UTVMRuntimeSetInput(handle, 2, const_cast(C.operator->())); - UTVMRuntimeRun(handle); + MicroTVMRuntimeSetInput(handle, 0, const_cast(A.operator->())); + MicroTVMRuntimeSetInput(handle, 1, const_cast(B.operator->())); + MicroTVMRuntimeSetInput(handle, 2, const_cast(C.operator->())); + MicroTVMRuntimeRun(handle); auto Y = tvm::runtime::NDArray::Empty({2, 3}, {kDLFloat, 32, 1}, {kDLCPU, 0}); - UTVMRuntimeGetOutput(handle, 0, const_cast(Y.operator->())); + MicroTVMRuntimeGetOutput(handle, 0, const_cast(Y.operator->())); auto* pY = (float*)Y->data; for (int i = 0; i < 6; ++i) { CHECK_LT(fabs(pY[i] - (i + (i + 1) + (i + 2))), 1e-4); } - UTVMRuntimeDestroy(handle); - UTVMRuntimeDSOModuleDestroy(dsoModule); + MicroTVMRuntimeDestroy(handle); + MicroTVMRuntimeDSOModuleDestroy(dsoModule); } #endif From 7238bf95658145f2fe9d85d49e741faf8be67029 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 15:59:37 -0700 Subject: [PATCH 05/13] rename file --- src/runtime/micro/standalone/microtvm_graph_executor.h | 2 +- .../{utvm_runtime_api.cc => microtvm_runtime_api.cc} | 2 +- .../{utvm_runtime_api.h => microtvm_runtime_api.h} | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/runtime/micro/standalone/{utvm_runtime_api.cc => microtvm_runtime_api.cc} (98%) rename src/runtime/micro/standalone/{utvm_runtime_api.h => microtvm_runtime_api.h} (91%) diff --git a/src/runtime/micro/standalone/microtvm_graph_executor.h b/src/runtime/micro/standalone/microtvm_graph_executor.h index 0925b95fb004..7f9653da44d1 100644 --- a/src/runtime/micro/standalone/microtvm_graph_executor.h +++ b/src/runtime/micro/standalone/microtvm_graph_executor.h @@ -31,7 +31,7 @@ #include #include "minimal_vector.h" -#include "utvm_runtime_api.h" +#include "microtvm_runtime_api.h" namespace tvm { namespace micro { diff --git a/src/runtime/micro/standalone/utvm_runtime_api.cc b/src/runtime/micro/standalone/microtvm_runtime_api.cc similarity index 98% rename from src/runtime/micro/standalone/utvm_runtime_api.cc rename to src/runtime/micro/standalone/microtvm_runtime_api.cc index a6ac420feec2..c266107faafb 100644 --- a/src/runtime/micro/standalone/utvm_runtime_api.cc +++ b/src/runtime/micro/standalone/microtvm_runtime_api.cc @@ -17,7 +17,7 @@ * under the License. */ -#include "utvm_runtime_api.h" +#include "microtvm_runtime_api.h" #include diff --git a/src/runtime/micro/standalone/utvm_runtime_api.h b/src/runtime/micro/standalone/microtvm_runtime_api.h similarity index 91% rename from src/runtime/micro/standalone/utvm_runtime_api.h rename to src/runtime/micro/standalone/microtvm_runtime_api.h index b38aa0a47a8c..47d4d80b9c09 100644 --- a/src/runtime/micro/standalone/utvm_runtime_api.h +++ b/src/runtime/micro/standalone/microtvm_runtime_api.h @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -#ifndef TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_API_H_ -#define TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_API_H_ +#ifndef TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_API_H_ +#define TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_API_H_ #include #include @@ -51,4 +51,4 @@ TVM_MICRO_RUNTIME_API_BACKEND_API const char* TVMGetLastError(void); #undef TVM_MICRO_RUNTIME_API_BACKEND_API -#endif // TVM_RUNTIME_MICRO_STANDALONE_UTVM_RUNTIME_API_H_ +#endif // TVM_RUNTIME_MICRO_STANDALONE_MICROTVM_RUNTIME_API_H_ From 81b6d6abea2dd7d5ee8db81dbe46081e173f498f Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 16:08:42 -0700 Subject: [PATCH 06/13] rename --- apps/microtvm/zephyr/host_driven/src/main.c | 6 +++--- include/tvm/runtime/crt/microtvm_rpc_server.h | 8 ++++---- src/runtime/crt/host/main.cc | 6 +++--- src/runtime/crt/utvm_rpc_server/rpc_server.cc | 14 +++++++------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/microtvm/zephyr/host_driven/src/main.c b/apps/microtvm/zephyr/host_driven/src/main.c index d9d8bff0c691..5b93d647eb00 100644 --- a/apps/microtvm/zephyr/host_driven/src/main.c +++ b/apps/microtvm/zephyr/host_driven/src/main.c @@ -285,14 +285,14 @@ void main(void) { uart_rx_init(&uart_rx_rbuf, tvm_uart); // Initialize microTVM RPC server, which will receive commands from the UART and execute them. - utvm_rpc_server_t server = UTvmRpcServerInit(write_serial, NULL); + microtvm_rpc_server_t server = MicroTVMRpcServerInit(write_serial, NULL); TVMLogf("microTVM Zephyr runtime - running"); #ifdef CONFIG_LED gpio_pin_set(led0_pin, LED0_PIN, 0); #endif // The main application loop. We continuously read commands from the UART - // and dispatch them to UTvmRpcServerLoop(). + // and dispatch them to MicroTVMRpcServerLoop(). while (true) { uint8_t* data; unsigned int key = irq_lock(); @@ -302,7 +302,7 @@ void main(void) { size_t bytes_remaining = bytes_read; while (bytes_remaining > 0) { // Pass the received bytes to the RPC server. - tvm_crt_error_t err = UTvmRpcServerLoop(server, &data, &bytes_remaining); + tvm_crt_error_t err = MicroTVMRpcServerLoop(server, &data, &bytes_remaining); if (err != kTvmErrorNoError && err != kTvmErrorFramingShortPacket) { TVMPlatformAbort(err); } diff --git a/include/tvm/runtime/crt/microtvm_rpc_server.h b/include/tvm/runtime/crt/microtvm_rpc_server.h index f3ade3dc3f55..093d39fd0b83 100644 --- a/include/tvm/runtime/crt/microtvm_rpc_server.h +++ b/include/tvm/runtime/crt/microtvm_rpc_server.h @@ -40,10 +40,10 @@ extern "C" { * \param num_bytes Number of bytes avaiable in data. * \return The number of bytes written. */ -typedef ssize_t (*utvm_rpc_channel_write_t)(void* context, const uint8_t* data, size_t num_bytes); +typedef ssize_t (*microtvm_rpc_channel_write_t)(void* context, const uint8_t* data, size_t num_bytes); /*! \brief Opaque pointer type to TVM RPC Server. */ -typedef void* utvm_rpc_server_t; +typedef void* microtvm_rpc_server_t; /*! \brief Initialize the TVM RPC Server. * @@ -56,7 +56,7 @@ typedef void* utvm_rpc_server_t; * \return A pointer to the TVM RPC Server. The pointer is allocated in the same memory space as * the TVM workspace. */ -utvm_rpc_server_t UTvmRpcServerInit(utvm_rpc_channel_write_t write_func, void* write_func_ctx); +microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void* write_func_ctx); /*! \brief Do any tasks suitable for the main thread, and maybe process new incoming data. * @@ -67,7 +67,7 @@ utvm_rpc_server_t UTvmRpcServerInit(utvm_rpc_channel_write_t write_func, void* w * updated to the number of unprocessed bytes remaining in `new_data` (usually 0). * \return An error code indicating the outcome of the server main loop iteration. */ -tvm_crt_error_t UTvmRpcServerLoop(utvm_rpc_server_t server, uint8_t** new_data, +tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server, uint8_t** new_data, size_t* new_data_size_bytes); #ifdef __cplusplus diff --git a/src/runtime/crt/host/main.cc b/src/runtime/crt/host/main.cc index 347e1d58d635..beae23761164 100644 --- a/src/runtime/crt/host/main.cc +++ b/src/runtime/crt/host/main.cc @@ -130,7 +130,7 @@ int main(int argc, char** argv) { return 2; } - utvm_rpc_server_t rpc_server = UTvmRpcServerInit(&UTvmWriteFunc, nullptr); + microtvm_rpc_server_t rpc_server = MicroTVMRpcServerInit(&UTvmWriteFunc, nullptr); #ifdef TVM_HOST_USE_GRAPH_EXECUTOR_MODULE CHECK_EQ(TVMGraphExecutorModule_Register(), kTvmErrorNoError, @@ -162,12 +162,12 @@ int main(int argc, char** argv) { uint8_t* cursor = &c; size_t bytes_to_process = 1; while (bytes_to_process > 0) { - tvm_crt_error_t err = UTvmRpcServerLoop(rpc_server, &cursor, &bytes_to_process); + tvm_crt_error_t err = MicroTVMRpcServerLoop(rpc_server, &cursor, &bytes_to_process); if (err == kTvmErrorPlatformShutdown) { break; } else if (err != kTvmErrorNoError) { char buf[1024]; - snprintf(buf, sizeof(buf), "microTVM runtime: UTvmRpcServerLoop error: %08x", err); + snprintf(buf, sizeof(buf), "microTVM runtime: MicroTVMRpcServerLoop error: %08x", err); perror(buf); return 2; } diff --git a/src/runtime/crt/utvm_rpc_server/rpc_server.cc b/src/runtime/crt/utvm_rpc_server/rpc_server.cc index 76d4d850ad47..bbd382f1e207 100644 --- a/src/runtime/crt/utvm_rpc_server/rpc_server.cc +++ b/src/runtime/crt/utvm_rpc_server/rpc_server.cc @@ -18,7 +18,7 @@ */ /*! - * \file utvm_rpc_server.cc + * \file rpc_server.cc * \brief MicroTVM RPC Server */ @@ -87,7 +87,7 @@ class MicroIOHandler { namespace { // Stored as globals so that they can be used to report initialization errors. -utvm_rpc_channel_write_t g_write_func = nullptr; +microtvm_rpc_channel_write_t g_write_func = nullptr; void* g_write_func_ctx = nullptr; } // namespace @@ -109,7 +109,7 @@ class SerialWriteStream : public WriteStream { class MicroRPCServer { public: MicroRPCServer(uint8_t* receive_storage, size_t receive_storage_size_bytes, - utvm_rpc_channel_write_t write_func, void* write_func_ctx) + microtvm_rpc_channel_write_t write_func, void* write_func_ctx) : receive_buffer_{receive_storage, receive_storage_size_bytes}, framer_{&send_stream_}, session_{&framer_, &receive_buffer_, &HandleCompleteMessageCb, this}, @@ -197,9 +197,9 @@ void* operator new[](size_t count, void* ptr) noexcept { return ptr; } extern "C" { -static utvm_rpc_server_t g_rpc_server = nullptr; +static microtvm_rpc_server_t g_rpc_server = nullptr; -utvm_rpc_server_t UTvmRpcServerInit(utvm_rpc_channel_write_t write_func, void* write_func_ctx) { +microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void* write_func_ctx) { tvm::runtime::micro_rpc::g_write_func = write_func; tvm::runtime::micro_rpc::g_write_func_ctx = write_func_ctx; @@ -223,7 +223,7 @@ utvm_rpc_server_t UTvmRpcServerInit(utvm_rpc_channel_write_t write_func, void* w } auto rpc_server = new (rpc_server_memory) tvm::runtime::micro_rpc::MicroRPCServer( receive_buffer, TVM_CRT_MAX_PACKET_SIZE_BYTES, write_func, write_func_ctx); - g_rpc_server = static_cast(rpc_server); + g_rpc_server = static_cast(rpc_server); rpc_server->Initialize(); return g_rpc_server; } @@ -258,7 +258,7 @@ void TVMLogf(const char* format, ...) { } } -tvm_crt_error_t UTvmRpcServerLoop(utvm_rpc_server_t server_ptr, uint8_t** new_data, +tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server_ptr, uint8_t** new_data, size_t* new_data_size_bytes) { tvm::runtime::micro_rpc::MicroRPCServer* server = static_cast(server_ptr); From 83111b8c4d431b622e593778217e1f56661257ae Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 16:13:24 -0700 Subject: [PATCH 07/13] variables --- include/tvm/runtime/crt/microtvm_rpc_server.h | 2 +- src/relay/backend/contrib/codegen_c/codegen.cc | 2 +- src/relay/backend/contrib/codegen_c/codegen_c.h | 2 +- src/runtime/crt/host/main.cc | 4 ++-- src/runtime/crt/utvm_rpc_common/framing.cc | 4 ++-- src/runtime/crt/utvm_rpc_common/session.cc | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/tvm/runtime/crt/microtvm_rpc_server.h b/include/tvm/runtime/crt/microtvm_rpc_server.h index 093d39fd0b83..f392b1046f42 100644 --- a/include/tvm/runtime/crt/microtvm_rpc_server.h +++ b/include/tvm/runtime/crt/microtvm_rpc_server.h @@ -47,7 +47,7 @@ typedef void* microtvm_rpc_server_t; /*! \brief Initialize the TVM RPC Server. * - * Call this on device startup before calling anyother utvm_rpc_server_ functions. + * Call this on device startup before calling anyother microtvm_rpc_server_ functions. * * \param write_func A callback function invoked by the TVM RPC Server to write data back to the * host. Internally, the TVM RPC Server will block until all data in a reply diff --git a/src/relay/backend/contrib/codegen_c/codegen.cc b/src/relay/backend/contrib/codegen_c/codegen.cc index 550afb3159fc..19b8c579cd8b 100644 --- a/src/relay/backend/contrib/codegen_c/codegen.cc +++ b/src/relay/backend/contrib/codegen_c/codegen.cc @@ -237,7 +237,7 @@ class CSourceCodegen : public CSourceModuleCodegenBase { // This segment would be generated in C++ because of the usage // of tvm::runtime::Array. This is not ideal, but this to demonstrate // constant copying process used packed imports in other external - // codegen. Moreover, in uTVM we dont expect this part to be generated. + // codegen. Moreover, in microTVM we dont expect this part to be generated. code_stream_ << "#ifdef __cplusplus\n"; code_stream_ << "#include \n"; code_stream_ << "#include \n"; diff --git a/src/relay/backend/contrib/codegen_c/codegen_c.h b/src/relay/backend/contrib/codegen_c/codegen_c.h index 32eecec25b06..0d575b3ec498 100644 --- a/src/relay/backend/contrib/codegen_c/codegen_c.h +++ b/src/relay/backend/contrib/codegen_c/codegen_c.h @@ -220,7 +220,7 @@ class CodegenCBase { // This segment would be generated in C++ because of the usage // of tvm::runtime::Array. This is not ideal, but this to demonstrate // constant copying process used packed imports in other external - // codegen. Moreover, in uTVM we dont expect this part to be generated. + // codegen. Moreover, in microTVM we dont expect this part to be generated. code_stream_ << "#ifdef __cplusplus\n"; code_stream_ << "int " << func_name << "_init_wrapper_(tvm::runtime::Array arr) {\n"; diff --git a/src/runtime/crt/host/main.cc b/src/runtime/crt/host/main.cc index beae23761164..38672dd87368 100644 --- a/src/runtime/crt/host/main.cc +++ b/src/runtime/crt/host/main.cc @@ -42,7 +42,7 @@ using namespace std::chrono; extern "C" { -ssize_t UTvmWriteFunc(void* context, const uint8_t* data, size_t num_bytes) { +ssize_t MicroTVMWriteFunc(void* context, const uint8_t* data, size_t num_bytes) { ssize_t to_return = write(STDOUT_FILENO, data, num_bytes); fflush(stdout); fsync(STDOUT_FILENO); @@ -130,7 +130,7 @@ int main(int argc, char** argv) { return 2; } - microtvm_rpc_server_t rpc_server = MicroTVMRpcServerInit(&UTvmWriteFunc, nullptr); + microtvm_rpc_server_t rpc_server = MicroTVMRpcServerInit(&MicroTVMWriteFunc, nullptr); #ifdef TVM_HOST_USE_GRAPH_EXECUTOR_MODULE CHECK_EQ(TVMGraphExecutorModule_Register(), kTvmErrorNoError, diff --git a/src/runtime/crt/utvm_rpc_common/framing.cc b/src/runtime/crt/utvm_rpc_common/framing.cc index 857ed2a23bec..cf79568605d5 100644 --- a/src/runtime/crt/utvm_rpc_common/framing.cc +++ b/src/runtime/crt/utvm_rpc_common/framing.cc @@ -34,8 +34,8 @@ // framer in its implementation. #ifdef TVM_CRT_FRAMER_ENABLE_LOGS #include -#define TVM_FRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "utvm framer: " msg " \n", ##__VA_ARGS__) -#define TVM_UNFRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "utvm unframer: " msg " \n", ##__VA_ARGS__) +#define TVM_FRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "microTVM framer: " msg " \n", ##__VA_ARGS__) +#define TVM_UNFRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "microTVM unframer: " msg " \n", ##__VA_ARGS__) #else #define TVM_FRAMER_DEBUG_LOG(msg, ...) #define TVM_UNFRAMER_DEBUG_LOG(msg, ...) diff --git a/src/runtime/crt/utvm_rpc_common/session.cc b/src/runtime/crt/utvm_rpc_common/session.cc index e1e338e42825..3570f6260cae 100644 --- a/src/runtime/crt/utvm_rpc_common/session.cc +++ b/src/runtime/crt/utvm_rpc_common/session.cc @@ -31,7 +31,7 @@ namespace tvm { namespace runtime { namespace micro_rpc { -struct utvm_session_start_payload_t { +struct microtvm_session_start_payload_t { uint8_t version; }; @@ -85,7 +85,7 @@ tvm_crt_error_t Session::StartSession() { RegenerateNonce(); SetSessionId(local_nonce_, 0); - utvm_session_start_payload_t payload = {Session::kVersion}; + microtvm_session_start_payload_t payload = {Session::kVersion}; tvm_crt_error_t to_return = SendInternal(MessageType::kStartSessionInit, reinterpret_cast(&payload), sizeof(payload)); if (to_return == 0) { @@ -182,7 +182,7 @@ void Session::ClearReceiveBuffer() { void Session::SendSessionStartReply(const SessionHeader& header) { RegenerateNonce(); SetSessionId(InitiatorNonce(header.session_id), local_nonce_); - utvm_session_start_payload_t payload = {Session::kVersion}; + microtvm_session_start_payload_t payload = {Session::kVersion}; tvm_crt_error_t to_return = SendInternal(MessageType::kStartSessionReply, reinterpret_cast(&payload), sizeof(payload)); state_ = State::kSessionEstablished; @@ -195,7 +195,7 @@ void Session::ProcessStartSessionInit(const SessionHeader& header) { return; } - utvm_session_start_payload_t payload; + microtvm_session_start_payload_t payload; int bytes_read = receive_buffer_->Read(reinterpret_cast(&payload), sizeof(payload)); if (bytes_read != sizeof(payload)) { return; @@ -235,7 +235,7 @@ void Session::ProcessStartSessionReply(const SessionHeader& header) { return; } - utvm_session_start_payload_t payload; + microtvm_session_start_payload_t payload; int bytes_read = receive_buffer_->Read(reinterpret_cast(&payload), sizeof(payload)); if (bytes_read != sizeof(payload)) { return; From 1168e1e3d4c6e2f41dfd5c912ec7c169fa18920c Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 16:17:28 -0700 Subject: [PATCH 08/13] directories --- cmake/modules/StandaloneCrt.cmake | 10 +++++----- python/tvm/micro/build.py | 2 +- src/runtime/crt/Makefile | 4 ++-- .../frame_buffer.cc | 0 .../framing.cc | 0 .../session.cc | 0 .../write_stream.cc | 0 .../rpc_server.cc | 0 8 files changed, 8 insertions(+), 8 deletions(-) rename src/runtime/crt/{utvm_rpc_common => microtvm_rpc_common}/frame_buffer.cc (100%) rename src/runtime/crt/{utvm_rpc_common => microtvm_rpc_common}/framing.cc (100%) rename src/runtime/crt/{utvm_rpc_common => microtvm_rpc_common}/session.cc (100%) rename src/runtime/crt/{utvm_rpc_common => microtvm_rpc_common}/write_stream.cc (100%) rename src/runtime/crt/{utvm_rpc_server => microtvm_rpc_server}/rpc_server.cc (100%) diff --git a/cmake/modules/StandaloneCrt.cmake b/cmake/modules/StandaloneCrt.cmake index 620f7552cef6..09f2ccc95d85 100644 --- a/cmake/modules/StandaloneCrt.cmake +++ b/cmake/modules/StandaloneCrt.cmake @@ -34,7 +34,7 @@ if(USE_MICRO) # Build an isolated build directory, separate from the TVM tree. list(APPEND CRT_FILE_COPY_JOBS "3rdparty/libcrc/include *.h -> include" - "3rdparty/libcrc/src crcccitt.c -> src/runtime/crt/utvm_rpc_common" + "3rdparty/libcrc/src crcccitt.c -> src/runtime/crt/microtvm_rpc_common" "3rdparty/libcrc/tab gentab_ccitt.inc -> src/runtime/crt/tab" "3rdparty/dlpack/include *.h -> include" "3rdparty/dmlc-core/include *.h -> include" @@ -49,8 +49,8 @@ if(USE_MICRO) "src/runtime/crt/host crt_config.h -> template/host" "src/runtime/crt/host *.cc -> template/host" "src/runtime/crt/memory *.c -> src/runtime/crt/memory" - "src/runtime/crt/utvm_rpc_common *.cc -> src/runtime/crt/utvm_rpc_common" - "src/runtime/crt/utvm_rpc_server *.cc -> src/runtime/crt/utvm_rpc_server" + "src/runtime/crt/microtvm_rpc_common *.cc -> src/runtime/crt/microtvm_rpc_common" + "src/runtime/crt/microtvm_rpc_server *.cc -> src/runtime/crt/microtvm_rpc_server" "src/runtime/minrpc *.h -> src/runtime/minrpc" "src/support generic_arena.h -> src/support" "src/runtime/crt crt_config-template.h -> template" @@ -98,7 +98,7 @@ if(USE_MICRO) set(make_quiet ) endif(${VERBOSE}) - list(APPEND crt_libraries memory graph_executor aot_executor utvm_rpc_server utvm_rpc_common common) # NOTE: listed in link order. + list(APPEND crt_libraries memory graph_executor aot_executor microtvm_rpc_server microtvm_rpc_common common) # NOTE: listed in link order. foreach(crt_lib_name IN LISTS crt_libraries) list(APPEND crt_library_paths "host_standalone_crt/lib${crt_lib_name}.a") endforeach() @@ -166,7 +166,7 @@ if(USE_MICRO) tvm_crt_define_targets() - set(TVM_CRT_LINKER_LIB host_standalone_crt_utvm_rpc_common) + set(TVM_CRT_LINKER_LIB host_standalone_crt_microtvm_rpc_common) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") list(APPEND TVM_RUNTIME_LINKER_LIBS -Wl,--whole-archive ${TVM_CRT_LINKER_LIB} -Wl,--no-whole-archive) elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") diff --git a/python/tvm/micro/build.py b/python/tvm/micro/build.py index 910b0ce1721f..694aebe6f1ed 100644 --- a/python/tvm/micro/build.py +++ b/python/tvm/micro/build.py @@ -111,7 +111,7 @@ def get_runtime_libs(executor: str) -> str: source (i.e. not header) files. """ if executor == "host-driven": - crt_runtime_lib_names = ["utvm_rpc_server", "utvm_rpc_common", "common"] + crt_runtime_lib_names = ["microtvm_rpc_server", "microtvm_rpc_common", "common"] elif executor == "aot": crt_runtime_lib_names = ["aot_executor", "common"] else: diff --git a/src/runtime/crt/Makefile b/src/runtime/crt/Makefile index 38c53d273a6e..f458a2f08002 100644 --- a/src/runtime/crt/Makefile +++ b/src/runtime/crt/Makefile @@ -71,8 +71,8 @@ LIBS = \ src/runtime/crt/aot_executor \ src/runtime/crt/graph_executor_module \ src/runtime/crt/memory \ - src/runtime/crt/utvm_rpc_common \ - src/runtime/crt/utvm_rpc_server + src/runtime/crt/microtvm_rpc_common \ + src/runtime/crt/microtvm_rpc_server $(foreach lib,$(LIBS),$(eval $(call LIB_template,$(lib)))) diff --git a/src/runtime/crt/utvm_rpc_common/frame_buffer.cc b/src/runtime/crt/microtvm_rpc_common/frame_buffer.cc similarity index 100% rename from src/runtime/crt/utvm_rpc_common/frame_buffer.cc rename to src/runtime/crt/microtvm_rpc_common/frame_buffer.cc diff --git a/src/runtime/crt/utvm_rpc_common/framing.cc b/src/runtime/crt/microtvm_rpc_common/framing.cc similarity index 100% rename from src/runtime/crt/utvm_rpc_common/framing.cc rename to src/runtime/crt/microtvm_rpc_common/framing.cc diff --git a/src/runtime/crt/utvm_rpc_common/session.cc b/src/runtime/crt/microtvm_rpc_common/session.cc similarity index 100% rename from src/runtime/crt/utvm_rpc_common/session.cc rename to src/runtime/crt/microtvm_rpc_common/session.cc diff --git a/src/runtime/crt/utvm_rpc_common/write_stream.cc b/src/runtime/crt/microtvm_rpc_common/write_stream.cc similarity index 100% rename from src/runtime/crt/utvm_rpc_common/write_stream.cc rename to src/runtime/crt/microtvm_rpc_common/write_stream.cc diff --git a/src/runtime/crt/utvm_rpc_server/rpc_server.cc b/src/runtime/crt/microtvm_rpc_server/rpc_server.cc similarity index 100% rename from src/runtime/crt/utvm_rpc_server/rpc_server.cc rename to src/runtime/crt/microtvm_rpc_server/rpc_server.cc From 1b53a782584f05435d6f4e6f4d1be58906ed8349 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 16:29:52 -0700 Subject: [PATCH 09/13] format --- include/tvm/runtime/crt/microtvm_rpc_server.h | 8 +++++--- .../tvm/runtime/micro/standalone/microtvm_runtime.h | 3 ++- src/runtime/crt/host/main.cc | 13 +++++++------ src/runtime/crt/microtvm_rpc_common/framing.cc | 3 ++- src/runtime/crt/microtvm_rpc_server/rpc_server.cc | 7 ++++--- .../micro/standalone/microtvm_graph_executor.h | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/include/tvm/runtime/crt/microtvm_rpc_server.h b/include/tvm/runtime/crt/microtvm_rpc_server.h index f392b1046f42..9a7ed54ffe95 100644 --- a/include/tvm/runtime/crt/microtvm_rpc_server.h +++ b/include/tvm/runtime/crt/microtvm_rpc_server.h @@ -40,7 +40,8 @@ extern "C" { * \param num_bytes Number of bytes avaiable in data. * \return The number of bytes written. */ -typedef ssize_t (*microtvm_rpc_channel_write_t)(void* context, const uint8_t* data, size_t num_bytes); +typedef ssize_t (*microtvm_rpc_channel_write_t)(void* context, const uint8_t* data, + size_t num_bytes); /*! \brief Opaque pointer type to TVM RPC Server. */ typedef void* microtvm_rpc_server_t; @@ -56,7 +57,8 @@ typedef void* microtvm_rpc_server_t; * \return A pointer to the TVM RPC Server. The pointer is allocated in the same memory space as * the TVM workspace. */ -microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void* write_func_ctx); +microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, + void* write_func_ctx); /*! \brief Do any tasks suitable for the main thread, and maybe process new incoming data. * @@ -68,7 +70,7 @@ microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_f * \return An error code indicating the outcome of the server main loop iteration. */ tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server, uint8_t** new_data, - size_t* new_data_size_bytes); + size_t* new_data_size_bytes); #ifdef __cplusplus } diff --git a/include/tvm/runtime/micro/standalone/microtvm_runtime.h b/include/tvm/runtime/micro/standalone/microtvm_runtime.h index 6cbae5c15770..827d91f62076 100644 --- a/include/tvm/runtime/micro/standalone/microtvm_runtime.h +++ b/include/tvm/runtime/micro/standalone/microtvm_runtime.h @@ -25,7 +25,8 @@ #define TVM_MICRO_RUNTIME_API_API extern "C" __attribute__((visibility("default"))) -TVM_MICRO_RUNTIME_API_API void* MicroTVMRuntimeCreate(const char* json, size_t json_len, void* module); +TVM_MICRO_RUNTIME_API_API void* MicroTVMRuntimeCreate(const char* json, size_t json_len, + void* module); TVM_MICRO_RUNTIME_API_API void MicroTVMRuntimeDestroy(void* handle); diff --git a/src/runtime/crt/host/main.cc b/src/runtime/crt/host/main.cc index 38672dd87368..65027dd67e8c 100644 --- a/src/runtime/crt/host/main.cc +++ b/src/runtime/crt/host/main.cc @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include #include @@ -88,8 +88,8 @@ tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) { return kTvmErrorPlatformTimerBadState; } auto microtvm_stop_time = std::chrono::steady_clock::now(); - std::chrono::microseconds time_span = - std::chrono::duration_cast(microtvm_stop_time - g_microtvm_start_time); + std::chrono::microseconds time_span = std::chrono::duration_cast( + microtvm_stop_time - g_microtvm_start_time); *elapsed_time_seconds = static_cast(time_span.count()) / 1e6; g_microtvm_timer_running = 0; return kTvmErrorNoError; @@ -140,9 +140,10 @@ int main(int argc, char** argv) { int error = TVMFuncRegisterGlobal("tvm.testing.reset_server", (TVMFunctionHandle)&testonly_reset_server, 0); if (error) { - fprintf(stderr, - "microTVM runtime: internal error (error#: %x) registering global packedfunc; exiting\n", - error); + fprintf( + stderr, + "microTVM runtime: internal error (error#: %x) registering global packedfunc; exiting\n", + error); return 2; } diff --git a/src/runtime/crt/microtvm_rpc_common/framing.cc b/src/runtime/crt/microtvm_rpc_common/framing.cc index cf79568605d5..f89c6e5688c0 100644 --- a/src/runtime/crt/microtvm_rpc_common/framing.cc +++ b/src/runtime/crt/microtvm_rpc_common/framing.cc @@ -35,7 +35,8 @@ #ifdef TVM_CRT_FRAMER_ENABLE_LOGS #include #define TVM_FRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "microTVM framer: " msg " \n", ##__VA_ARGS__) -#define TVM_UNFRAMER_DEBUG_LOG(msg, ...) fprintf(stderr, "microTVM unframer: " msg " \n", ##__VA_ARGS__) +#define TVM_UNFRAMER_DEBUG_LOG(msg, ...) \ + fprintf(stderr, "microTVM unframer: " msg " \n", ##__VA_ARGS__) #else #define TVM_FRAMER_DEBUG_LOG(msg, ...) #define TVM_UNFRAMER_DEBUG_LOG(msg, ...) diff --git a/src/runtime/crt/microtvm_rpc_server/rpc_server.cc b/src/runtime/crt/microtvm_rpc_server/rpc_server.cc index bbd382f1e207..36077216b19b 100644 --- a/src/runtime/crt/microtvm_rpc_server/rpc_server.cc +++ b/src/runtime/crt/microtvm_rpc_server/rpc_server.cc @@ -35,13 +35,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include "../../minrpc/minrpc_server.h" #include "crt_config.h" @@ -199,7 +199,8 @@ extern "C" { static microtvm_rpc_server_t g_rpc_server = nullptr; -microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void* write_func_ctx) { +microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, + void* write_func_ctx) { tvm::runtime::micro_rpc::g_write_func = write_func; tvm::runtime::micro_rpc::g_write_func_ctx = write_func_ctx; @@ -259,7 +260,7 @@ void TVMLogf(const char* format, ...) { } tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server_ptr, uint8_t** new_data, - size_t* new_data_size_bytes) { + size_t* new_data_size_bytes) { tvm::runtime::micro_rpc::MicroRPCServer* server = static_cast(server_ptr); return server->Loop(new_data, new_data_size_bytes); diff --git a/src/runtime/micro/standalone/microtvm_graph_executor.h b/src/runtime/micro/standalone/microtvm_graph_executor.h index 7f9653da44d1..73aead54aaed 100644 --- a/src/runtime/micro/standalone/microtvm_graph_executor.h +++ b/src/runtime/micro/standalone/microtvm_graph_executor.h @@ -30,8 +30,8 @@ #include #include -#include "minimal_vector.h" #include "microtvm_runtime_api.h" +#include "minimal_vector.h" namespace tvm { namespace micro { From d4a2586b8a2c67b473aef995fd8dddcbd7f9888f Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 18 Jun 2021 20:49:10 -0700 Subject: [PATCH 10/13] trigger From a8cedf8c90ffe83635c96611a3707197c019ec5a Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 21 Jun 2021 07:22:23 -0700 Subject: [PATCH 11/13] more refactor --- CONTRIBUTORS.md | 2 +- python/tvm/driver/tvmc/compiler.py | 2 +- python/tvm/driver/tvmc/runner.py | 2 +- python/tvm/micro/contrib/zephyr.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ad4e2dee4331..731b936ee6a2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,7 @@ We do encourage everyone to work anything they are interested in. - [Trevor Morris](https://github.com/trevor-m): @trevor-m - byoc, compiler - [Leandro Nunes](https://github.com/leandron): @leandron - tvmc - [Krzysztof Parzyszek](https://github.com/kparzysz-quic): @kparzysz-quic - hexagon, llvm -- [Andrew Reusch](https://github.com/areusch): @areusch - runtime, µTVM +- [Andrew Reusch](https://github.com/areusch): @areusch - runtime, microTVM - [Jared Roesch](https://github.com/jroesch) (PMC): @jroesch - relay - [Siju Samuel](https://github.com/siju-samuel): @siju-samuel - frontends - [Junru Shao](https://github.com/junrushao1994) @junrushao1994 - relay, compiler diff --git a/python/tvm/driver/tvmc/compiler.py b/python/tvm/driver/tvmc/compiler.py index 2240eaaa3f07..e79a07f1de2e 100644 --- a/python/tvm/driver/tvmc/compiler.py +++ b/python/tvm/driver/tvmc/compiler.py @@ -81,7 +81,7 @@ def add_compile_parser(subparsers): choices=["so", "mlf"], default="so", help="output format. Use 'so' for shared object or 'mlf' for Model Library Format " - "(only for µTVM targets). Defaults to 'so'.", + "(only for microTVM targets). Defaults to 'so'.", ) parser.add_argument( "--pass-config", diff --git a/python/tvm/driver/tvmc/runner.py b/python/tvm/driver/tvmc/runner.py index 191f8616c405..f843f507ae7c 100644 --- a/python/tvm/driver/tvmc/runner.py +++ b/python/tvm/driver/tvmc/runner.py @@ -360,7 +360,7 @@ def run_module( ) # Currently only two package formats are supported: "classic" and - # "mlf". The later can only be used for micro targets, i.e. with µTVM. + # "mlf". The later can only be used for micro targets, i.e. with microTVM. if tvmc_package.type == "mlf": raise TVMCException( "You're trying to run a model saved using the Model Library Format (MLF)." diff --git a/python/tvm/micro/contrib/zephyr.py b/python/tvm/micro/contrib/zephyr.py index 2f85b3573acb..c16919567bcc 100644 --- a/python/tvm/micro/contrib/zephyr.py +++ b/python/tvm/micro/contrib/zephyr.py @@ -114,7 +114,7 @@ def __init__( self._qemu = "qemu" in board # For Zephyr boards that run emulated by default but don't have the prefix "qemu_" in their - # board names, a suffix "-qemu" is added by users of µTVM when specifying the board name to + # board names, a suffix "-qemu" is added by users of microTVM when specifying the board name to # inform that the QEMU transporter must be used just like for the boards with the prefix. # Zephyr does not recognize the suffix, so we trim it off before passing it. if "-qemu" in board: From 905ec44782afbf1139ae4cb22fbb9482bbaabf87 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 21 Jun 2021 07:23:19 -0700 Subject: [PATCH 12/13] one more --- python/tvm/driver/tvmc/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/driver/tvmc/runner.py b/python/tvm/driver/tvmc/runner.py index f843f507ae7c..f573b1a725a7 100644 --- a/python/tvm/driver/tvmc/runner.py +++ b/python/tvm/driver/tvmc/runner.py @@ -364,7 +364,7 @@ def run_module( if tvmc_package.type == "mlf": raise TVMCException( "You're trying to run a model saved using the Model Library Format (MLF)." - "MLF can only be used to run micro targets (µTVM)." + "MLF can only be used to run micro targets (microTVM)." ) if hostname: From 61b7d3c0ce9bb93fa51faea99d885759ab0ada8a Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 21 Jun 2021 07:33:31 -0700 Subject: [PATCH 13/13] format --- python/tvm/micro/contrib/zephyr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/tvm/micro/contrib/zephyr.py b/python/tvm/micro/contrib/zephyr.py index c16919567bcc..3c79c200d155 100644 --- a/python/tvm/micro/contrib/zephyr.py +++ b/python/tvm/micro/contrib/zephyr.py @@ -114,9 +114,9 @@ def __init__( self._qemu = "qemu" in board # For Zephyr boards that run emulated by default but don't have the prefix "qemu_" in their - # board names, a suffix "-qemu" is added by users of microTVM when specifying the board name to - # inform that the QEMU transporter must be used just like for the boards with the prefix. - # Zephyr does not recognize the suffix, so we trim it off before passing it. + # board names, a suffix "-qemu" is added by users of microTVM when specifying the board + # name to inform that the QEMU transporter must be used just like for the boards with + # the prefix. Zephyr does not recognize the suffix, so we trim it off before passing it. if "-qemu" in board: board = board.replace("-qemu", "")