Skip to content

Commit

Permalink
debug_runtime -> debug_executor
Browse files Browse the repository at this point in the history
  • Loading branch information
areusch committed Mar 24, 2021
1 parent ca11257 commit 3ce0117
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions docs/dev/debugger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ How to use Debugger?

3. In frontend script file instead of
``from tvm.contrib import graph_executor`` import the
``debug_runtime``
``from tvm.contrib.debugger import debug_runtime as graph_executor``
``debug_executor``
``from tvm.contrib.debugger import debug_executor as graph_executor``

::

from tvm.contrib.debugger import debug_runtime as graph_executor
from tvm.contrib.debugger import debug_executor as graph_executor
m = graph_executor.create(graph, lib, ctx, dump_root="/tmp/tvmdbg")
# set inputs
m.set_input('data', tvm.nd.array(data.astype(dtype)))
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/contrib/cuda_graph/cuda_graph_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ def debug_get_output(self, node, out):
out : NDArray
The output array container
"""
raise NotImplementedError("Please use debugger.debug_runtime as graph_executor instead.")
raise NotImplementedError("Please use debugger.debug_executor as graph_executor instead.")
2 changes: 1 addition & 1 deletion python/tvm/contrib/graph_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def debug_get_output(self, node, out):
out : NDArray
The output array container
"""
raise NotImplementedError("Please use debugger.debug_runtime as graph_executor instead.")
raise NotImplementedError("Please use debugger.debug_executor as graph_executor instead.")

def load_params(self, params_bytes):
"""Load parameters from serialized byte array of parameter dict.
Expand Down
4 changes: 2 additions & 2 deletions python/tvm/driver/tvmc/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from tvm import rpc
from tvm.autotvm.measure import request_remote
from tvm.contrib import graph_executor as runtime
from tvm.contrib.debugger import debug_runtime
from tvm.contrib.debugger import debug_executor
from tvm.relay import load_param_dict

from . import common
Expand Down Expand Up @@ -370,7 +370,7 @@ def run_module(

if profile:
logger.debug("creating runtime with profiling enabled")
module = debug_runtime.create(graph, lib, ctx, dump_root="./prof")
module = debug_executor.create(graph, lib, ctx, dump_root="./prof")
else:
logger.debug("creating runtime with profiling disabled")
module = runtime.create(graph, lib, ctx)
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/micro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from .model_library_format import export_model_library_format, UnsupportedInModelLibraryFormatError
from .session import (
create_local_graph_executor,
create_local_debug_runtime,
create_local_debug_executor,
Session,
SessionTerminatedError,
)
Expand Down
6 changes: 3 additions & 3 deletions python/tvm/micro/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ..error import register_error
from .._ffi import get_global_func
from ..contrib import graph_executor
from ..contrib.debugger import debug_runtime
from ..contrib.debugger import debug_executor
from ..rpc import RPCSession
from .transport import IoTimeoutError
from .transport import TransportLogger
Expand Down Expand Up @@ -218,7 +218,7 @@ def create_local_graph_executor(graph_json_str, mod, ctx):
)


def create_local_debug_runtime(graph_json_str, mod, ctx, dump_root=None):
def create_local_debug_executor(graph_json_str, mod, ctx, dump_root=None):
"""Create a local debug runtime driving execution on the remote CPU context given.
Parameters
Expand All @@ -242,7 +242,7 @@ def create_local_debug_runtime(graph_json_str, mod, ctx, dump_root=None):
"""
device_type_id = [ctx.device_type, ctx.device_id]
fcreate = get_global_func("tvm.graph_executor_debug.create")
return debug_runtime.GraphModuleDebug(
return debug_executor.GraphModuleDebug(
fcreate(graph_json_str, mod, lookup_remote_linked_param, *device_type_id),
[ctx],
graph_json_str,
Expand Down
6 changes: 3 additions & 3 deletions tests/python/unittest/test_runtime_graph_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import numpy as np
from tvm import rpc
from tvm.contrib import utils
from tvm.contrib.debugger import debug_runtime
from tvm.contrib.debugger import debug_executor


@tvm.testing.requires_llvm
Expand Down Expand Up @@ -75,7 +75,7 @@ def myadd(*args):
mlib_proxy = tvm.support.FrontendTestModule()
mlib_proxy["myadd"] = myadd
try:
mod = debug_runtime.create(graph, mlib_proxy, tvm.cpu(0))
mod = debug_executor.create(graph, mlib_proxy, tvm.cpu(0))
except ValueError:
return

Expand Down Expand Up @@ -171,7 +171,7 @@ def check_remote():
remote.upload(path_dso)
mlib = remote.load_module("dev_lib.so")
try:
mod = debug_runtime.create(graph, mlib, remote.cpu(0))
mod = debug_executor.create(graph, mlib, remote.cpu(0))
except ValueError:
print("Skip because debug runtime not enabled")
return
Expand Down
4 changes: 2 additions & 2 deletions tests/python/unittest/test_runtime_module_based_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from tvm.relay import testing
import tvm
from tvm.contrib import graph_executor
from tvm.contrib.debugger import debug_runtime
from tvm.contrib.debugger import debug_executor
from tvm.contrib.cuda_graph import cuda_graph_executor
import tvm.testing

Expand Down Expand Up @@ -527,7 +527,7 @@ def test_debug_graph_executor():
tvm.testing.assert_allclose(out, verify(data), atol=1e-5)

# debug graph executor wrapper
debug_g_mod = debug_runtime.GraphModuleDebug(
debug_g_mod = debug_executor.GraphModuleDebug(
complied_graph_lib["debug_create"]("default", ctx),
[ctx],
complied_graph_lib.get_json(),
Expand Down
4 changes: 2 additions & 2 deletions vta/scripts/tune_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from tvm.autotvm.measure.measure_methods import request_remote
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
from tvm.contrib import graph_executor, utils, download
from tvm.contrib.debugger import debug_runtime
from tvm.contrib.debugger import debug_executor
import vta
from vta.testing import simulator
from vta.top import graph_pack
Expand Down Expand Up @@ -325,7 +325,7 @@ def tune_tasks(

# If detailed runtime info is needed build with debug runtime
if opt.debug_profile:
m = debug_runtime.create(graph, lib, ctx)
m = debug_executor.create(graph, lib, ctx)
else:
m = graph_executor.create(graph, lib, ctx)

Expand Down
2 changes: 1 addition & 1 deletion vta/tutorials/frontend/deploy_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from tvm import te
from tvm import rpc, autotvm, relay
from tvm.contrib import graph_executor, utils, download
from tvm.contrib.debugger import debug_runtime
from tvm.contrib.debugger import debug_executor
from tvm.relay import transform

import vta
Expand Down

0 comments on commit 3ce0117

Please sign in to comment.