This is an automated email from the ASF dual-hosted git repository.

mehrdadh 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 d89234b47a [microTVM] Bump versions in reference vm (#11067)
d89234b47a is described below

commit d89234b47abdbb090f9f32e68dcff6fd6cd3d4a1
Author: Gavin Uberti <[email protected]>
AuthorDate: Mon Apr 25 12:52:57 2022 -0500

    [microTVM] Bump versions in reference vm (#11067)
    
    * Update spresense sdk version to make hack unnecessary
    
    * Bump arduino SDK version
    
    * Fix Arduino RPC server test
    
    * Fix versions for all board libraries
---
 .../arduino/base-box/base_box_provision.sh         | 38 +++++-----------------
 docker/install/ubuntu_install_arduino.sh           |  2 +-
 tests/micro/arduino/test_arduino_rpc_server.py     | 11 ++++---
 3 files changed, 17 insertions(+), 34 deletions(-)

diff --git a/apps/microtvm/reference-vm/arduino/base-box/base_box_provision.sh 
b/apps/microtvm/reference-vm/arduino/base-box/base_box_provision.sh
index 2724069ba7..1174e00a81 100644
--- a/apps/microtvm/reference-vm/arduino/base-box/base_box_provision.sh
+++ b/apps/microtvm/reference-vm/arduino/base-box/base_box_provision.sh
@@ -33,7 +33,7 @@ sudo apt-get install -y ca-certificates
 # Install Arduino-CLI (specific version)
 # To keep in sync with the version 
 # defined in apps/microtvm/arduino/template_project/microtvm_api_server.py
-ARDUINO_CLI_VERSION="0.18.3"
+ARDUINO_CLI_VERSION="0.21.1"
 
 export PATH="/home/vagrant/bin:$PATH"
 wget -O - 
https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s 
${ARDUINO_CLI_VERSION}
@@ -45,38 +45,18 @@ sudo usermod -a -G dialout $USER
 # supported architectures, so we don't use it here
 
 # 3rd party board URLs
-ADAFRUIT_BOARDS_URL="https://adafruit.github.io/arduino-board-index/package_adafruit_index.json";
+ADAFRUIT_BOARDS_URL="https://raw.githubusercontent.com/adafruit/arduino-board-index/7840c768/package_adafruit_index.json";
 
ESP32_BOARDS_URL="https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json";
-SPARKFUN_BOARDS_URL="https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json";
-SEEED_BOARDS_URL="https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json";
-SPRESENSE_BOARDS_URL="https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/v2.2.1/package_spresense_index.json";
-arduino-cli core update-index --additional-urls 
$ADAFRUIT_BOARDS_URL,$ESP32_BOARDS_URL,$SPARKFUN_BOARDS_URL,$SEEED_BOARDS_URL,$SPRESENSE_BOARDS_URL
+SPRESENSE_BOARDS_URL="https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/v2.5.0/package_spresense_index.json";
+arduino-cli core update-index --additional-urls 
$ADAFRUIT_BOARDS_URL,$ESP32_BOARDS_URL,$SPRESENSE_BOARDS_URL
 
 # Install supported cores from those URLS
 arduino-cli version
-arduino-cli core install arduino:mbed_nano
-arduino-cli core install arduino:sam
-arduino-cli core install adafruit:samd --additional-urls $ADAFRUIT_BOARDS_URL
-arduino-cli core install esp32:esp32 --additional-urls $ESP32_BOARDS_URL
-arduino-cli core install Seeeduino:samd --additional-urls $SEEED_BOARDS_URL
-arduino-cli core install SPRESENSE:spresense --additional-urls 
$SPRESENSE_BOARDS_URL
-
-# The Sony Spresense SDK has a major bug that breaks TVM. It's scheduled to be 
fixed in
-# release 2.3.0, but until that's published we need to use the below hack. 
This ONLY
-# fixes the bug in the main core release SDK - the subcore release SDK and both
-# the main and subcore debug SDKs will continue to fail until an official fix 
is made.
-# https://github.com/sonydevworld/spresense/issues/200
-SPRESENSE_NUTTX_BUGFIX_PATH=~/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.2.1/spresense/release/nuttx/include/sys/types.h
-sed -i 's/#ifndef CONFIG_WCHAR_BUILTIN/#if !defined(__cplusplus)/g' 
$SPRESENSE_NUTTX_BUGFIX_PATH
-
-# There's also a bug in arduino-cli where {runtime.os} is not properly 
templated in
-# platform.txt. This bug only seems to appear with the SPRESENSE SDK. A fix 
has been
-# merged and will be part of arduino-cli 0.18.4, but that has yet to be 
published.
-# This change is only needed to upload code (not compile) for the Spresense.
-# https://github.com/arduino/arduino-cli/issues/1198
-SPRESENSE_FLASH_WRITER_BUGFIX_PATH=~/.arduino15/packages/SPRESENSE/hardware/spresense/2.2.1/platform.txt
-sed -i 
's/tools.spresense-tools.cmd.path={path}\/flash_writer\/{runtime.os}\/flash_writer/tools.spresense-tools.cmd.path={path}\/flash_writer\/linux\/flash_writer/g'
 $SPRESENSE_FLASH_WRITER_BUGFIX_PATH
-sed -i 
's/tools.spresense-tools.cmd.path.linux={path}\/flash_writer\/{runtime.os}\/flash_writer/tools.spresense-tools.cmd.path.linux={path}\/flash_writer\/linux\/flash_writer/g'
 $SPRESENSE_FLASH_WRITER_BUGFIX_PATH
+arduino-cli core install arduino:[email protected]
+arduino-cli core install arduino:[email protected]
+arduino-cli core install adafruit:[email protected] --additional-urls 
$ADAFRUIT_BOARDS_URL
+arduino-cli core install esp32:[email protected] --additional-urls $ESP32_BOARDS_URL
+arduino-cli core install SPRESENSE:[email protected] --additional-urls 
$SPRESENSE_BOARDS_URL
 
 # Cleanup
 rm -f *.sh
diff --git a/docker/install/ubuntu_install_arduino.sh 
b/docker/install/ubuntu_install_arduino.sh
index a612261b2a..bb27b56b99 100755
--- a/docker/install/ubuntu_install_arduino.sh
+++ b/docker/install/ubuntu_install_arduino.sh
@@ -23,7 +23,7 @@ set -o pipefail
 export DEBIAN_FRONTEND=noninteractive
 apt-get install -y ca-certificates
 
-ARDUINO_CLI_VERSION="0.18.3"
+ARDUINO_CLI_VERSION="0.21.1"
 # Install arduino-cli
 wget -O - 
https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s 
${ARDUINO_CLI_VERSION}
 
diff --git a/tests/micro/arduino/test_arduino_rpc_server.py 
b/tests/micro/arduino/test_arduino_rpc_server.py
index 662b825672..1dd20597ac 100644
--- a/tests/micro/arduino/test_arduino_rpc_server.py
+++ b/tests/micro/arduino/test_arduino_rpc_server.py
@@ -63,8 +63,9 @@ def _make_sess_from_op(
     model, arduino_board, arduino_cli_cmd, workspace_dir, op_name, sched, 
arg_bufs, build_config
 ):
     target = tvm.target.target.micro(model)
+    runtime = Runtime("crt", {"system-lib": True})
     with tvm.transform.PassContext(opt_level=3, 
config={"tir.disable_vectorize": True}):
-        mod = tvm.build(sched, arg_bufs, target=target, name=op_name)
+        mod = tvm.build(sched, arg_bufs, target=target, runtime=runtime, 
name=op_name)
 
     return _make_session(model, arduino_board, arduino_cli_cmd, workspace_dir, 
mod, build_config)
 
@@ -152,8 +153,9 @@ def test_relay(board, arduino_cli_cmd, tvm_debug, 
workspace_dir):
     func = relay.Function([x], z)
 
     target = tvm.target.target.micro(model)
+    runtime = Runtime("crt", {"system-lib": True})
     with tvm.transform.PassContext(opt_level=3, 
config={"tir.disable_vectorize": True}):
-        mod = tvm.relay.build(func, target=target)
+        mod = tvm.relay.build(func, target=target, runtime=runtime)
 
     with _make_session(model, board, arduino_cli_cmd, workspace_dir, mod, 
build_config) as session:
         graph_mod = tvm.micro.create_local_graph_executor(
@@ -192,9 +194,9 @@ def test_onnx(board, arduino_cli_cmd, tvm_debug, 
workspace_dir):
     relay_mod = relay.transform.DynamicToStatic()(relay_mod)
 
     target = tvm.target.target.micro(model)
+    runtime = Runtime("crt", {"system-lib": True})
     with tvm.transform.PassContext(opt_level=3, 
config={"tir.disable_vectorize": True}):
         executor = Executor("graph", {"link-params": True})
-        runtime = Runtime("crt", {"system-lib": True})
         lowered = relay.build(relay_mod, target, params=params, 
executor=executor, runtime=runtime)
         graph = lowered.get_graph_json()
 
@@ -233,8 +235,9 @@ def check_result(
     """Helper function to verify results"""
     TOL = 1e-5
     target = tvm.target.target.micro(model)
+    runtime = Runtime("crt", {"system-lib": True})
     with tvm.transform.PassContext(opt_level=3, 
config={"tir.disable_vectorize": True}):
-        mod = tvm.relay.build(relay_mod, target=target)
+        mod = tvm.relay.build(relay_mod, target=target, runtime=runtime)
 
     with _make_session(
         model, arduino_board, arduino_cli_cmd, workspace_dir, mod, build_config

Reply via email to