From 225236bbb96a91b2aae1717305938a5c10134950 Mon Sep 17 00:00:00 2001 From: Andrew Reusch Date: Thu, 18 Mar 2021 14:34:06 -0700 Subject: [PATCH] backwards compat changes --- CMakeLists.txt | 14 ++++++++++ cmake/modules/contrib/ArmComputeLib.cmake | 8 ++++++ python/tvm/contrib/debugger/debug_runtime.py | 27 ++++++++++++++++++++ python/tvm/contrib/graph_runtime.py | 27 ++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 python/tvm/contrib/debugger/debug_runtime.py create mode 100644 python/tvm/contrib/graph_runtime.py diff --git a/CMakeLists.txt b/CMakeLists.txt index c58162cbfc7d3..dce24853ca5be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,20 @@ else() list(APPEND COMPILER_SRCS ${STACKVM_RUNTIME_SRCS}) endif(USE_STACKVM_RUNTIME) +# NOTE(areusch): USE_GRAPH_RUNTIME will be deleted in a future release +if(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR) + message(WARNING "USE_GRAPH_RUNTIME renamed to USE_GRAPH_EXECUTOR. Please update your config.cmake") + set(USE_GRAPH_EXECUTOR ${USE_GRAPH_RUNTIME}) + unset(USE_GRAPH_RUNTIME CACHE) +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}) + unset(USE_GRAPH_RUNTIME_DEBUG CACHE) +endif(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_GRAPH_EXECUTOR_DEBUG) + if(USE_GRAPH_EXECUTOR) message(STATUS "Build with Graph Executor support...") file(GLOB RUNTIME_GRAPH_EXECUTOR_SRCS src/runtime/graph_executor/*.cc) diff --git a/cmake/modules/contrib/ArmComputeLib.cmake b/cmake/modules/contrib/ArmComputeLib.cmake index 1e47d087abdc7..54ce917dfb506 100644 --- a/cmake/modules/contrib/ArmComputeLib.cmake +++ b/cmake/modules/contrib/ArmComputeLib.cmake @@ -23,12 +23,20 @@ if(USE_ARM_COMPUTE_LIB) file(GLOB ACL_RELAY_CONTRIB_SRC src/relay/backend/contrib/arm_compute_lib/*.cc) file(GLOB ACL_RUNTIME_MODULE src/runtime/contrib/arm_compute_lib/acl_runtime.cc) list(APPEND COMPILER_SRCS ${ACL_RELAY_CONTRIB_SRC}) + if(NOT USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR) list(APPEND COMPILER_SRCS ${ACL_RUNTIME_MODULE}) endif() message(STATUS "Build with Arm Compute Library support...") endif() +if(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME AND NOT DEFINED USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR) + message(WARNING "USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME renamed to USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR. " + "Please update your config.cmake") + set(USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR ${USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME}) + unset(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME CACHE) +endif(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME AND NOT DEFINED USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR) + if(USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR) set(ACL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/acl) # Detect custom ACL path. diff --git a/python/tvm/contrib/debugger/debug_runtime.py b/python/tvm/contrib/debugger/debug_runtime.py new file mode 100644 index 0000000000000..0265bb2ba5344 --- /dev/null +++ b/python/tvm/contrib/debugger/debug_runtime.py @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Deprecated Python API for DebugExecutor.""" + +import warnings + +from . import graph_executor + + +def create(*args, **kwargs): + warnings.warn("This function has been moved to tvm.contrib.graph_executor and will be removed " + "in the next TVM release") + return graph_executor.create(*args, **kwargs) diff --git a/python/tvm/contrib/graph_runtime.py b/python/tvm/contrib/graph_runtime.py new file mode 100644 index 0000000000000..8d646976f04ee --- /dev/null +++ b/python/tvm/contrib/graph_runtime.py @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Deprecated Python API for GraphExecutor.""" + +import warnings + +from . import graph_executor + + +def create(*args, **kwargs): + warnings.warn("This function has been moved to tvm.contrib.graph_executor and will be removed " + "in the next TVM release") + return graph_executor.create(*args, **kwargs)