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 2249256cef [microTVM][CI] Rename ci_qemu to ci_cortexm (#12281)
2249256cef is described below
commit 2249256cefecf2f2872af874b25c30c431acf2e6
Author: Mehrdad Hessar <[email protected]>
AuthorDate: Fri Aug 5 14:13:34 2022 -0700
[microTVM][CI] Rename ci_qemu to ci_cortexm (#12281)
* rename files
* ci script
* demo
* RVM files
* jenkins
* more ci
* Jenkins
* fake name for ci_cortexm
* merge with main
* add cortexm config file
---
Jenkinsfile | 158 ++++++++++-----------
.../reference-vm/base-box/base_box_provision.sh | 2 +-
apps/microtvm/reference-vm/rebuild_tvm.sh | 2 +-
apps/microtvm/zephyr_cmsisnn/README.md | 4 +-
ci/jenkins/Build.groovy.j2 | 16 +--
ci/jenkins/Jenkinsfile.j2 | 2 +-
ci/jenkins/Test.groovy.j2 | 18 +--
ci/jenkins/generate.py | 2 +-
docker/Dockerfile.ci_cortexm | 120 ++++++++++++++++
docker/install/ubuntu_install_qemu.sh | 82 -----------
tests/python/ci/test_ci.py | 2 +-
tests/scripts/ci.py | 6 +-
.../scripts/task_config_build_cortexm.sh | 44 +++---
13 files changed, 242 insertions(+), 216 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 874d4be71a..7da3b9f8df 100755
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@
// 'python3 jenkins/generate.py'
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
// always rebased on main before merging:
-// Generated at 2022-08-05T03:11:14.413104
+// Generated at 2022-08-05T17:23:43.942908
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the
regex as needed. -->
@@ -54,7 +54,7 @@ ci_gpu = 'tlcpack/ci-gpu:20220801-060139-d332eb374'
ci_cpu = 'tlcpack/ci-cpu:20220715-060127-37f9d3c49'
ci_wasm = 'tlcpack/ci-wasm:20220715-060127-37f9d3c49'
ci_i386 = 'tlcpack/ci-i386:20220715-060127-37f9d3c49'
-ci_qemu = 'tlcpack/ci-qemu:20220630-060117-558ba99c7'
+ci_cortexm = 'tlcpack/ci-cortexm:v0.01'
ci_arm = 'tlcpack/ci-arm:20220715-060127-37f9d3c49'
ci_hexagon = 'tlcpack/ci-hexagon:20220715-060127-37f9d3c49'
// <--- End of regex-scanned config.
@@ -70,7 +70,7 @@ properties([
string(name: 'ci_hexagon_param', defaultValue: ''),
string(name: 'ci_i386_param', defaultValue: ''),
string(name: 'ci_lint_param', defaultValue: ''),
- string(name: 'ci_qemu_param', defaultValue: ''),
+ string(name: 'ci_cortexm_param', defaultValue: ''),
string(name: 'ci_wasm_param', defaultValue: ''),
])
])
@@ -83,7 +83,7 @@ properties([
built_ci_hexagon = null;
built_ci_i386 = null;
built_ci_lint = null;
- built_ci_qemu = null;
+ built_ci_cortexm = null;
built_ci_wasm = null;
// Global variable assigned during Sanity Check that holds the sha1 which
should be
@@ -273,7 +273,7 @@ def prepare() {
if (env.DETERMINE_DOCKER_IMAGES == 'yes') {
sh(
- script: "./tests/scripts/determine_docker_images.py
ci_arm=${ci_arm} ci_cpu=${ci_cpu} ci_gpu=${ci_gpu} ci_hexagon=${ci_hexagon}
ci_i386=${ci_i386} ci_lint=${ci_lint} ci_qemu=${ci_qemu} ci_wasm=${ci_wasm} ",
+ script: "./tests/scripts/determine_docker_images.py
ci_arm=${ci_arm} ci_cpu=${ci_cpu} ci_gpu=${ci_gpu} ci_hexagon=${ci_hexagon}
ci_i386=${ci_i386} ci_lint=${ci_lint} ci_cortexm=${ci_cortexm}
ci_wasm=${ci_wasm} ",
label: 'Decide whether to use tlcpack or tlcpackstaging for Docker
images',
)
// Pull image names from the results of should_rebuild_docker.py
@@ -307,9 +307,9 @@ def prepare() {
label: "Find docker image name for ci_lint",
returnStdout: true,
).trim()
- ci_qemu = sh(
- script: "cat .docker-image-names/ci_qemu",
- label: "Find docker image name for ci_qemu",
+ ci_cortexm = sh(
+ script: "cat .docker-image-names/ci_cortexm",
+ label: "Find docker image name for ci_cortexm",
returnStdout: true,
).trim()
ci_wasm = sh(
@@ -325,7 +325,7 @@ def prepare() {
ci_hexagon = params.ci_hexagon_param ?: ci_hexagon
ci_i386 = params.ci_i386_param ?: ci_i386
ci_lint = params.ci_lint_param ?: ci_lint
- ci_qemu = params.ci_qemu_param ?: ci_qemu
+ ci_cortexm = params.ci_cortexm_param ?: ci_cortexm
ci_wasm = params.ci_wasm_param ?: ci_wasm
sh (script: """
@@ -336,7 +336,7 @@ def prepare() {
echo " ci_hexagon = ${ci_hexagon}"
echo " ci_i386 = ${ci_i386}"
echo " ci_lint = ${ci_lint}"
- echo " ci_qemu = ${ci_qemu}"
+ echo " ci_cortexm = ${ci_cortexm}"
echo " ci_wasm = ${ci_wasm}"
""", label: 'Docker image names')
@@ -527,14 +527,14 @@ def build_docker_images() {
}
}
},
- 'ci_qemu': {
+ 'ci_cortexm': {
node('CPU') {
timeout(time: max_time, unit: 'MINUTES') {
init_git()
// We're purposefully not setting the built image here since they
// are not yet being uploaded to tlcpack
- // ci_qemu = build_image('ci_qemu')
- built_ci_qemu = build_image('ci_qemu');
+ // ci_cortexm = build_image('ci_cortexm')
+ built_ci_cortexm = build_image('ci_cortexm');
}
}
},
@@ -951,17 +951,17 @@ stage('Build') {
Utils.markStageSkippedForConditional('BUILD: arm')
}
},
- 'BUILD: QEMU': {
+ 'BUILD: Cortex-M': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/build-qemu") {
- docker_init(ci_qemu)
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/build-cortexm") {
+ docker_init(ci_cortexm)
init_git()
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_config_build_qemu.sh build",
- label: 'Create QEMU cmake config',
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_config_build_cortexm.sh build",
+ label: 'Create Cortex-M cmake config',
)
- make(ci_qemu, 'build', '-j2')
+ make(ci_cortexm, 'build', '-j2')
sh(
script: """
set -eux
@@ -986,12 +986,12 @@ stage('Build') {
}
md5sum build/libtvm.so
- retry 3 aws s3 cp --no-progress build/libtvm.so
s3://${s3_prefix}/qemu/build/libtvm.so
+ retry 3 aws s3 cp --no-progress build/libtvm.so
s3://${s3_prefix}/cortexm/build/libtvm.so
md5sum build/libtvm_runtime.so
- retry 3 aws s3 cp --no-progress build/libtvm_runtime.so
s3://${s3_prefix}/qemu/build/libtvm_runtime.so
+ retry 3 aws s3 cp --no-progress build/libtvm_runtime.so
s3://${s3_prefix}/cortexm/build/libtvm_runtime.so
md5sum build/config.cmake
- retry 3 aws s3 cp --no-progress build/config.cmake
s3://${s3_prefix}/qemu/build/config.cmake
- retry 3 aws s3 cp --no-progress build/microtvm_template_projects
s3://${s3_prefix}/qemu/build/microtvm_template_projects --recursive
+ retry 3 aws s3 cp --no-progress build/config.cmake
s3://${s3_prefix}/cortexm/build/config.cmake
+ retry 3 aws s3 cp --no-progress build/microtvm_template_projects
s3://${s3_prefix}/cortexm/build/microtvm_template_projects --recursive
""",
label: 'Upload artifacts to S3',
)
@@ -999,7 +999,7 @@ stage('Build') {
}
}
} else {
- Utils.markStageSkippedForConditional('BUILD: QEMU')
+ Utils.markStageSkippedForConditional('BUILD: Cortex-M')
}
},
'BUILD: Hexagon': {
@@ -4266,16 +4266,16 @@ def shard_run_frontend_aarch64_2_of_2() {
}
-def shard_run_test_Qemu_1_of_4() {
+def shard_run_test_Cortex_M_1_of_4() {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-cortexm") {
try {
- docker_init(ci_qemu)
+ docker_init(ci_cortexm)
init_git()
timeout(time: max_time, unit: 'MINUTES') {
withEnv([
- 'PLATFORM=qemu',
+ 'PLATFORM=cortexm',
'TVM_NUM_SHARDS=4',
'TVM_SHARD_INDEX=0'], {
sh(
@@ -4301,26 +4301,26 @@ def shard_run_test_Qemu_1_of_4() {
return 0
}
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/config.cmake build/config.cmake
md5sum build/config.cmake
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/microtvm_template_projects
build/microtvm_template_projects --recursive
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/microtvm_template_projects
build/microtvm_template_projects --recursive
""",
label: 'Download artifacts from S3',
)
add_microtvm_permissions()
- ci_setup(ci_qemu)
- cpp_unittest(ci_qemu)
+ ci_setup(ci_cortexm)
+ cpp_unittest(ci_cortexm)
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_demo_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_demo_microtvm.sh",
label: 'Run microTVM demos',
)
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_python_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
)
})
@@ -4339,20 +4339,20 @@ def shard_run_test_Qemu_1_of_4() {
}
}
} else {
- Utils.markStageSkippedForConditional('test: Qemu 1 of 4')
+ Utils.markStageSkippedForConditional('test: Cortex-M 1 of 4')
}
}
-def shard_run_test_Qemu_2_of_4() {
+def shard_run_test_Cortex_M_2_of_4() {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-cortexm") {
try {
- docker_init(ci_qemu)
+ docker_init(ci_cortexm)
init_git()
timeout(time: max_time, unit: 'MINUTES') {
withEnv([
- 'PLATFORM=qemu',
+ 'PLATFORM=cortexm',
'TVM_NUM_SHARDS=4',
'TVM_SHARD_INDEX=1'], {
sh(
@@ -4378,21 +4378,21 @@ def shard_run_test_Qemu_2_of_4() {
return 0
}
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/config.cmake build/config.cmake
md5sum build/config.cmake
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/microtvm_template_projects
build/microtvm_template_projects --recursive
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/microtvm_template_projects
build/microtvm_template_projects --recursive
""",
label: 'Download artifacts from S3',
)
add_microtvm_permissions()
- ci_setup(ci_qemu)
+ ci_setup(ci_cortexm)
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_python_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
)
})
@@ -4411,20 +4411,20 @@ def shard_run_test_Qemu_2_of_4() {
}
}
} else {
- Utils.markStageSkippedForConditional('test: Qemu 2 of 4')
+ Utils.markStageSkippedForConditional('test: Cortex-M 2 of 4')
}
}
-def shard_run_test_Qemu_3_of_4() {
+def shard_run_test_Cortex_M_3_of_4() {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-cortexm") {
try {
- docker_init(ci_qemu)
+ docker_init(ci_cortexm)
init_git()
timeout(time: max_time, unit: 'MINUTES') {
withEnv([
- 'PLATFORM=qemu',
+ 'PLATFORM=cortexm',
'TVM_NUM_SHARDS=4',
'TVM_SHARD_INDEX=2'], {
sh(
@@ -4450,21 +4450,21 @@ def shard_run_test_Qemu_3_of_4() {
return 0
}
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/config.cmake build/config.cmake
md5sum build/config.cmake
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/microtvm_template_projects
build/microtvm_template_projects --recursive
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/microtvm_template_projects
build/microtvm_template_projects --recursive
""",
label: 'Download artifacts from S3',
)
add_microtvm_permissions()
- ci_setup(ci_qemu)
+ ci_setup(ci_cortexm)
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_python_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
)
})
@@ -4483,20 +4483,20 @@ def shard_run_test_Qemu_3_of_4() {
}
}
} else {
- Utils.markStageSkippedForConditional('test: Qemu 3 of 4')
+ Utils.markStageSkippedForConditional('test: Cortex-M 3 of 4')
}
}
-def shard_run_test_Qemu_4_of_4() {
+def shard_run_test_Cortex_M_4_of_4() {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-cortexm") {
try {
- docker_init(ci_qemu)
+ docker_init(ci_cortexm)
init_git()
timeout(time: max_time, unit: 'MINUTES') {
withEnv([
- 'PLATFORM=qemu',
+ 'PLATFORM=cortexm',
'TVM_NUM_SHARDS=4',
'TVM_SHARD_INDEX=3'], {
sh(
@@ -4522,21 +4522,21 @@ def shard_run_test_Qemu_4_of_4() {
return 0
}
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/config.cmake build/config.cmake
md5sum build/config.cmake
- retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/qemu/build/microtvm_template_projects
build/microtvm_template_projects --recursive
+ retry 3 aws s3 cp --no-progress
s3://${s3_prefix}/cortexm/build/microtvm_template_projects
build/microtvm_template_projects --recursive
""",
label: 'Download artifacts from S3',
)
add_microtvm_permissions()
- ci_setup(ci_qemu)
+ ci_setup(ci_cortexm)
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_python_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
)
})
@@ -4555,7 +4555,7 @@ def shard_run_test_Qemu_4_of_4() {
}
}
} else {
- Utils.markStageSkippedForConditional('test: Qemu 4 of 4')
+ Utils.markStageSkippedForConditional('test: Cortex-M 4 of 4')
}
}
@@ -4696,17 +4696,17 @@ stage('Test') {
'frontend: aarch64 2 of 2': {
shard_run_frontend_aarch64_2_of_2()
},
- 'test: Qemu 1 of 4': {
- shard_run_test_Qemu_1_of_4()
+ 'test: Cortex-M 1 of 4': {
+ shard_run_test_Cortex_M_1_of_4()
},
- 'test: Qemu 2 of 4': {
- shard_run_test_Qemu_2_of_4()
+ 'test: Cortex-M 2 of 4': {
+ shard_run_test_Cortex_M_2_of_4()
},
- 'test: Qemu 3 of 4': {
- shard_run_test_Qemu_3_of_4()
+ 'test: Cortex-M 3 of 4': {
+ shard_run_test_Cortex_M_3_of_4()
},
- 'test: Qemu 4 of 4': {
- shard_run_test_Qemu_4_of_4()
+ 'test: Cortex-M 4 of 4': {
+ shard_run_test_Cortex_M_4_of_4()
},
'unittest: CPU': {
if (!skip_ci && is_docs_only_build != 1) {
@@ -5083,7 +5083,7 @@ def deploy() {
update_docker(built_ci_hexagon, "tlcpackstaging/ci_hexagon:${tag}")
update_docker(built_ci_i386, "tlcpackstaging/ci_i386:${tag}")
update_docker(built_ci_lint, "tlcpackstaging/ci_lint:${tag}")
- update_docker(built_ci_qemu, "tlcpackstaging/ci_qemu:${tag}")
+ update_docker(built_ci_cortexm, "tlcpackstaging/ci_cortexm:${tag}")
update_docker(built_ci_wasm, "tlcpackstaging/ci_wasm:${tag}")
} finally {
sh(
diff --git a/apps/microtvm/reference-vm/base-box/base_box_provision.sh
b/apps/microtvm/reference-vm/base-box/base_box_provision.sh
index 175e4787eb..d96852b7f5 100755
--- a/apps/microtvm/reference-vm/base-box/base_box_provision.sh
+++ b/apps/microtvm/reference-vm/base-box/base_box_provision.sh
@@ -17,7 +17,7 @@
# under the License.
#
# Using this script we can reuse docker/install scripts to configure the
reference
-# virtual machine similar to CI QEMU setup.
+# virtual machine similar to CI Cortex-M setup.
#
set -x
diff --git a/apps/microtvm/reference-vm/rebuild_tvm.sh
b/apps/microtvm/reference-vm/rebuild_tvm.sh
index 6fdf4fd917..1a690d3225 100755
--- a/apps/microtvm/reference-vm/rebuild_tvm.sh
+++ b/apps/microtvm/reference-vm/rebuild_tvm.sh
@@ -40,7 +40,7 @@ if [ ! -e "${BUILD_DIR}" ]; then
mkdir "${BUILD_DIR}"
fi
-./tests/scripts/task_config_build_qemu.sh "${BUILD_DIR}"
+./tests/scripts/task_config_build_cortexm.sh "${BUILD_DIR}"
cd "${BUILD_DIR}"
cmake ..
rm -rf standalone_crt host_standalone_crt # remove stale generated files
diff --git a/apps/microtvm/zephyr_cmsisnn/README.md
b/apps/microtvm/zephyr_cmsisnn/README.md
index cccf97947e..e3e8f1c278 100644
--- a/apps/microtvm/zephyr_cmsisnn/README.md
+++ b/apps/microtvm/zephyr_cmsisnn/README.md
@@ -19,7 +19,7 @@
This project was used for the [TVMCon 2021 talk on Cortex-M improvements to
TVM](https://www.youtube.com/watch?v=6a7o8U-8Op4). It runs a keyword spotting
model with the Zephyr RTOS using CMSIS-NN with the Ahead-of-Time (AOT) executor
and the stack allocation strategy.
-The application starts from [the Zephyr base
project](https://docs.zephyrproject.org/latest/application/index.html#application)
and makes minimal changes to integrate TVM. To try it out, first refer to the
[Zephyr Getting
Started](https://docs.zephyrproject.org/latest/getting_started/index.html) page
to setup your tooling such as `west` (you can also use the `tlcpack/ci_qemu`
image). Then download the [Fixed Virtual Platform (FVP) based on Arm(R)
Corstone(TM)-300 software](https://develo [...]
+The application starts from [the Zephyr base
project](https://docs.zephyrproject.org/latest/application/index.html#application)
and makes minimal changes to integrate TVM. To try it out, first refer to the
[Zephyr Getting
Started](https://docs.zephyrproject.org/latest/getting_started/index.html) page
to setup your tooling such as `west` (you can also use the `tlcpack/ci_cortexm`
image). Then download the [Fixed Virtual Platform (FVP) based on Arm(R)
Corstone(TM)-300 software](https://dev [...]
```
export ARMFVP_BIN_PATH=/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/
@@ -32,7 +32,7 @@ wget \
-O model/cnn_s_quantized.tflite
```
-Checkout [CMSIS_5](https://github.com/ARM-software/CMSIS_5.git) (default is
`/opt/arm/ethosu/cmsis` to reflect `tlcpack/ci_qemu`):
+Checkout [CMSIS_5](https://github.com/ARM-software/CMSIS_5.git) (default is
`/opt/arm/ethosu/cmsis` to reflect `tlcpack/ci_cortexm`):
```
git clone "https://github.com/ARM-software/CMSIS_5.git" cmsis
```
diff --git a/ci/jenkins/Build.groovy.j2 b/ci/jenkins/Build.groovy.j2
index fcde53f559..a4316a268e 100644
--- a/ci/jenkins/Build.groovy.j2
+++ b/ci/jenkins/Build.groovy.j2
@@ -184,22 +184,22 @@ stage('Build') {
Utils.markStageSkippedForConditional('BUILD: arm')
}
},
- 'BUILD: QEMU': {
+ 'BUILD: Cortex-M': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
- ws({{ m.per_exec_ws('tvm/build-qemu') }}) {
- docker_init(ci_qemu)
+ ws({{ m.per_exec_ws('tvm/build-cortexm') }}) {
+ docker_init(ci_cortexm)
init_git()
sh (
- script: "${docker_run} ${ci_qemu}
./tests/scripts/task_config_build_qemu.sh build",
- label: 'Create QEMU cmake config',
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_config_build_cortexm.sh build",
+ label: 'Create Cortex-M cmake config',
)
- make(ci_qemu, 'build', '-j2')
- {{ m.upload_artifacts(tag='qemu', filenames=tvm_lib,
folders=microtvm_template_projects) }}
+ make(ci_cortexm, 'build', '-j2')
+ {{ m.upload_artifacts(tag='cortexm', filenames=tvm_lib,
folders=microtvm_template_projects) }}
}
}
} else {
- Utils.markStageSkippedForConditional('BUILD: QEMU')
+ Utils.markStageSkippedForConditional('BUILD: Cortex-M')
}
},
'BUILD: Hexagon': {
diff --git a/ci/jenkins/Jenkinsfile.j2 b/ci/jenkins/Jenkinsfile.j2
index 3f4970bb21..63131ff7ff 100644
--- a/ci/jenkins/Jenkinsfile.j2
+++ b/ci/jenkins/Jenkinsfile.j2
@@ -56,7 +56,7 @@ ci_gpu = 'tlcpack/ci-gpu:20220801-060139-d332eb374'
ci_cpu = 'tlcpack/ci-cpu:20220715-060127-37f9d3c49'
ci_wasm = 'tlcpack/ci-wasm:20220715-060127-37f9d3c49'
ci_i386 = 'tlcpack/ci-i386:20220715-060127-37f9d3c49'
-ci_qemu = 'tlcpack/ci-qemu:20220630-060117-558ba99c7'
+ci_cortexm = 'tlcpack/ci-cortexm:v0.01'
ci_arm = 'tlcpack/ci-arm:20220715-060127-37f9d3c49'
ci_hexagon = 'tlcpack/ci-hexagon:20220715-060127-37f9d3c49'
// <--- End of regex-scanned config.
diff --git a/ci/jenkins/Test.groovy.j2 b/ci/jenkins/Test.groovy.j2
index ebb19e36e7..01623b7de7 100644
--- a/ci/jenkins/Test.groovy.j2
+++ b/ci/jenkins/Test.groovy.j2
@@ -187,26 +187,26 @@
)
{% endcall %}
{% call(shard_index, num_shards) m.sharded_test_step(
- name="test: Qemu",
+ name="test: Cortex-M",
node="CPU-SMALL",
- ws="tvm/test-qemu",
- platform="qemu",
- docker_image="ci_qemu",
+ ws="tvm/test-cortexm",
+ platform="cortexm",
+ docker_image="ci_cortexm",
num_shards=4,
test_method_names=test_method_names,
) %}
- {{ m.download_artifacts(tag='qemu', filenames=tvm_lib,
folders=microtvm_template_projects) }}
+ {{ m.download_artifacts(tag='cortexm', filenames=tvm_lib,
folders=microtvm_template_projects) }}
add_microtvm_permissions()
- ci_setup(ci_qemu)
+ ci_setup(ci_cortexm)
{% if shard_index == 1%}
- cpp_unittest(ci_qemu)
+ cpp_unittest(ci_cortexm)
sh (
- script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_demo_microtvm.sh",
label: 'Run microTVM demos',
)
{% endif %}
sh (
- script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
+ script: "${docker_run} ${ci_cortexm}
./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
)
{% endcall %}
diff --git a/ci/jenkins/generate.py b/ci/jenkins/generate.py
index 686e44e14d..82bf4e5aaa 100644
--- a/ci/jenkins/generate.py
+++ b/ci/jenkins/generate.py
@@ -57,7 +57,7 @@ data = {
"platform": "CPU",
},
{
- "name": "ci_qemu",
+ "name": "ci_cortexm",
"platform": "CPU",
},
{
diff --git a/docker/Dockerfile.ci_cortexm b/docker/Dockerfile.ci_cortexm
new file mode 100644
index 0000000000..63089f3d65
--- /dev/null
+++ b/docker/Dockerfile.ci_cortexm
@@ -0,0 +1,120 @@
+# 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.
+
+# CI docker CPU env
+# tag: v0.62
+FROM ubuntu:18.04
+
+COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear
+
+RUN apt-get update --fix-missing
+
+COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
+RUN bash /install/ubuntu_install_core.sh
+
+COPY install/ubuntu_install_googletest.sh /install/ubuntu_install_googletest.sh
+RUN bash /install/ubuntu_install_googletest.sh
+
+COPY install/ubuntu1804_install_python.sh /install/ubuntu1804_install_python.sh
+RUN bash /install/ubuntu1804_install_python.sh
+
+COPY install/ubuntu1804_install_python_venv.sh
/install/ubuntu1804_install_python_venv.sh
+RUN bash /install/ubuntu1804_install_python_venv.sh
+ENV
PATH=/opt/tvm-venv/bin:/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH
+
+# Globally disable pip cache
+RUN pip config set global.no-cache-dir false
+
+COPY install/ubuntu_install_python_package.sh
/install/ubuntu_install_python_package.sh
+RUN bash /install/ubuntu_install_python_package.sh
+
+COPY install/ubuntu1804_install_llvm.sh /install/ubuntu1804_install_llvm.sh
+RUN bash /install/ubuntu1804_install_llvm.sh
+
+# Rust env (build early; takes a while)
+COPY install/ubuntu_install_rust.sh /install/ubuntu_install_rust.sh
+RUN bash /install/ubuntu_install_rust.sh
+ENV RUSTUP_HOME /opt/rust
+ENV CARGO_HOME /opt/rust
+ENV PATH $PATH:$CARGO_HOME/bin
+
+# AutoTVM deps
+COPY install/ubuntu_install_redis.sh /install/ubuntu_install_redis.sh
+RUN bash /install/ubuntu_install_redis.sh
+
+# ANTLR deps
+COPY install/ubuntu_install_java.sh /install/ubuntu_install_java.sh
+RUN bash /install/ubuntu_install_java.sh
+
+# TensorFlow deps
+COPY install/ubuntu_install_tensorflow.sh /install/ubuntu_install_tensorflow.sh
+RUN bash /install/ubuntu_install_tensorflow.sh
+
+# TFLite deps
+COPY install/ubuntu_install_tflite.sh /install/ubuntu_install_tflite.sh
+RUN bash /install/ubuntu_install_tflite.sh
+
+# sccache
+COPY install/ubuntu_install_sccache.sh /install/ubuntu_install_sccache.sh
+RUN bash /install/ubuntu_install_sccache.sh
+ENV PATH /opt/sccache:$PATH
+
+# Zephyr SDK deps
+COPY install/ubuntu_install_zephyr.sh /install/ubuntu_install_zephyr.sh
+COPY install/ubuntu_init_zephyr_project.sh
/install/ubuntu_init_zephyr_project.sh
+COPY install/ubuntu_install_zephyr_sdk.sh /install/ubuntu_install_zephyr_sdk.sh
+RUN bash /install/ubuntu_install_zephyr.sh
+ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr
+
+# FreeRTOS deps
+COPY install/ubuntu_install_freertos.sh /install/ubuntu_install_freertos.sh
+RUN bash /install/ubuntu_install_freertos.sh
+
+# Arduino deps
+# NOTE: override Arduino directories so packages are installed in a
+# CI-accessible location.
+ENV ARDUINO_DIRECTORIES_DATA=/arduino15-data
+ENV ARDUINO_DIRECTORIES_DOWNLOADS=/arduino15-downloads
+ENV ARDUINO_DIRECTORIES_USER=/arduino15-user
+COPY install/ubuntu_install_arduino.sh /install/ubuntu_install_arduino.sh
+RUN bash /install/ubuntu_install_arduino.sh
+
+# Install ONNX
+COPY install/ubuntu_install_onnx.sh /install/ubuntu_install_onnx.sh
+RUN bash /install/ubuntu_install_onnx.sh
+
+# Install CMSIS_NN
+COPY install/ubuntu_install_cmsis.sh /install/ubuntu_install_cmsis.sh
+RUN bash /install/ubuntu_install_cmsis.sh /opt/arm/ethosu/cmsis
+ENV CMSIS_PATH=/opt/arm/ethosu/cmsis/
+
+# Arm(R) Ethos(TM)-U NPU driver
+COPY install/ubuntu_install_ethosu_driver_stack.sh
/install/ubuntu_install_ethosu_driver_stack.sh
+RUN bash /install/ubuntu_install_ethosu_driver_stack.sh
+
+# Install Vela compiler
+COPY install/ubuntu_install_vela.sh /install/ubuntu_install_vela.sh
+RUN bash /install/ubuntu_install_vela.sh
+
+#Install CSI-NN2
+COPY install/ubuntu_download_csinn2_compute_lib.sh
/install/ubuntu_download_csinn2_compute_lib.sh
+RUN bash /install/ubuntu_download_csinn2_compute_lib.sh
+
+# Update PATH
+ENV PATH
/opt/arm/gcc-arm-none-eabi/bin:/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4:$PATH
+ENV PATH /opt/csi-nn2/tools/gcc-toolchain/bin:$PATH
+ENV PATH /opt/csi-nn2/tools/qemu/bin:$PATH
diff --git a/docker/install/ubuntu_install_qemu.sh
b/docker/install/ubuntu_install_qemu.sh
deleted file mode 100755
index b34ac018d9..0000000000
--- a/docker/install/ubuntu_install_qemu.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-# 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.
-
-#
-# Install QEMU on Ubuntu.
-#
-# Usage: ubuntu_install_qemu.sh [--target-list target0,target1,...]
-# --target-list is list of target for QEMU comma seperated. e.g.
aarch64-softmmu,arm-softmmu,...
-#
-
-set -e
-set -o pipefail
-
-QEMU_NAME=qemu-5.1.0
-QEMU_SIG_FILE=${QEMU_NAME}.tar.xz.sig
-QEMU_TAR_FILE=${QEMU_NAME}.tar.xz
-
-# Clean previous build
-rm -rf ${QEMU_NAME} ${QEMU_SIG_FILE} ${QEMU_TAR_FILE}
-
-# Get number of cores for build
-if [ -n "${TVM_CI_NUM_CORES}" ]; then
- num_cores=${TVM_CI_NUM_CORES}
-else
- num_cores=2
-fi
-
-# Set target list for QEMU
-if [ "$1" == "--target-list" ]; then
- shift
- target_list=$1
-else
- # Build these by defualt for microtvm reference virtual machine and
ci_qemu.
-
target_list="aarch64-softmmu,arm-softmmu,i386-softmmu,riscv32-softmmu,riscv64-softmmu,x86_64-softmmu"
-fi
-
-sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
-apt update
-apt-get -y build-dep qemu
-
-gpg --keyserver keyserver.ubuntu.com --recv-keys 0x3353C9CEF108B584
-cat <<EOF | gpg --dearmor >${QEMU_SIG_FILE}
------BEGIN PGP ARMORED FILE-----
-Comment: Use "gpg --dearmor" for unpacking
-
-iQEzBAABCgAdFiEEzqzJ4VU066u4LT+gM1PJzvEItYQFAl8zEnAACgkQM1PJzvEI
-tYSp2wf/X/8I+hz1OLHCnoJuA9AqXEz1vtQ/dsvL1FfkOerMglih8wh9HYastf2+
-CWsX8o9i5ryrxWafJKIRjj7uAgEuekvpkm3on7/iiZNXYkQOqeBBylUuGXI2BOXr
-ObS4alzzgowp2laoe2n7Ew391HbvYX0NT5HqKxlCYsLcbCeYtI+7jVgQzxtnwFzO
-Vb4zLJybhHQfAVlc5SkKfZkW+0yPnMeS376bYqJz+Wo3UZYVfZrHPygHX1NhRVYc
-p5ez/+2k4VAIwIQoP5DoO06waLBffvLIAdPPKYsx71K67OoGG2svc7duC/+5qf1x
-8FBFJX9b4ft0tr/cwpVdq8dr/VWqQg==
-=hCS7
------END PGP ARMORED FILE-----
-EOF
-curl -OLs https://download.qemu.org/${QEMU_TAR_FILE}
-gpg --verify ${QEMU_SIG_FILE}
-
-tar -xf ${QEMU_TAR_FILE}
-
-cd ${QEMU_NAME}
-./configure --target-list=${target_list}
-make -j${num_cores}
-sudo make install
-
-# For debugging with qemu
-apt-install-and-clear -y install libpython3.8
diff --git a/tests/python/ci/test_ci.py b/tests/python/ci/test_ci.py
index 7864830269..5ab5e69504 100644
--- a/tests/python/ci/test_ci.py
+++ b/tests/python/ci/test_ci.py
@@ -916,7 +916,7 @@ def test_open_docker_update_pr(
"ci_cpu",
"ci_wasm",
"ci_i386",
- "ci_qemu",
+ "ci_cortexm",
"ci_arm",
"ci_hexagon",
]
diff --git a/tests/scripts/ci.py b/tests/scripts/ci.py
index 022d192002..f5c60c9450 100755
--- a/tests/scripts/ci.py
+++ b/tests/scripts/ci.py
@@ -165,7 +165,7 @@ def docker(name: str, image: str, scripts: List[str], env:
Dict[str, str], inter
"ci_cpu",
# "ci_wasm",
# "ci_i386",
- "ci_qemu",
+ "ci_cortexm",
"ci_arm",
"ci_hexagon",
}
@@ -618,8 +618,8 @@ generated = [
},
),
generate_command(
- name="qemu",
- help="Run QEMU build and test(s)",
+ name="cortexm",
+ help="Run Cortex-M build and test(s)",
options={
"cpp": CPP_UNITTEST,
"test": (
diff --git a/apps/microtvm/reference-vm/rebuild_tvm.sh
b/tests/scripts/task_config_build_cortexm.sh
similarity index 56%
copy from apps/microtvm/reference-vm/rebuild_tvm.sh
copy to tests/scripts/task_config_build_cortexm.sh
index 6fdf4fd917..29869983b8 100755
--- a/apps/microtvm/reference-vm/rebuild_tvm.sh
+++ b/tests/scripts/task_config_build_cortexm.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
# 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
@@ -15,33 +15,21 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-#
-
-set -e
-
-if [ "$1" == "--help" ]; then
- echo "Usage ./apps/microtvm/reference-vm/rebuild_tvm.sh"
- exit -1
-fi
-
-# Get number of cores for build
-if [ -n "${TVM_CI_NUM_CORES}" ]; then
- num_cores=${TVM_CI_NUM_CORES}
-else
- # default setup for Vagrantfile
- num_cores=2
-fi
-cd "$(dirname $0)"
-cd "$(git rev-parse --show-toplevel)"
-BUILD_DIR="build-microtvm"
+set -euxo pipefail
-if [ ! -e "${BUILD_DIR}" ]; then
- mkdir "${BUILD_DIR}"
-fi
+BUILD_DIR=$1
+mkdir -p "$BUILD_DIR"
+cd "$BUILD_DIR"
+cp ../cmake/config.cmake .
-./tests/scripts/task_config_build_qemu.sh "${BUILD_DIR}"
-cd "${BUILD_DIR}"
-cmake ..
-rm -rf standalone_crt host_standalone_crt # remove stale generated files
-make -j${num_cores}
+echo set\(USE_SORT ON\) >> config.cmake
+echo set\(USE_MICRO ON\) >> config.cmake
+echo set\(USE_CMSISNN ON\) >> config.cmake
+echo set\(USE_ETHOSU ON\) >> config.cmake
+echo set\(USE_PROFILER ON\) >> config.cmake
+echo set\(USE_LLVM llvm-config-10\) >> config.cmake
+echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
+echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
+echo set\(USE_CCACHE OFF\) >> config.cmake
+echo set\(SUMMARIZE ON\) >> config.cmake