You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2021/05/30 03:07:53 UTC
[tvm] branch main updated: Fix tvmc tuner for cases when uTVM is
not enabled (#8153)
This is an automated email from the ASF dual-hosted git repository.
masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 8b5d843 Fix tvmc tuner for cases when uTVM is not enabled (#8153)
8b5d843 is described below
commit 8b5d843e755ef4f94aa490c22df5fb77b7df6ca4
Author: Andrey Malyshev <el...@gmail.com>
AuthorDate: Sun May 30 06:07:42 2021 +0300
Fix tvmc tuner for cases when uTVM is not enabled (#8153)
---
python/tvm/driver/tvmc/model.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/python/tvm/driver/tvmc/model.py b/python/tvm/driver/tvmc/model.py
index d9e3266..c0ebb84 100644
--- a/python/tvm/driver/tvmc/model.py
+++ b/python/tvm/driver/tvmc/model.py
@@ -53,7 +53,11 @@ import tvm.contrib.cc
from tvm import relay
from tvm.contrib import utils
from tvm.relay.backend.executor_factory import GraphExecutorFactoryModule
-from tvm.micro import export_model_library_format
+
+try:
+ from tvm.micro import export_model_library_format
+except ImportError:
+ export_model_library_format = None
from .common import TVMCException
@@ -280,7 +284,10 @@ class TVMCModel(object):
executor_factory, package_path, cross, cross_options, output_format
)
elif output_format == "mlf":
- package_path = export_model_library_format(executor_factory, package_path)
+ if export_model_library_format:
+ package_path = export_model_library_format(executor_factory, package_path)
+ else:
+ raise Exception("micro tvm is not enabled. Set USE_MICRO to ON in config.cmake")
return package_path