Skip to content

Commit

Permalink
Address @gromero comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadh committed Nov 29, 2021
1 parent 7b931f2 commit 083cbf8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class BoardAutodetectFailed(Exception):
PROJECT_OPTIONS = [
server.ProjectOption(
"arduino_board",
required=["generate_project", "build", "flash", "open_transport"],
required=["build", "flash", "open_transport"],
choices=list(BOARD_PROPERTIES),
type="str",
help="Name of the Arduino board to build for.",
Expand Down
1 change: 0 additions & 1 deletion tests/micro/arduino/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def make_workspace_dir(test_name, board):
board_workspace = pathlib.Path(str(board_workspace) + f"-{number}")
board_workspace.parent.mkdir(exist_ok=True, parents=True)
t = tvm.contrib.utils.tempdir(board_workspace)
# time.sleep(200)
return t


Expand Down
61 changes: 31 additions & 30 deletions tests/micro/common/test_tvmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import tvm
from tvm.contrib.download import download_testdata
from tvm.relay.backend import Executor, Runtime

from ..zephyr.test_utils import ZEPHYR_BOARDS
from ..arduino.test_utils import ARDUINO_BOARDS
Expand All @@ -36,7 +35,7 @@
MODEL_URL = "https://github.com/tensorflow/tflite-micro/raw/main/tensorflow/lite/micro/examples/micro_speech/micro_speech.tflite"
MODEL_FILE = "micro_speech.tflite"


# TODO(mehrdadh): replace this with _main from tvm.driver.tvmc.main
def _run_tvmc(cmd_args: list, *args, **kwargs):
"""Run a tvmc command and return the results"""
cmd_args_list = TVMC_COMMAND + cmd_args
Expand Down Expand Up @@ -74,8 +73,8 @@ def test_tvmc_model_build_only(board):
tar_path = str(temp_dir / "model.tar")
project_dir = str(temp_dir / "project")

runtime = str(Runtime("crt"))
executor = str(Executor("graph"))
runtime = "crt"
executor = "graph"

cmd_result = _run_tvmc(
[
Expand All @@ -99,18 +98,19 @@ def test_tvmc_model_build_only(board):
)
assert cmd_result == 0, "tvmc failed in step: compile"

cmd_result = _run_tvmc(
[
"micro",
"create-project",
project_dir,
tar_path,
platform,
"--project-option",
"project_type=host_driven",
f"{platform}_board={board}",
]
)
create_project_cmd = [
"micro",
"create-project",
project_dir,
tar_path,
platform,
"--project-option",
"project_type=host_driven",
]
if platform == "zephyr":
create_project_cmd.append(f"{platform}_board={board}")

cmd_result = _run_tvmc(create_project_cmd)
assert cmd_result == 0, "tvmc micro failed in step: create-project"

cmd_result = _run_tvmc(
Expand All @@ -129,8 +129,8 @@ def test_tvmc_model_run(board):
tar_path = str(temp_dir / "model.tar")
project_dir = str(temp_dir / "project")

runtime = str(Runtime("crt"))
executor = str(Executor("graph"))
runtime = "crt"
executor = "graph"

cmd_result = _run_tvmc(
[
Expand All @@ -154,18 +154,19 @@ def test_tvmc_model_run(board):
)
assert cmd_result == 0, "tvmc failed in step: compile"

cmd_result = _run_tvmc(
[
"micro",
"create-project",
project_dir,
tar_path,
platform,
"--project-option",
"project_type=host_driven",
f"{platform}_board={board}",
]
)
create_project_cmd = [
"micro",
"create-project",
project_dir,
tar_path,
platform,
"--project-option",
"project_type=host_driven",
]
if platform == "zephyr":
create_project_cmd.append(f"{platform}_board={board}")

cmd_result = _run_tvmc(create_project_cmd)
assert cmd_result == 0, "tvmc micro failed in step: create-project"

cmd_result = _run_tvmc(
Expand Down

0 comments on commit 083cbf8

Please sign in to comment.