From 64ef91b3b414d1d228e05e07c1175ecf69123f2a Mon Sep 17 00:00:00 2001 From: Tristan Konolige Date: Thu, 19 Aug 2021 08:29:09 -0700 Subject: [PATCH 1/3] [FIX] Remove leftover instances of USE_GRAPH_EXECUTOR_DEBUG single flag, USE_PROFILER. This PR cleans up the last few remaining uses of USE_GRAPH_EXECUTOR_DEBUG. --- CMakeLists.txt | 6 ++++-- apps/microtvm/reference-vm/zephyr/rebuild-tvm.sh | 2 +- cmake/modules/LibInfo.cmake | 2 +- conda/recipe/bld.bat | 2 +- conda/recipe/build.sh | 2 +- .../src/main/java/org/apache/tvm/contrib/GraphModule.java | 4 ++-- python/tvm/contrib/debugger/debug_executor.py | 2 +- src/support/libinfo.cc | 6 +++--- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0f5daff7d83..190622a66108 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,8 +343,8 @@ endif(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR) # NOTE(areusch): USE_GRAPH_RUNTIME_DEBUG will be deleted in a future release if(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_GRAPH_EXECUTOR_DEBUG) - message(WARNING "USE_GRAPH_RUNTIME_DEBUG renamed to USE_GRAPH_EXECUTOR_DEBUG. Please update your config.cmake") - set(USE_GRAPH_EXECUTOR_DEBUG ${USE_GRAPH_RUNTIME_DEBUG}) + message(WARNING "USE_GRAPH_RUNTIME_DEBUG renamed to USE_PROFILER. Please update your config.cmake") + set(USE_PROFILER ${USE_GRAPH_RUNTIME_DEBUG}) unset(USE_GRAPH_RUNTIME_DEBUG CACHE) endif(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_GRAPH_EXECUTOR_DEBUG) @@ -357,10 +357,12 @@ endif(USE_GRAPH_EXECUTOR) # convert old options for profiler if(USE_GRAPH_EXECUTOR_DEBUG) + message(WARNING "USE_GRAPH_EXECUTOR renamed to USE_PROFILER. Please update your config.cmake") unset(USE_GRAPH_EXECUTOR_DEBUG CACHE) set(USE_PROFILER ON) endif() if(USE_VM_PROFILER) + message(WARNING "USE_VM_PROFILER renamed to USE_PROFILER. Please update your config.cmake") unset(USE_VM_PROFILER CACHE) set(USE_PROFILER ON) endif() diff --git a/apps/microtvm/reference-vm/zephyr/rebuild-tvm.sh b/apps/microtvm/reference-vm/zephyr/rebuild-tvm.sh index 1cebcf7166af..a4c659438d4d 100755 --- a/apps/microtvm/reference-vm/zephyr/rebuild-tvm.sh +++ b/apps/microtvm/reference-vm/zephyr/rebuild-tvm.sh @@ -36,7 +36,7 @@ fi cp cmake/config.cmake "${BUILD_DIR}" cd "${BUILD_DIR}" sed -i 's/USE_MICRO OFF/USE_MICRO ON/' config.cmake -sed -i 's/USE_GRAPH_EXECUTOR_DEBUG OFF/USE_GRAPH_EXECUTOR_DEBUG ON/' config.cmake +sed -i 's/USE_PROFILER OFF/USE_PROFILER ON/' config.cmake sed -i 's/USE_LLVM OFF/USE_LLVM ON/' config.cmake cmake .. rm -rf standalone_crt host_standalone_crt # remove stale generated files diff --git a/cmake/modules/LibInfo.cmake b/cmake/modules/LibInfo.cmake index 8d43879e4df4..163a56dbd1d4 100644 --- a/cmake/modules/LibInfo.cmake +++ b/cmake/modules/LibInfo.cmake @@ -51,7 +51,7 @@ function(add_lib_info src_file) TVM_INFO_CUDA_VERSION="${TVM_INFO_CUDA_VERSION}" TVM_INFO_USE_STACKVM_RUNTIME="${USE_STACKVM_RUNTIME}" TVM_INFO_USE_GRAPH_EXECUTOR="${USE_GRAPH_EXECUTOR}" - TVM_INFO_USE_GRAPH_EXECUTOR_DEBUG="${USE_GRAPH_EXECUTOR_DEBUG}" + TVM_INFO_USE_PROFILER="${USE_PROFILER}" TVM_INFO_USE_OPENMP="${USE_OPENMP}" TVM_INFO_USE_RELAY_DEBUG="${USE_RELAY_DEBUG}" TVM_INFO_USE_RTTI="${USE_RTTI}" diff --git a/conda/recipe/bld.bat b/conda/recipe/bld.bat index e877b8fda1e1..9a90fb13d4c4 100644 --- a/conda/recipe/bld.bat +++ b/conda/recipe/bld.bat @@ -28,7 +28,7 @@ cmake ^ -DUSE_CPP_RPC=ON ^ -DUSE_SORT=ON ^ -DUSE_RANDOM=ON ^ - -DUSE_GRAPH_EXECUTOR_DEBUG=ON ^ + -DUSE_PROFILER=ON ^ -DINSTALL_DEV=ON ^ %SRC_DIR% diff --git a/conda/recipe/build.sh b/conda/recipe/build.sh index a94b9df72440..242d6a28b3d3 100755 --- a/conda/recipe/build.sh +++ b/conda/recipe/build.sh @@ -49,7 +49,7 @@ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DUSE_CPP_RPC=OFF \ -DUSE_SORT=ON \ -DUSE_RANDOM=ON \ - -DUSE_GRAPH_EXECUTOR_DEBUG=ON \ + -DUSE_PROFILER=ON \ -DUSE_LLVM=ON \ -DINSTALL_DEV=ON \ -DUSE_LIBBACKTRACE=AUTO \ diff --git a/jvm/core/src/main/java/org/apache/tvm/contrib/GraphModule.java b/jvm/core/src/main/java/org/apache/tvm/contrib/GraphModule.java index a7a03d52740e..737fdef24ae8 100644 --- a/jvm/core/src/main/java/org/apache/tvm/contrib/GraphModule.java +++ b/jvm/core/src/main/java/org/apache/tvm/contrib/GraphModule.java @@ -147,7 +147,7 @@ public NDArray debugGetOutput(String node, NDArray out) { if (fdebugGetOutput != null) { fdebugGetOutput.pushArg(node).pushArg(out).invoke(); } else { - throw new RuntimeException("Please compile runtime with USE_GRAPH_EXECUTOR_DEBUG = 0"); + throw new RuntimeException("Please compile runtime with USE_PROFILER = ON"); } return out; } @@ -162,7 +162,7 @@ public NDArray debugGetOutput(int node, NDArray out) { if (fdebugGetOutput != null) { fdebugGetOutput.pushArg(node).pushArg(out).invoke(); } else { - throw new RuntimeException("Please compile runtime with USE_GRAPH_EXECUTOR_DEBUG = 0"); + throw new RuntimeException("Please compile runtime with USE_PROFILER = ON"); } return out; } diff --git a/python/tvm/contrib/debugger/debug_executor.py b/python/tvm/contrib/debugger/debug_executor.py index 622f27c358b6..ddde40b55475 100644 --- a/python/tvm/contrib/debugger/debug_executor.py +++ b/python/tvm/contrib/debugger/debug_executor.py @@ -64,7 +64,7 @@ def create(graph_json_str, libmod, device, dump_root=None): fcreate = tvm._ffi.get_global_func("tvm.graph_executor_debug.create") except ValueError: raise ValueError( - "Please set '(USE_GRAPH_EXECUTOR_DEBUG ON)' in " + "Please set '(USE_PROFILER ON)' in " "config.cmake and rebuild TVM to enable debug mode" ) func_obj = fcreate(graph_json_str, libmod, *device_type_id) diff --git a/src/support/libinfo.cc b/src/support/libinfo.cc index 6ff40aa20beb..7317cab665cf 100644 --- a/src/support/libinfo.cc +++ b/src/support/libinfo.cc @@ -87,8 +87,8 @@ #define TVM_INFO_USE_GRAPH_EXECUTOR "NOT-FOUND" #endif -#ifndef TVM_INFO_USE_GRAPH_EXECUTOR_DEBUG -#define TVM_INFO_USE_GRAPH_EXECUTOR_DEBUG "NOT-FOUND" +#ifndef TVM_INFO_USE_PROFILER +#define TVM_INFO_USE_PROFILER "NOT-FOUND" #endif #ifndef TVM_INFO_USE_OPENMP @@ -244,7 +244,7 @@ TVM_DLL Map GetLibInfo() { {"CUDA_VERSION", TVM_INFO_CUDA_VERSION}, {"USE_STACKVM_RUNTIME", TVM_INFO_USE_STACKVM_RUNTIME}, {"USE_GRAPH_EXECUTOR", TVM_INFO_USE_GRAPH_EXECUTOR}, - {"USE_GRAPH_EXECUTOR_DEBUG", TVM_INFO_USE_GRAPH_EXECUTOR_DEBUG}, + {"USE_PROFILER", TVM_INFO_USE_PROFILER}, {"USE_OPENMP", TVM_INFO_USE_OPENMP}, {"USE_RELAY_DEBUG", TVM_INFO_USE_RELAY_DEBUG}, {"USE_RTTI", TVM_INFO_USE_RTTI}, From 841d3a9c728775f0a0cff2b441407164873a2180 Mon Sep 17 00:00:00 2001 From: Tristan Konolige Date: Fri, 20 Aug 2021 10:51:34 -0700 Subject: [PATCH 2/3] formatting --- python/tvm/contrib/debugger/debug_executor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/tvm/contrib/debugger/debug_executor.py b/python/tvm/contrib/debugger/debug_executor.py index ddde40b55475..fc3b245d88ad 100644 --- a/python/tvm/contrib/debugger/debug_executor.py +++ b/python/tvm/contrib/debugger/debug_executor.py @@ -64,8 +64,7 @@ def create(graph_json_str, libmod, device, dump_root=None): fcreate = tvm._ffi.get_global_func("tvm.graph_executor_debug.create") except ValueError: raise ValueError( - "Please set '(USE_PROFILER ON)' in " - "config.cmake and rebuild TVM to enable debug mode" + "Please set '(USE_PROFILER ON)' in " "config.cmake and rebuild TVM to enable debug mode" ) func_obj = fcreate(graph_json_str, libmod, *device_type_id) return GraphModuleDebug(func_obj, dev, graph_json_str, dump_root) From a0d22abe38860cbf94a94869d1f3f89fce227cfb Mon Sep 17 00:00:00 2001 From: Tristan Konolige Date: Mon, 23 Aug 2021 15:04:17 -0700 Subject: [PATCH 3/3] Update CMakeLists.txt Co-authored-by: Cody Yu --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 190622a66108..88ecb82916b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,7 +342,7 @@ if(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR) endif(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR) # NOTE(areusch): USE_GRAPH_RUNTIME_DEBUG will be deleted in a future release -if(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_GRAPH_EXECUTOR_DEBUG) +if(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_PROFILER) message(WARNING "USE_GRAPH_RUNTIME_DEBUG renamed to USE_PROFILER. Please update your config.cmake") set(USE_PROFILER ${USE_GRAPH_RUNTIME_DEBUG}) unset(USE_GRAPH_RUNTIME_DEBUG CACHE)