Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 79 additions & 79 deletions Jenkinsfile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/microtvm/reference-vm/base-box/base_box_provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/microtvm/reference-vm/rebuild_tvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions apps/microtvm/zephyr_cmsisnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps) and set the path for Zephyr to find it:
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://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps) and set the path for Zephyr to find it:

```
export ARMFVP_BIN_PATH=/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/
Expand All @@ -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
```
Expand Down
16 changes: 8 additions & 8 deletions ci/jenkins/Build.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/Jenkinsfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is referenced in a few other places (Test.groovy.j2, Build.groovy.j2) that you also might have to change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed these.

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.
Expand Down
18 changes: 9 additions & 9 deletions ci/jenkins/Test.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"platform": "CPU",
},
{
"name": "ci_qemu",
"name": "ci_cortexm",
"platform": "CPU",
},
{
Expand Down
120 changes: 120 additions & 0 deletions docker/Dockerfile.ci_cortexm
Original file line number Diff line number Diff line change
@@ -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
82 changes: 0 additions & 82 deletions docker/install/ubuntu_install_qemu.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tests/python/ci/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def test_open_docker_update_pr(
"ci_cpu",
"ci_wasm",
"ci_i386",
"ci_qemu",
"ci_cortexm",
"ci_arm",
"ci_hexagon",
]
Expand Down
6 changes: 3 additions & 3 deletions tests/scripts/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down Expand Up @@ -618,8 +618,8 @@ def add_subparser(
},
),
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": (
Expand Down
35 changes: 35 additions & 0 deletions tests/scripts/task_config_build_cortexm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/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
# 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.

set -euxo pipefail

BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
cp ../cmake/config.cmake .

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