diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 48b9d62bb9b7..313c440cbd21 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -38,59 +38,124 @@ jobs:
MacOS:
runs-on: macOS-latest
steps:
- - uses: actions/checkout@v2
- with:
- submodules: 'recursive'
- - name: Set up environment
- uses: ./.github/actions/setup
- - name: Conda Build
- shell: bash -l {0}
- run: >-
- conda build --output-folder=conda/pkg conda/recipe &&
- conda install tvm -c ./conda/pkg
- - name: Build iOS RPC
- run: |
- IOS_VERSION="14.0"
- CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_SYSTEM_NAME=iOS \
- -DCMAKE_SYSTEM_VERSION=${IOS_VERSION} \
- -DCMAKE_OSX_SYSROOT=iphonesimulator \
- -DCMAKE_OSX_ARCHITECTURES=x86_64 \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
- -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON \
- -DUSE_IOS_RPC=ON"
-
- mkdir build-ios-simulator
- cd build-ios-simulator
- cmake .. ${CMAKE_FLAGS}
- cmake --build . --target ios_rpc
- - name: Test
- shell: bash -l {0}
- run: >-
- python -m pytest -v tests/python/all-platform-minimal-test
- - name: Test iOS RPC
- shell: bash -l {0}
- run: >-
- python -m pip install tornado psutil cloudpickle &&
- export PYTHONPATH=tests/python/contrib:${PYTHONPATH} &&
- export BUNDLE_ID=org.apache.tvmrpc &&
- export BUNDLE_PATH=build-ios-simulator/apps/ios_rpc/ios_rpc/src/ios_rpc-build/Release-iphonesimulator/tvmrpc.app &&
- python -m pytest -v tests/python/contrib/test_rpc_server_device.py
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'recursive'
+ - name: Set up environment
+ uses: ./.github/actions/setup
+ - name: Conda Build
+ shell: bash -l {0}
+ run: >-
+ conda build --output-folder=conda/pkg conda/recipe &&
+ conda install tvm -c ./conda/pkg
+ - name: Build iOS RPC
+ run: |
+ IOS_VERSION="14.0"
+ CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SYSTEM_NAME=iOS \
+ -DCMAKE_SYSTEM_VERSION=${IOS_VERSION} \
+ -DCMAKE_OSX_SYSROOT=iphonesimulator \
+ -DCMAKE_OSX_ARCHITECTURES=x86_64 \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
+ -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON \
+ -DUSE_IOS_RPC=ON"
+
+ mkdir build-ios-simulator
+ cd build-ios-simulator
+ cmake .. ${CMAKE_FLAGS}
+ cmake --build . --target ios_rpc
+ - name: Test
+ shell: bash -l {0}
+ run: >-
+ python -m pytest -v tests/python/all-platform-minimal-test
+ - name: Test iOS RPC
+ shell: bash -l {0}
+ run: >-
+ python -m pip install tornado psutil cloudpickle &&
+ export PYTHONPATH=tests/python/contrib:${PYTHONPATH} &&
+ export BUNDLE_ID=org.apache.tvmrpc &&
+ export BUNDLE_PATH=build-ios-simulator/apps/ios_rpc/ios_rpc/src/ios_rpc-build/Release-iphonesimulator/tvmrpc.app &&
+ python -m pytest -v tests/python/contrib/test_rpc_server_device.py
Windows:
runs-on: windows-2019
steps:
- - uses: actions/checkout@v2
- with:
- submodules: 'recursive'
- - name: Set up environment
- uses: ./.github/actions/setup
- - name: Conda Build
- shell: cmd /C call {0}
- run: >-
- conda build --output-folder=conda/pkg conda/recipe &&
- conda install tvm -c ./conda/pkg
- - name: Test
- shell: cmd /C call {0}
- run: >-
- python -m pytest -v tests/python/all-platform-minimal-test
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'recursive'
+ - name: Set up environment
+ uses: ./.github/actions/setup
+ - name: Conda Build
+ shell: cmd /C call {0}
+ run: >-
+ conda build --output-folder=conda/pkg conda/recipe &&
+ conda install tvm -c ./conda/pkg
+ - name: Test
+ shell: cmd /C call {0}
+ run: >-
+ python -m pytest -v tests/python/all-platform-minimal-test
+
+ Android:
+ runs-on: Ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'recursive'
+ - name: Set up environment
+ uses: ./.github/actions/setup
+ - name: Set up java
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'zulu'
+ java-version: '11'
+ - name: Build TVM
+ shell: bash -l {0}
+ run: |
+ mkdir build
+ cd build
+ ../tests/scripts/task_config_build_jvm.sh .
+ cmake ..
+ make
+ - name: Build TVM4J
+ run: |
+ make jvmpkg
+ - name: Build android_rpc
+ working-directory: apps/android_rpc
+ run: |
+ export PATH="${ANDROID_NDK_HOME}:$PATH"
+ gradle clean build
+ - name: Upload android_rpc APK
+ uses: actions/upload-artifact@v2
+ with:
+ name: android_rpc-debug.apk
+ path: ./apps/android_rpc/app/build/outputs/apk/debug/app-debug.apk
+ - name: Build android_deploy
+ working-directory: apps/android_deploy
+ run: |
+ export PATH="${ANDROID_NDK_HOME}:$PATH"
+ gradle clean build
+ - name: Upload android_deploy APK
+ uses: actions/upload-artifact@v2
+ with:
+ name: android_deploy-debug.apk
+ path: ./apps/android_deploy/app/build/outputs/apk/debug/app-debug.apk
+ - name: Build android_camera
+ working-directory: apps/android_camera
+ run: |
+ mkdir -p app/src/main/assets/models/
+ export TVM_NDK_CC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++
+ export TVM_HOME=~/work/tvm/tvm
+ export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}
+ python3 ${TVM_HOME}/python/gen_requirements.py
+ pip3 install -r ${TVM_HOME}/python/requirements/core.txt
+ cd models
+ pip3 install -r requirements.txt
+ python3 prepare_model.py
+ cd ..
+ export PATH="${ANDROID_NDK_HOME}:$PATH"
+ gradle clean build
+ - name: Upload android_camera APK
+ uses: actions/upload-artifact@v2
+ with:
+ name: android_camera-debug.apk
+ path: ./apps/android_camera/app/build/outputs/apk/debug/app-debug.apk
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
index 0b64f9306844..1e207f09059b 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-05-20T13:24:01.371704
+// Generated at 2022-05-23T16:38:45.963400
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -484,6 +484,13 @@ def add_microtvm_permissions() {
)
}
+def add_hexagon_permissions() {
+ sh(
+ script: 'find build/hexagon_api_output -type f | xargs chmod +x',
+ label: 'Add execute permissions for hexagon files',
+ )
+}
+
def build() {
stage('Build') {
environment {
@@ -703,6 +710,10 @@ stage('Build') {
label: 'Create Hexagon cmake config',
)
make(ci_hexagon, 'build', '-j2')
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
+ label: 'Build Hexagon API',
+ )
sh(
script: """
set -eux
@@ -712,6 +723,7 @@ stage('Build') {
aws s3 cp --no-progress build/libtvm_runtime.so s3://${s3_prefix}/hexagon/build/libtvm_runtime.so
md5sum build/config.cmake
aws s3 cp --no-progress build/config.cmake s3://${s3_prefix}/hexagon/build/config.cmake
+ aws s3 cp --no-progress build/hexagon_api_output s3://${s3_prefix}/hexagon/build/hexagon_api_output --recursive
""",
label: 'Upload artifacts to S3',
)
@@ -725,24 +737,24 @@ stage('Build') {
)
}
}
-def test() {
-stage('Test') {
- environment {
- SKIP_SLOW_TESTS = "${skip_slow_tests}"
- }
- parallel(
- 'unittest: GPU 1 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+
+// We have to do this whacky split of the code from where it's used since the
+// JVM limits method length to 64k and we easily exceed that with all this
+// autogenerated code. This makes it so each test step is in its own method so
+// that each individual method isn't too big.
+
+def shard_run_unittest_GPU_1_of_3() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=3',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/gpu2/build/libtvm.so build/libtvm.so
@@ -757,9 +769,9 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- cpp_unittest(ci_gpu)
+ cpp_unittest(ci_gpu)
- sh(
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
@@ -774,39 +786,40 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
- cpp_unittest(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
- label: 'Run Python GPU unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
- label: 'Run Python GPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_gpu)
+ cpp_unittest(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
+ label: 'Run Python GPU unit tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
+ label: 'Run Python GPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('unittest: GPU 1 of 2')
}
- },
- 'unittest: GPU 2 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('unittest: GPU 1 of 3')
+ }
+}
+
+def shard_run_unittest_GPU_2_of_3() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=3',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
@@ -821,86 +834,91 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",
- label: 'Run Java unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
- label: 'Run Python GPU unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
- label: 'Run Python GPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",
+ label: 'Run Java unit tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
+ label: 'Run Python GPU unit tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
+ label: 'Run Python GPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('unittest: GPU 2 of 2')
}
- },
- 'integration: CPU 1 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=cpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('unittest: GPU 2 of 3')
+ }
+}
+
+def shard_run_unittest_GPU_3_of_3() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=3',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
- md5sum build/libvta_tsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_cpu)
- sh (
- script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
+ label: 'Run Python GPU unit tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
+ label: 'Run Python GPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('integration: CPU 1 of 2')
}
- },
- 'integration: CPU 2 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=cpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('unittest: GPU 3 of 3')
+ }
+}
+
+
+def shard_run_integration_CPU_1_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
@@ -917,31 +935,35 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- ci_setup(ci_cpu)
- sh (
- script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('integration: CPU 2 of 2')
}
- },
- 'unittest: CPU': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-cpu") {
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 1 of 6')
+ }
+}
+
+def shard_run_integration_CPU_2_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
timeout(time: max_time, unit: 'MINUTES') {
- try {
- init_git()
- withEnv(['PLATFORM=cpu'], {
- sh(
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
@@ -958,259 +980,443 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- ci_setup(ci_cpu)
- cpp_unittest(ci_cpu)
- python_unittest(ci_cpu)
- fsim_test(ci_cpu)
- sh (
- script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh",
- label: 'Run VTA tests in TSIM',
- )
- })
- } finally {
- junit 'build/pytest-results/*.xml'
- }
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('unittest: CPU')
}
- },
- 'python: i386 1 of 3': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=i386',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 2 of 6')
+ }
+}
+
+def shard_run_integration_CPU_3_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
+ md5sum build/libvta_tsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_i386)
- cpp_unittest(ci_i386)
- python_unittest(ci_i386)
- sh (
- script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
- label: 'Run i386 integration tests',
- )
- fsim_test(ci_i386)
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('python: i386 1 of 3')
}
- },
- 'python: i386 2 of 3': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=i386',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 3 of 6')
+ }
+}
+
+def shard_run_integration_CPU_4_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
+ md5sum build/libvta_tsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_i386)
- python_unittest(ci_i386)
- sh (
- script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
- label: 'Run i386 integration tests',
- )
- fsim_test(ci_i386)
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('python: i386 2 of 3')
}
- },
- 'python: i386 3 of 3': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=i386',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=2'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 4 of 6')
+ }
+}
+
+def shard_run_integration_CPU_5_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=4'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
+ md5sum build/libvta_tsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_i386)
- python_unittest(ci_i386)
- sh (
- script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
- label: 'Run i386 integration tests',
- )
- fsim_test(ci_i386)
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('python: i386 3 of 3')
}
- },
- 'test: Hexagon 1 of 4': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=hexagon',
- 'TVM_NUM_SHARDS=4',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 5 of 6')
+ }
+}
+
+def shard_run_integration_CPU_6_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-cpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=cpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=5'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
+ md5sum build/libvta_tsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_hexagon)
- cpp_unittest(ci_hexagon)
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
- label: 'Build Hexagon API',
- )
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
- label: 'Run Hexagon tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('test: Hexagon 1 of 4')
}
- },
- 'test: Hexagon 2 of 4': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=hexagon',
- 'TVM_NUM_SHARDS=4',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('integration: CPU 6 of 6')
+ }
+}
+
+
+def shard_run_python_i386_1_of_5() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=i386',
+ 'TVM_NUM_SHARDS=5',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_hexagon)
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
- label: 'Build Hexagon API',
- )
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
- label: 'Run Hexagon tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_i386)
+ cpp_unittest(ci_i386)
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('test: Hexagon 2 of 4')
}
- },
- 'test: Hexagon 3 of 4': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=hexagon',
- 'TVM_NUM_SHARDS=4',
- 'TVM_SHARD_INDEX=2'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('python: i386 1 of 5')
+ }
+}
+
+def shard_run_python_i386_2_of_5() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=i386',
+ 'TVM_NUM_SHARDS=5',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_i386)
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('python: i386 2 of 5')
+ }
+}
+
+def shard_run_python_i386_3_of_5() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=i386',
+ 'TVM_NUM_SHARDS=5',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_i386)
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('python: i386 3 of 5')
+ }
+}
+
+def shard_run_python_i386_4_of_5() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=i386',
+ 'TVM_NUM_SHARDS=5',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_i386)
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('python: i386 4 of 5')
+ }
+}
+
+def shard_run_python_i386_5_of_5() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/integration-python-i386") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=i386',
+ 'TVM_NUM_SHARDS=5',
+ 'TVM_SHARD_INDEX=4'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/i386/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_i386)
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('python: i386 5 of 5')
+ }
+}
+
+
+def shard_run_test_Hexagon_1_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
@@ -1219,42 +1425,42 @@ stage('Test') {
md5sum build/libtvm_runtime.so
aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_hexagon)
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
- label: 'Build Hexagon API',
- )
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
- label: 'Run Hexagon tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ cpp_unittest(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('test: Hexagon 3 of 4')
}
- },
- 'test: Hexagon 4 of 4': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=hexagon',
- 'TVM_NUM_SHARDS=4',
- 'TVM_SHARD_INDEX=3'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 1 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_2_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
@@ -1263,173 +1469,866 @@ stage('Test') {
md5sum build/libtvm_runtime.so
aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_hexagon)
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
- label: 'Build Hexagon API',
- )
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
- label: 'Run Hexagon tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('test: Hexagon 4 of 4')
}
- },
- 'test: QEMU': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('CPU-SMALL') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 2 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_3_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
timeout(time: max_time, unit: 'MINUTES') {
- try {
- init_git()
- withEnv(['PLATFORM=qemu'], {
- sh(
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
md5sum build/config.cmake
- aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/microtvm_template_projects build/microtvm_template_projects --recursive
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
""",
label: 'Download artifacts from S3',
)
- add_microtvm_permissions()
- ci_setup(ci_qemu)
- cpp_unittest(ci_qemu)
- sh (
- script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
- label: 'Run microTVM tests',
- )
- sh (
- script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
- label: 'Run microTVM demos',
- )
- })
- } finally {
- junit 'build/pytest-results/*.xml'
- }
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('test: QEMU')
}
- },
- 'topi: aarch64': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('ARM') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 3 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_4_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
timeout(time: max_time, unit: 'MINUTES') {
- try {
- init_git()
- withEnv(['PLATFORM=arm'], {
- sh(
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
- md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_arm)
- cpp_unittest(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
- label: 'Run test_arm_compute_lib test',
- )
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
- label: 'Run TOPI tests',
- )
- })
- } finally {
- junit 'build/pytest-results/*.xml'
- }
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 4 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_5_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=4'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 5 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_6_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=5'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 6 of 7')
+ }
+}
+
+def shard_run_test_Hexagon_7_of_7() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=hexagon',
+ 'TVM_NUM_SHARDS=7',
+ 'TVM_SHARD_INDEX=6'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/hexagon/build/hexagon_api_output build/hexagon_api_output --recursive
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('test: Hexagon 7 of 7')
+ }
+}
+
+
+def shard_run_integration_aarch64_1_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_arm)
+ python_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('integration: aarch64 1 of 4')
+ }
+}
+
+def shard_run_integration_aarch64_2_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_arm)
+ python_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('integration: aarch64 2 of 4')
+ }
+}
+
+def shard_run_integration_aarch64_3_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_arm)
+ python_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('integration: aarch64 3 of 4')
+ }
+}
+
+def shard_run_integration_aarch64_4_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_arm)
+ python_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('integration: aarch64 4 of 4')
+ }
+}
+
+
+def shard_run_topi_GPU_1_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('topi: GPU 1 of 4')
+ }
+}
+
+def shard_run_topi_GPU_2_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('topi: GPU 2 of 4')
+ }
+}
+
+def shard_run_topi_GPU_3_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('topi: GPU 3 of 4')
+ }
+}
+
+def shard_run_topi_GPU_4_of_4() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=4',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('topi: GPU 4 of 4')
+ }
+}
+
+
+def shard_run_frontend_GPU_1_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 1 of 6')
+ }
+}
+
+def shard_run_frontend_GPU_2_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 2 of 6')
+ }
+}
+
+def shard_run_frontend_GPU_3_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=2'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 3 of 6')
+ }
+}
+
+def shard_run_frontend_GPU_4_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=3'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
+ }
+ } finally {
+ junit 'build/pytest-results/*.xml'
+ }
+ }
+ }
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 4 of 6')
+ }
+}
+
+def shard_run_frontend_GPU_5_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=4'], {
+ sh(
+ script: """
+ set -eux
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ md5sum build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ md5sum build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ md5sum build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ md5sum build/config.cmake
+ """,
+ label: 'Download artifacts from S3',
+ )
+
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('topi: aarch64')
}
- },
- 'integration: aarch64 1 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('ARM') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=arm',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 5 of 6')
+ }
+}
+
+def shard_run_frontend_GPU_6_of_6() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('GPU') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=gpu',
+ 'TVM_NUM_SHARDS=6',
+ 'TVM_SHARD_INDEX=5'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_arm)
- python_unittest(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('integration: aarch64 1 of 2')
}
- },
- 'integration: aarch64 2 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('ARM') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=arm',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('frontend: GPU 6 of 6')
+ }
+}
+
+
+def shard_run_topi_aarch64_1_of_2() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=2',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
@@ -1444,236 +2343,379 @@ stage('Test') {
label: 'Download artifacts from S3',
)
- ci_setup(ci_arm)
- python_unittest(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_arm)
+ cpp_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
+ label: 'Run test_arm_compute_lib test',
+ )
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('integration: aarch64 2 of 2')
}
- },
- 'topi: GPU 1 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('topi: aarch64 1 of 2')
+ }
+}
+
+def shard_run_topi_aarch64_2_of_2() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=2',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
- label: 'Run TOPI tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_arm)
+ cpp_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
+ label: 'Run test_arm_compute_lib test',
+ )
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('topi: GPU 1 of 2')
}
- },
- 'topi: GPU 2 of 2': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/topi-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=2',
- 'TVM_SHARD_INDEX=1'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('topi: aarch64 2 of 2')
+ }
+}
+
+
+def shard_run_frontend_aarch64_1_of_2() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=2',
+ 'TVM_SHARD_INDEX=0'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
- label: 'Run TOPI tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('topi: GPU 2 of 2')
}
- },
- 'frontend: GPU 1 of 3': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=0'], {
- sh(
+ } else {
+ Utils.markStageSkippedForConditional('frontend: aarch64 1 of 2')
+ }
+}
+
+def shard_run_frontend_aarch64_2_of_2() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('ARM') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-arm") {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM=arm',
+ 'TVM_NUM_SHARDS=2',
+ 'TVM_SHARD_INDEX=1'], {
+ sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
- label: 'Run Python frontend tests',
- )
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+ ci_setup(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh",
+ label: 'Run Python frontend tests',
+ )
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('frontend: GPU 1 of 3')
}
+ } else {
+ Utils.markStageSkippedForConditional('frontend: aarch64 2 of 2')
+ }
+}
+
+
+
+def test() {
+stage('Test') {
+ environment {
+ SKIP_SLOW_TESTS = "${skip_slow_tests}"
+ }
+ parallel(
+ 'unittest: GPU 1 of 3': {
+ shard_run_unittest_GPU_1_of_3()
+ },
+ 'unittest: GPU 2 of 3': {
+ shard_run_unittest_GPU_2_of_3()
+ },
+ 'unittest: GPU 3 of 3': {
+ shard_run_unittest_GPU_3_of_3()
+ },
+ 'integration: CPU 1 of 6': {
+ shard_run_integration_CPU_1_of_6()
},
- 'frontend: GPU 2 of 3': {
+ 'integration: CPU 2 of 6': {
+ shard_run_integration_CPU_2_of_6()
+ },
+ 'integration: CPU 3 of 6': {
+ shard_run_integration_CPU_3_of_6()
+ },
+ 'integration: CPU 4 of 6': {
+ shard_run_integration_CPU_4_of_6()
+ },
+ 'integration: CPU 5 of 6': {
+ shard_run_integration_CPU_5_of_6()
+ },
+ 'integration: CPU 6 of 6': {
+ shard_run_integration_CPU_6_of_6()
+ },
+ 'python: i386 1 of 5': {
+ shard_run_python_i386_1_of_5()
+ },
+ 'python: i386 2 of 5': {
+ shard_run_python_i386_2_of_5()
+ },
+ 'python: i386 3 of 5': {
+ shard_run_python_i386_3_of_5()
+ },
+ 'python: i386 4 of 5': {
+ shard_run_python_i386_4_of_5()
+ },
+ 'python: i386 5 of 5': {
+ shard_run_python_i386_5_of_5()
+ },
+ 'test: Hexagon 1 of 7': {
+ shard_run_test_Hexagon_1_of_7()
+ },
+ 'test: Hexagon 2 of 7': {
+ shard_run_test_Hexagon_2_of_7()
+ },
+ 'test: Hexagon 3 of 7': {
+ shard_run_test_Hexagon_3_of_7()
+ },
+ 'test: Hexagon 4 of 7': {
+ shard_run_test_Hexagon_4_of_7()
+ },
+ 'test: Hexagon 5 of 7': {
+ shard_run_test_Hexagon_5_of_7()
+ },
+ 'test: Hexagon 6 of 7': {
+ shard_run_test_Hexagon_6_of_7()
+ },
+ 'test: Hexagon 7 of 7': {
+ shard_run_test_Hexagon_7_of_7()
+ },
+ 'integration: aarch64 1 of 4': {
+ shard_run_integration_aarch64_1_of_4()
+ },
+ 'integration: aarch64 2 of 4': {
+ shard_run_integration_aarch64_2_of_4()
+ },
+ 'integration: aarch64 3 of 4': {
+ shard_run_integration_aarch64_3_of_4()
+ },
+ 'integration: aarch64 4 of 4': {
+ shard_run_integration_aarch64_4_of_4()
+ },
+ 'topi: GPU 1 of 4': {
+ shard_run_topi_GPU_1_of_4()
+ },
+ 'topi: GPU 2 of 4': {
+ shard_run_topi_GPU_2_of_4()
+ },
+ 'topi: GPU 3 of 4': {
+ shard_run_topi_GPU_3_of_4()
+ },
+ 'topi: GPU 4 of 4': {
+ shard_run_topi_GPU_4_of_4()
+ },
+ 'frontend: GPU 1 of 6': {
+ shard_run_frontend_GPU_1_of_6()
+ },
+ 'frontend: GPU 2 of 6': {
+ shard_run_frontend_GPU_2_of_6()
+ },
+ 'frontend: GPU 3 of 6': {
+ shard_run_frontend_GPU_3_of_6()
+ },
+ 'frontend: GPU 4 of 6': {
+ shard_run_frontend_GPU_4_of_6()
+ },
+ 'frontend: GPU 5 of 6': {
+ shard_run_frontend_GPU_5_of_6()
+ },
+ 'frontend: GPU 6 of 6': {
+ shard_run_frontend_GPU_6_of_6()
+ },
+ 'topi: aarch64 1 of 2': {
+ shard_run_topi_aarch64_1_of_2()
+ },
+ 'topi: aarch64 2 of 2': {
+ shard_run_topi_aarch64_2_of_2()
+ },
+ 'frontend: aarch64 1 of 2': {
+ shard_run_frontend_aarch64_1_of_2()
+ },
+ 'frontend: aarch64 2 of 2': {
+ shard_run_frontend_aarch64_2_of_2()
+ },
+ 'unittest: CPU': {
if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=1'], {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-cpu") {
+ timeout(time: max_time, unit: 'MINUTES') {
+ try {
+ init_git()
+ withEnv(['PLATFORM=cpu'], {
sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_tsim.so build/libvta_tsim.so
+ md5sum build/libvta_tsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libvta_fsim.so build/libvta_fsim.so
md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/cpu/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
+ ci_setup(ci_cpu)
+ cpp_unittest(ci_cpu)
+ python_unittest(ci_cpu)
+ fsim_test(ci_cpu)
sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
- label: 'Run Python frontend tests',
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh",
+ label: 'Run VTA tests in TSIM',
)
})
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
- } finally {
- junit 'build/pytest-results/*.xml'
}
}
}
} else {
- Utils.markStageSkippedForConditional('frontend: GPU 2 of 3')
+ Utils.markStageSkippedForConditional('unittest: CPU')
}
},
- 'frontend: GPU 3 of 3': {
+ 'test: QEMU': {
if (!skip_ci && is_docs_only_build != 1) {
- node('GPU') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-gpu") {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=2'], {
+ node('CPU-SMALL') {
+ ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
+ timeout(time: max_time, unit: 'MINUTES') {
+ try {
+ init_git()
+ withEnv(['PLATFORM=qemu'], {
sh(
script: """
set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm.so build/libtvm.so
+ aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libvta_fsim.so build/libvta_fsim.so
- md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/libtvm_runtime.so build/libtvm_runtime.so
+ aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/gpu/build/config.cmake build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/config.cmake build/config.cmake
md5sum build/config.cmake
+ aws s3 cp --no-progress s3://${s3_prefix}/qemu/build/microtvm_template_projects build/microtvm_template_projects --recursive
""",
label: 'Download artifacts from S3',
)
- ci_setup(ci_gpu)
+ add_microtvm_permissions()
+ ci_setup(ci_qemu)
+ cpp_unittest(ci_qemu)
sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
- label: 'Run Python frontend tests',
+ script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
+ label: 'Run microTVM tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
+ label: 'Run microTVM demos',
)
})
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
- } finally {
- junit 'build/pytest-results/*.xml'
}
}
}
} else {
- Utils.markStageSkippedForConditional('frontend: GPU 3 of 3')
+ Utils.markStageSkippedForConditional('test: QEMU')
}
},
'frontend: CPU': {
if (!skip_ci && is_docs_only_build != 1) {
- node('CPU') {
+ node('CPU-SMALL') {
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-cpu") {
timeout(time: max_time, unit: 'MINUTES') {
try {
@@ -1710,45 +2752,6 @@ stage('Test') {
Utils.markStageSkippedForConditional('frontend: CPU')
}
},
- 'frontend: aarch64': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('ARM') {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/frontend-python-arm") {
- timeout(time: max_time, unit: 'MINUTES') {
- try {
- init_git()
- withEnv(['PLATFORM=arm'], {
- sh(
- script: """
- set -eux
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm.so build/libtvm.so
- md5sum build/libtvm.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libvta_fsim.so build/libvta_fsim.so
- md5sum build/libvta_fsim.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/libtvm_runtime.so build/libtvm_runtime.so
- md5sum build/libtvm_runtime.so
- aws s3 cp --no-progress s3://${s3_prefix}/arm/build/config.cmake build/config.cmake
- md5sum build/config.cmake
- """,
- label: 'Download artifacts from S3',
- )
-
- ci_setup(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh",
- label: 'Run Python frontend tests',
- )
- })
- } finally {
- junit 'build/pytest-results/*.xml'
- }
- }
- }
- }
- } else {
- Utils.markStageSkippedForConditional('frontend: aarch64')
- }
- },
'docs: GPU': {
if (!skip_ci) {
node('GPU') {
diff --git a/apps/android_camera/README.md b/apps/android_camera/README.md
index c292ce40c582..f659e905f281 100644
--- a/apps/android_camera/README.md
+++ b/apps/android_camera/README.md
@@ -1,28 +1,107 @@
-[//]: # 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.
-
-Android Camera Demo Sample App
-==============================
-
-The Android Camera Demo Sample App provides a basic implementation of an Android
-app that uses the tvm runtime to perform image classification in real time.
-
-Converting Models
------------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Android Camera Demo Sample App
+
+The Android Camera Demo Sample App provides a basic implementation of an Android app that uses the tvm runtime to perform image classification in real time.
+
+You will need JDK, [Android NDK](https://developer.android.com/ndk) and an Android device to use this.
+
+## Build and Installation
+
+### Prepare Models
The `models/prepare_models.py` script provides a example flow for dumping model
parameter files for use by the app.
+
+1. Set path to the NDK CC: `export TVM_NDK_CC=[Path to CC, e.g. /opt/android-toolchain-arm64/bin/aarch64-linux-android-g++]`
+2. Switch to the script directory: `cd models`
+3. Run script: `python3 prepare_model.py`
+
+#### Sample output
+```
+mobilenet_v2
+getting model...
+building...
+dumping lib...
+dumping graph...
+dumping params...
+dumping labels...
+resnet18_v1
+getting model...
+building...
+dumping lib...
+dumping graph...
+dumping params...
+dumping labels...
+```
+
+### Build APK
+
+We use [Gradle](https://gradle.org) to build. Please follow [the installation instruction](https://gradle.org/install) for your operating system.
+
+Before you build the Android application, please refer to [TVM4J Installation Guide](https://github.com/apache/tvm/blob/main/jvm/README.md) and install tvm4j-core to your local maven repository. You can find tvm4j dependency declare in `app/build.gradle`. Modify it if it is necessary.
+
+```
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ implementation 'androidx.appcompat:appcompat:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
+ implementation 'com.google.android.material:material:1.5.0'
+ implementation 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ testImplementation 'junit:junit:4.13.2'
+
+ implementation "androidx.concurrent:concurrent-futures:1.0.0"
+ implementation "androidx.camera:camera-core:1.0.0-beta01"
+ implementation "androidx.camera:camera-camera2:1.0.0-beta01"
+ implementation "androidx.camera:camera-view:1.0.0-alpha08"
+ implementation "androidx.camera:camera-extensions:1.0.0-alpha08"
+ implementation "androidx.camera:camera-lifecycle:1.0.0-beta01"
+}
+```
+
+Now use Gradle to compile JNI, resolve Java dependencies and build the Android application together with tvm4j. Run following script to generate the apk file.
+
+```bash
+export ANDROID_HOME=[Path to your Android SDK, e.g., ~/Android/sdk]
+cd apps/android_camera
+gradle clean build
+```
+
+In `app/build/outputs/apk` you'll find `app-release-unsigned.apk`, use `dev_tools/gen_keystore.sh` to generate a signature and use `dev_tools/sign_apk.sh` to get the signed apk file `app/build/outputs/apk/release/tv8mdemo-release.apk`.
+
+Upload `tv8mdemo-release.apk` to your Android device and install it:
+
+```bash
+$ANDROID_HOME/platform-tools/adb install app/build/outputs/apk/release/tv8mdemo-release.apk
+```
+
+If you see error:
+
+ adb: failed to install app/build/outputs/apk/release/tv8mdemo-release.apk:
+ Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE:
+ Package ml.apache.tvm.android.androidcamerademo signatures do not match the previously installed version; ignoring!]
+
+Run uninstall first:
+
+```bash
+$ANDROID_HOME/platform-tools/adb uninstall ml.apache.tvm.android.androidcamerademo
+```
diff --git a/apps/android_camera/app/build.gradle b/apps/android_camera/app/build.gradle
index 8a772a3d29f3..c7767559e4df 100644
--- a/apps/android_camera/app/build.gradle
+++ b/apps/android_camera/app/build.gradle
@@ -17,20 +17,47 @@
apply plugin: 'com.android.application'
+task generateJniHeaders(type: Exec, description: 'Generate JNI Headers') {
+ def headerPath = "${project.projectDir}/src/main/jni"
+ def classPath = "${project.projectDir}/../../../jvm/core/target/*"
+ def filePath = "${project.projectDir}/../../../jvm/core/src/main/java/org/apache/tvm/LibInfo.java"
+ commandLine "javac", "-h", headerPath, "-classpath", classPath, filePath
+ doLast {
+ file("${headerPath}/org_apache_tvm_LibInfo.h").renameTo(file("${headerPath}/org_apache_tvm_native_c_api.h"))
+ }
+}
+
+task copyFiles(type: Copy, description: 'Copy Sources for ndk-build') {
+ dependsOn "generateJniHeaders"
+ def ndkFilesPath = "${project.projectDir}/../../../jvm/native/src/main/native"
+ def srcPath = "${project.projectDir}/src/main/jni/"
+
+ from "${ndkFilesPath}/org_apache_tvm_native_c_api.cc", "${ndkFilesPath}/jni_helper_func.h"
+ into srcPath
+}
+
+task deleteLibs(type: Delete, description: "Delete Compiled Libraries") {
+ dependsOn "copyFiles"
+ def libsPath = "${project.projectDir}/src/main/libs"
+ delete libsPath
+}
+
task buildJni(type: Exec, description: 'Build JNI libs') {
- commandLine 'sh', 'src/main/jni/build.sh'
+ dependsOn "deleteLibs"
+ def buildPath = "${project.projectDir}/src/main/jni"
+ commandLine "ndk-build", "--directory", buildPath
}
tasks.withType(JavaCompile) {
- //compileTask -> compileTask.dependsOn buildJni
+ compileTask -> compileTask.dependsOn buildJni
}
android {
- compileSdkVersion 29
+ compileSdkVersion 31
defaultConfig {
applicationId "ml.apache.tvm.android.androidcamerademo"
minSdkVersion 24
- targetSdkVersion 29
+ targetSdkVersion 26
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
versionCode 1
@@ -53,7 +80,10 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
- buildToolsVersion = '29.0.3'
+
+ lintOptions {
+ disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity
+ }
}
dependencies {
@@ -61,13 +91,13 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- implementation 'androidx.appcompat:appcompat:1.1.0'
- implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- implementation 'com.google.android.material:material:1.1.0'
- implementation 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
- testImplementation 'junit:junit:4.13'
+ implementation 'androidx.appcompat:appcompat:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
+ implementation 'com.google.android.material:material:1.5.0'
+ implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar')
+ testImplementation 'junit:junit:4.13.2'
- implementation("androidx.concurrent:concurrent-futures:1.0.0")
+ implementation "androidx.concurrent:concurrent-futures:1.0.0"
implementation "androidx.camera:camera-core:1.0.0-beta01"
implementation "androidx.camera:camera-camera2:1.0.0-beta01"
// If you want to use the CameraX View class
diff --git a/apps/android_camera/app/src/main/AndroidManifest.xml b/apps/android_camera/app/src/main/AndroidManifest.xml
index 0821286d5543..e5b6465c5874 100644
--- a/apps/android_camera/app/src/main/AndroidManifest.xml
+++ b/apps/android_camera/app/src/main/AndroidManifest.xml
@@ -28,7 +28,7 @@
tools:ignore="AllowBackup,MissingApplicationIcon">
diff --git a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java
index 8a5f54a3e399..3a55a62d739c 100644
--- a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java
+++ b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java
@@ -382,7 +382,7 @@ private Bitmap YUV_420_888_toRGB(Image image, int width, int height) {
}
private float[] getFrame(ImageProxy imageProxy) {
- @SuppressLint("UnsafeExperimentalUsageError")
+ @SuppressLint("UnsafeOptInUsageError")
Image image = imageProxy.getImage();
// extract the jpeg content
if (image == null) {
diff --git a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/MainActivity.java b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/MainActivity.java
index f9c573a5d1fe..06b1c9730d05 100644
--- a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/MainActivity.java
+++ b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/MainActivity.java
@@ -78,6 +78,7 @@ private void startFragment() {
@Override
public void onRequestPermissionsResult(
int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (allPermissionsGranted()) {
startFragment();
} else {
diff --git a/apps/android_camera/app/src/main/jni/Android.mk b/apps/android_camera/app/src/main/jni/Android.mk
index a5eacb0c0c2d..4ff3da8f3327 100644
--- a/apps/android_camera/app/src/main/jni/Android.mk
+++ b/apps/android_camera/app/src/main/jni/Android.mk
@@ -34,11 +34,14 @@ endif
include $(config)
LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
+
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog
LOCAL_C_INCLUDES := $(ROOT_PATH)/include \
+ $(ROOT_PATH)/src/runtime/rpc \
$(ROOT_PATH)/3rdparty/dlpack/include \
$(ROOT_PATH)/3rdparty/dmlc-core/include \
+ $(MY_PATH)
LOCAL_MODULE = tvm4j_runtime_packed
diff --git a/apps/android_camera/app/src/main/jni/tvm_runtime.h b/apps/android_camera/app/src/main/jni/tvm_runtime.h
index bed3bc82d5a3..b20227b34db4 100644
--- a/apps/android_camera/app/src/main/jni/tvm_runtime.h
+++ b/apps/android_camera/app/src/main/jni/tvm_runtime.h
@@ -40,11 +40,16 @@
#include "../src/runtime/graph_executor/graph_executor.cc"
#include "../src/runtime/library_module.cc"
#include "../src/runtime/logging.cc"
+#include "../src/runtime/minrpc/minrpc_logger.cc"
#include "../src/runtime/module.cc"
#include "../src/runtime/ndarray.cc"
#include "../src/runtime/object.cc"
+#include "../src/runtime/profiling.cc"
#include "../src/runtime/registry.cc"
+#include "../src/runtime/rpc/rpc_channel.cc"
+#include "../src/runtime/rpc/rpc_endpoint.cc"
#include "../src/runtime/rpc/rpc_event_impl.cc"
+#include "../src/runtime/rpc/rpc_local_session.cc"
#include "../src/runtime/rpc/rpc_module.cc"
#include "../src/runtime/rpc/rpc_server_env.cc"
#include "../src/runtime/rpc/rpc_session.cc"
diff --git a/apps/android_camera/app/src/main/res/layout/listview_row.xml b/apps/android_camera/app/src/main/res/layout/listview_row.xml
index 4c233dc40379..5038a27557e9 100644
--- a/apps/android_camera/app/src/main/res/layout/listview_row.xml
+++ b/apps/android_camera/app/src/main/res/layout/listview_row.xml
@@ -20,7 +20,7 @@
android:id="@+id/listview_row_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginRight="2dp"
+ android:layout_marginEnd="2dp"
android:background="@drawable/item_selector"
android:padding="10dp"
android:textSize="18sp"
diff --git a/apps/android_camera/build.gradle b/apps/android_camera/build.gradle
index a58bc631dac5..1cd5ac9b656f 100644
--- a/apps/android_camera/build.gradle
+++ b/apps/android_camera/build.gradle
@@ -19,14 +19,14 @@
buildscript {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
url 'https://maven.google.com'
}
- google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.6.1'
+ classpath 'com.android.tools.build:gradle:7.1.2'
+
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -34,16 +34,15 @@ buildscript {
allprojects {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
- url 'https://maven.google.com'
+ url 'https://maven.google.com'
}
mavenLocal()
mavenCentral()
- google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
-}
\ No newline at end of file
+}
diff --git a/apps/android_camera/gradle.properties b/apps/android_camera/gradle.properties
index f1328bf5fd43..1add1b540993 100644
--- a/apps/android_camera/gradle.properties
+++ b/apps/android_camera/gradle.properties
@@ -1,4 +1,3 @@
-
# 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
diff --git a/apps/android_camera/models/prepare_model.py b/apps/android_camera/models/prepare_model.py
index 2ea1b0a120af..959e93f8b47b 100644
--- a/apps/android_camera/models/prepare_model.py
+++ b/apps/android_camera/models/prepare_model.py
@@ -106,7 +106,7 @@ def main(model_str, output_path):
f.write(graph)
print("dumping params...")
with open(output_path_str + "/" + "deploy_param.params", "wb") as f:
- f.write(runtime.save_param_dict(params))
+ f.write(tvm.runtime.save_param_dict(params))
print("dumping labels...")
synset_url = "".join(
[
diff --git a/apps/android_camera/models/requirements.txt b/apps/android_camera/models/requirements.txt
new file mode 100644
index 000000000000..98aa53def46f
--- /dev/null
+++ b/apps/android_camera/models/requirements.txt
@@ -0,0 +1,4 @@
+keras
+mxnet
+scipy
+tensorflow
\ No newline at end of file
diff --git a/apps/android_deploy/app/build.gradle b/apps/android_deploy/app/build.gradle
index c00528ba49fd..2949775349bb 100644
--- a/apps/android_deploy/app/build.gradle
+++ b/apps/android_deploy/app/build.gradle
@@ -26,8 +26,35 @@ apply from: "download-models.gradle"
apply plugin: 'com.android.application'
+task generateJniHeaders(type: Exec, description: 'Generate JNI Headers') {
+ def headerPath = "${project.projectDir}/src/main/jni"
+ def classPath = "${project.projectDir}/../../../jvm/core/target/*"
+ def filePath = "${project.projectDir}/../../../jvm/core/src/main/java/org/apache/tvm/LibInfo.java"
+ commandLine "javac", "-h", headerPath, "-classpath", classPath, filePath
+ doLast {
+ file("${headerPath}/org_apache_tvm_LibInfo.h").renameTo(file("${headerPath}/org_apache_tvm_native_c_api.h"))
+ }
+}
+
+task copyFiles(type: Copy, description: 'Copy Sources for ndk-build') {
+ dependsOn "generateJniHeaders"
+ def ndkFilesPath = "${project.projectDir}/../../../jvm/native/src/main/native"
+ def srcPath = "${project.projectDir}/src/main/jni/"
+
+ from "${ndkFilesPath}/org_apache_tvm_native_c_api.cc", "${ndkFilesPath}/jni_helper_func.h"
+ into srcPath
+}
+
+task deleteLibs(type: Delete, description: "Delete Compiled Libraries") {
+ dependsOn "copyFiles"
+ def libsPath = "${project.projectDir}/src/main/libs"
+ delete libsPath
+}
+
task buildJni(type: Exec, description: 'Build JNI libs') {
- commandLine 'sh', 'src/main/jni/build.sh'
+ dependsOn "deleteLibs"
+ def buildPath = "${project.projectDir}/src/main/jni"
+ commandLine "ndk-build", "--directory", buildPath
}
tasks.withType(JavaCompile) {
@@ -35,11 +62,10 @@ tasks.withType(JavaCompile) {
}
android {
- compileSdkVersion 26
- buildToolsVersion "26.0.1"
+ compileSdkVersion 31
defaultConfig {
applicationId "org.apache.tvm.android.demo"
- minSdkVersion 17
+ minSdkVersion 24
targetSdkVersion 26
versionCode 1
versionName "1.0"
@@ -55,19 +81,24 @@ android {
main {
jni.srcDirs = []
jniLibs.srcDirs = ['src/main/libs']
- assets.srcDirs = [project.ext.ASSET_DIR]
}
}
+
+ lintOptions {
+ disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity
+ disable "MissingApplicationIcon" // Should explicitly set android:icon, there is no default
+ disable "UnsafeNativeCodeLocation" // Shared libraries should not be placed in the res or assets directories.
+ }
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- compile 'com.android.support:appcompat-v7:26.0.1'
- compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile 'com.android.support:design:26.0.1'
- compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
- testCompile 'junit:junit:4.12'
-}
+ implementation 'androidx.appcompat:appcompat:1.4.1'
+ implementation 'com.android.support.constraint:constraint-layout:2.1.3'
+ implementation 'com.android.support:design:28.0.0'
+ implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar')
+ testImplementation 'junit:junit:4.13.2'
+}
\ No newline at end of file
diff --git a/apps/android_deploy/app/download-models.gradle b/apps/android_deploy/app/download-models.gradle
index ed660e0221ee..4d1620bfd953 100644
--- a/apps/android_deploy/app/download-models.gradle
+++ b/apps/android_deploy/app/download-models.gradle
@@ -34,7 +34,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'de.undercouch:gradle-download-task:3.2.0'
+ classpath 'de.undercouch:gradle-download-task:5.0.4'
}
}
diff --git a/apps/android_deploy/app/src/main/AndroidManifest.xml b/apps/android_deploy/app/src/main/AndroidManifest.xml
index bf3463f4d9c6..ce1b1fac4552 100644
--- a/apps/android_deploy/app/src/main/AndroidManifest.xml
+++ b/apps/android_deploy/app/src/main/AndroidManifest.xml
@@ -25,6 +25,7 @@ under the License.
+
+ android:exported="true"
+ android:screenOrientation="unspecified">
@@ -52,6 +53,4 @@ under the License.
-
-
diff --git a/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java b/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java
index 85cc7a277b4d..6320b6aa8afd 100644
--- a/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java
+++ b/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java
@@ -35,9 +35,9 @@
import android.os.Environment;
import android.os.SystemClock;
import android.provider.MediaStore;
-import android.support.v4.content.FileProvider;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.Toolbar;
+import androidx.core.content.FileProvider;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
@@ -51,6 +51,7 @@
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Locale;
import java.util.Vector;
import org.apache.tvm.Function;
@@ -487,7 +488,7 @@ private final String getTempLibFilePath(String fileName) throws IOException {
*/
private File createImageFile() {
// Create an image file name
- String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+ String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES);
@@ -527,6 +528,7 @@ public void onClick(DialogInterface dialog, int id) {
@Override
public void onRequestPermissionsResult (final int requestCode, final String[] permissions, final int[] grantResults){
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSIONS_REQUEST) {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED
diff --git a/apps/android_deploy/app/src/main/res/layout/activity_main.xml b/apps/android_deploy/app/src/main/res/layout/activity_main.xml
index 0778374223d8..4b019e1fbdb3 100644
--- a/apps/android_deploy/app/src/main/res/layout/activity_main.xml
+++ b/apps/android_deploy/app/src/main/res/layout/activity_main.xml
@@ -19,29 +19,28 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
+ android:layout_height="match_parent"
+ tools:context="org.apache.tvm.tvmrpc.MainActivity">
-
+ android:theme="@style/AppTheme.AppBarOverlay">
-
+
-
+
-
+
+
diff --git a/apps/android_deploy/app/src/main/res/layout/content_main.xml b/apps/android_deploy/app/src/main/res/layout/content_main.xml
index aa1b0ea72b3e..6bf3c19f7f81 100644
--- a/apps/android_deploy/app/src/main/res/layout/content_main.xml
+++ b/apps/android_deploy/app/src/main/res/layout/content_main.xml
@@ -35,10 +35,10 @@ under the License.
+ android:text="@string/btnPickImage_text" />
+ android:layout_weight="1"
+ android:contentDescription="@string/image_description"/>
TVM Android Demo
+ Select or Capture Picture
+ Input Image
diff --git a/apps/android_deploy/build.gradle b/apps/android_deploy/build.gradle
index fc98e3479fe7..35d20c9b3692 100644
--- a/apps/android_deploy/build.gradle
+++ b/apps/android_deploy/build.gradle
@@ -19,14 +19,14 @@
buildscript {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
url 'https://maven.google.com'
}
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.0'
- classpath 'org.apache.httpcomponents:httpclient:4.5.4'
+ classpath 'com.android.tools.build:gradle:7.1.2'
+ classpath 'org.apache.httpcomponents:httpclient:4.5.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -35,7 +35,7 @@ buildscript {
allprojects {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
url 'https://maven.google.com'
}
diff --git a/apps/android_deploy/gradle.properties b/apps/android_deploy/gradle.properties
index 5d2b9cef0728..972e391a31ea 100644
--- a/apps/android_deploy/gradle.properties
+++ b/apps/android_deploy/gradle.properties
@@ -16,3 +16,5 @@
# under the License.
org.gradle.jvmargs=-Xmx4096M
+android.useAndroidX=true
+android.enableJetifier=true
\ No newline at end of file
diff --git a/apps/android_rpc/README.md b/apps/android_rpc/README.md
index c5e21ecbbc12..2e301af6d996 100644
--- a/apps/android_rpc/README.md
+++ b/apps/android_rpc/README.md
@@ -32,15 +32,15 @@ Before you build the Android application, please refer to [TVM4J Installation Gu
```
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- compile 'com.android.support:appcompat-v7:26.0.1'
- compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile 'com.android.support:design:26.0.1'
- compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
- testCompile 'junit:junit:4.12'
+ implementation 'androidx.appcompat:appcompat:1.4.1'
+ implementation 'com.android.support.constraint:constraint-layout:2.1.3'
+ implementation 'com.android.support:design:28.0.0'
+ implementation 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ testImplementation 'junit:junit:4.13.2'
}
```
diff --git a/apps/android_rpc/app/build.gradle b/apps/android_rpc/app/build.gradle
index 747809317cb3..14d4a7bb9a61 100644
--- a/apps/android_rpc/app/build.gradle
+++ b/apps/android_rpc/app/build.gradle
@@ -17,17 +17,49 @@
apply plugin: 'com.android.application'
+task generateJniHeaders(type: Exec, description: 'Generate JNI Headers') {
+ def headerPath = "${project.projectDir}/src/main/jni"
+ def classPath = "${project.projectDir}/../../../jvm/core/target/*"
+ def filePath = "${project.projectDir}/../../../jvm/core/src/main/java/org/apache/tvm/LibInfo.java"
+ commandLine "javac", "-h", headerPath, "-classpath", classPath, filePath
+ doLast {
+ file("${headerPath}/org_apache_tvm_LibInfo.h").renameTo(file("${headerPath}/org_apache_tvm_native_c_api.h"))
+ }
+}
+
+task copyFiles(type: Copy, description: 'Copy Sources for ndk-build') {
+ dependsOn "generateJniHeaders"
+ def ndkFilesPath = "${project.projectDir}/../../../jvm/native/src/main/native"
+ def srcPath = "${project.projectDir}/src/main/jni/"
+
+ from "${ndkFilesPath}/org_apache_tvm_native_c_api.cc", "${ndkFilesPath}/jni_helper_func.h"
+ into srcPath
+}
+
+task deleteLibs(type: Delete, description: "Delete Compiled Libraries") {
+ dependsOn "copyFiles"
+ def libsPath = "${project.projectDir}/src/main/libs"
+ delete libsPath
+}
+
task buildJni(type: Exec, description: 'Build JNI libs') {
- commandLine 'sh', 'src/main/jni/build.sh'
+ dependsOn "deleteLibs"
+ def buildPath = "${project.projectDir}/src/main/jni"
+ commandLine "ndk-build", "--directory", buildPath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildJni
}
+// gradle.projectsEvaluated {
+// tasks.withType(JavaCompile) {
+// options.compilerArgs << "-Xlint:deprecation"
+// }
+// }
+
android {
- compileSdkVersion 26
- buildToolsVersion "26.0.1"
+ compileSdkVersion 31
defaultConfig {
applicationId "org.apache.tvm.tvmrpc"
minSdkVersion 24
@@ -48,16 +80,22 @@ android {
jniLibs.srcDirs = ['src/main/libs']
}
}
+
+ lintOptions {
+ disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity
+ disable "MissingClass" // .RPCWatchdogService was not found in the project or the libraries
+ disable "IconDipSize" // The image ic_launcher.png varies significantly in its density-independent size
+ }
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- compile 'com.android.support:appcompat-v7:26.0.1'
- compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile 'com.android.support:design:26.0.1'
- compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
- testCompile 'junit:junit:4.12'
+ implementation 'androidx.appcompat:appcompat:1.4.1'
+ implementation 'com.android.support.constraint:constraint-layout:2.1.3'
+ implementation 'com.android.support:design:28.0.0'
+ implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar')
+ testImplementation 'junit:junit:4.13.2'
}
diff --git a/apps/android_rpc/app/src/main/AndroidManifest.xml b/apps/android_rpc/app/src/main/AndroidManifest.xml
index d6e1ef8e63ed..217dbb859a76 100644
--- a/apps/android_rpc/app/src/main/AndroidManifest.xml
+++ b/apps/android_rpc/app/src/main/AndroidManifest.xml
@@ -29,12 +29,12 @@ under the License.
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
- android:icon="@mipmap/ic_launcher" >
+ android:icon="@mipmap/ic_launcher">
+ android:screenOrientation="unspecified"
+ android:exported="true">
@@ -48,7 +48,7 @@ under the License.
android:process=":RPCProcess"
android:label="@string/rpc_name"
android:theme="@style/AppTheme.NoActionBar"
- android:screenOrientation="portrait">
+ android:screenOrientation="unspecified">
diff --git a/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java b/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java
index 35105df92b0d..f28507b46f8e 100644
--- a/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java
+++ b/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java
@@ -23,12 +23,13 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
+import android.os.Looper;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.Toolbar;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
import android.widget.CompoundButton;
import android.widget.EditText;
-import android.widget.Switch;
+import androidx.appcompat.widget.SwitchCompat;
import android.content.Intent;
@@ -55,7 +56,7 @@ public Intent updateRPCPrefs() {
EditText edProxyAddress = findViewById(R.id.input_address);
EditText edProxyPort = findViewById(R.id.input_port);
EditText edAppKey = findViewById(R.id.input_key);
- Switch inputSwitch = findViewById(R.id.switch_persistent);
+ SwitchCompat inputSwitch = findViewById(R.id.switch_persistent);
final String proxyHost = edProxyAddress.getText().toString();
final int proxyPort = Integer.parseInt(edProxyPort.getText().toString());
@@ -79,7 +80,7 @@ public Intent updateRPCPrefs() {
private void setupRelaunch() {
final Context context = this;
- final Switch switchPersistent = findViewById(R.id.switch_persistent);
+ final SwitchCompat switchPersistent = findViewById(R.id.switch_persistent);
final Runnable rPCStarter = new Runnable() {
public void run() {
if (switchPersistent.isChecked()) {
@@ -89,7 +90,8 @@ public void run() {
}
}
};
- Handler handler = new Handler();
+
+ Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(rPCStarter, HANDLER_RESTART_DELAY);
}
@@ -101,7 +103,7 @@ protected void onCreate(Bundle savedInstanceState) {
setSupportActionBar(toolbar);
final Context context = this;
- Switch switchPersistent = findViewById(R.id.switch_persistent);
+ SwitchCompat switchPersistent = findViewById(R.id.switch_persistent);
switchPersistent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -136,7 +138,7 @@ private void enableInputView(boolean enable) {
EditText edProxyAddress = findViewById(R.id.input_address);
EditText edProxyPort = findViewById(R.id.input_port);
EditText edAppKey = findViewById(R.id.input_key);
- Switch input_switch = findViewById(R.id.switch_persistent);
+ SwitchCompat input_switch = findViewById(R.id.switch_persistent);
edProxyAddress.setEnabled(enable);
edProxyPort.setEnabled(enable);
edAppKey.setEnabled(enable);
diff --git a/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCActivity.java b/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCActivity.java
index 0d7f04782d3a..1481c854f966 100644
--- a/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCActivity.java
+++ b/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCActivity.java
@@ -18,7 +18,7 @@
package org.apache.tvm.tvmrpc;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
+import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.widget.Button;
import android.view.View;
diff --git a/apps/android_rpc/app/src/main/jni/build.sh b/apps/android_rpc/app/src/main/jni/build.sh
deleted file mode 100755
index 001d206ffd5d..000000000000
--- a/apps/android_rpc/app/src/main/jni/build.sh
+++ /dev/null
@@ -1,26 +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.
-PATH="$PATH:/usr/local/bin"
-CURR_DIR=$(cd `dirname $0`; pwd)
-ROOT_DIR="$CURR_DIR/../../../../../.."
-javac -h $CURR_DIR -classpath "$ROOT_DIR/jvm/core/target/*" $ROOT_DIR/jvm/core/src/main/java/org/apache/tvm/LibInfo.java || exit -1
-mv $CURR_DIR/org_apache_tvm_LibInfo.h $CURR_DIR/org_apache_tvm_native_c_api.h
-cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
-cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
-rm -rf $CURR_DIR/../libs
-ndk-build --directory=$CURR_DIR
diff --git a/apps/android_rpc/app/src/main/jni/tvm_runtime.h b/apps/android_rpc/app/src/main/jni/tvm_runtime.h
index 1dd37f1c5345..95b793a985d1 100644
--- a/apps/android_rpc/app/src/main/jni/tvm_runtime.h
+++ b/apps/android_rpc/app/src/main/jni/tvm_runtime.h
@@ -42,6 +42,7 @@
#include "../src/runtime/graph_executor/graph_executor_factory.cc"
#include "../src/runtime/library_module.cc"
#include "../src/runtime/logging.cc"
+#include "../src/runtime/minrpc/minrpc_logger.cc"
#include "../src/runtime/module.cc"
#include "../src/runtime/ndarray.cc"
#include "../src/runtime/object.cc"
diff --git a/apps/android_rpc/app/src/main/res/layout/activity_main.xml b/apps/android_rpc/app/src/main/res/layout/activity_main.xml
index f5cad5443cd1..f317a1cb7988 100644
--- a/apps/android_rpc/app/src/main/res/layout/activity_main.xml
+++ b/apps/android_rpc/app/src/main/res/layout/activity_main.xml
@@ -19,7 +19,7 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
-
+
-
+
diff --git a/apps/android_rpc/app/src/main/res/layout/activity_rpc.xml b/apps/android_rpc/app/src/main/res/layout/activity_rpc.xml
index 7e282b5a02f3..9c586e0cc0c7 100644
--- a/apps/android_rpc/app/src/main/res/layout/activity_rpc.xml
+++ b/apps/android_rpc/app/src/main/res/layout/activity_rpc.xml
@@ -19,7 +19,7 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
-
+
-
+
diff --git a/apps/android_rpc/app/src/main/res/layout/content_main.xml b/apps/android_rpc/app/src/main/res/layout/content_main.xml
index d6eff2b06383..483f60a72170 100644
--- a/apps/android_rpc/app/src/main/res/layout/content_main.xml
+++ b/apps/android_rpc/app/src/main/res/layout/content_main.xml
@@ -38,6 +38,7 @@ under the License.
-
+
diff --git a/apps/android_rpc/app/src/main/res/values/strings.xml b/apps/android_rpc/app/src/main/res/values/strings.xml
index 72c19cd4e5b0..960e5a3b92a7 100644
--- a/apps/android_rpc/app/src/main/res/values/strings.xml
+++ b/apps/android_rpc/app/src/main/res/values/strings.xml
@@ -31,6 +31,11 @@ under the License.
Key
Enable RPC
+ 192.168.1.1
+ 9190
+ android
+
+
Enabled
Disabled
diff --git a/apps/android_rpc/build.gradle b/apps/android_rpc/build.gradle
index be00a5e5213e..1cd5ac9b656f 100644
--- a/apps/android_rpc/build.gradle
+++ b/apps/android_rpc/build.gradle
@@ -19,13 +19,13 @@
buildscript {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
url 'https://maven.google.com'
}
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.0'
+ classpath 'com.android.tools.build:gradle:7.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -34,7 +34,7 @@ buildscript {
allprojects {
repositories {
- jcenter()
+ gradlePluginPortal()
maven {
url 'https://maven.google.com'
}
diff --git a/apps/android_deploy/app/src/main/jni/build.sh b/apps/android_rpc/gradle.properties
similarity index 54%
rename from apps/android_deploy/app/src/main/jni/build.sh
rename to apps/android_rpc/gradle.properties
index 001d206ffd5d..97b133967be2 100644
--- a/apps/android_deploy/app/src/main/jni/build.sh
+++ b/apps/android_rpc/gradle.properties
@@ -1,4 +1,3 @@
-#!/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
@@ -6,21 +5,15 @@
# 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
-#
+#
+# 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.
-PATH="$PATH:/usr/local/bin"
-CURR_DIR=$(cd `dirname $0`; pwd)
-ROOT_DIR="$CURR_DIR/../../../../../.."
-javac -h $CURR_DIR -classpath "$ROOT_DIR/jvm/core/target/*" $ROOT_DIR/jvm/core/src/main/java/org/apache/tvm/LibInfo.java || exit -1
-mv $CURR_DIR/org_apache_tvm_LibInfo.h $CURR_DIR/org_apache_tvm_native_c_api.h
-cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
-cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
-rm -rf $CURR_DIR/../libs
-ndk-build --directory=$CURR_DIR
+
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/include/tvm/runtime/c_runtime_api.h b/include/tvm/runtime/c_runtime_api.h
index f9f002945f85..085935101cd2 100644
--- a/include/tvm/runtime/c_runtime_api.h
+++ b/include/tvm/runtime/c_runtime_api.h
@@ -76,18 +76,6 @@ extern "C" {
#endif
#include
#include
-#include
-#include
-
-#if defined(_MSC_VER)
-#if defined(_WIN64)
-typedef int64_t tvm_ssize_t;
-#else
-typedef int32_t tvm_ssize_t;
-#endif
-#else
-typedef ssize_t tvm_ssize_t;
-#endif
/*! \brief type of array index. */
typedef int64_t tvm_index_t;
diff --git a/jenkins/Build.groovy.j2 b/jenkins/Build.groovy.j2
index c1715949175b..a0ccfde4729e 100644
--- a/jenkins/Build.groovy.j2
+++ b/jenkins/Build.groovy.j2
@@ -43,6 +43,15 @@ def add_microtvm_permissions() {
{% endfor %}
}
+def add_hexagon_permissions() {
+ {% for folder in hexagon_api %}
+ sh(
+ script: 'find {{ folder }} -type f | xargs chmod +x',
+ label: 'Add execute permissions for hexagon files',
+ )
+ {% endfor %}
+}
+
def build() {
stage('Build') {
environment {
@@ -174,7 +183,11 @@ stage('Build') {
label: 'Create Hexagon cmake config',
)
make(ci_hexagon, 'build', '-j2')
- {{ m.upload_artifacts(tag='hexagon', filenames=tvm_lib) }}
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
+ label: 'Build Hexagon API',
+ )
+ {{ m.upload_artifacts(tag='hexagon', filenames=tvm_lib, folders=hexagon_api) }}
}
}
} else {
diff --git a/jenkins/Jenkinsfile.j2 b/jenkins/Jenkinsfile.j2
index a1127ec6a8d5..c165de964feb 100644
--- a/jenkins/Jenkinsfile.j2
+++ b/jenkins/Jenkinsfile.j2
@@ -97,6 +97,7 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
{% set tvm_multilib = ['build/libtvm.so', 'build/libvta_fsim.so'] + tvm_runtime %}
{% set tvm_multilib_tsim = ['build/libvta_tsim.so'] + tvm_multilib %}
{% set microtvm_template_projects = ['build/microtvm_template_projects',] %}
+{% set hexagon_api = ['build/hexagon_api_output',] %}
s3_prefix = "tvm-jenkins-artifacts-prod/tvm/${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
// General note: Jenkins has limits on the size of a method (or top level code)
diff --git a/jenkins/Test.groovy.j2 b/jenkins/Test.groovy.j2
index b287c2a3156e..7339625b69ff 100644
--- a/jenkins/Test.groovy.j2
+++ b/jenkins/Test.groovy.j2
@@ -1,56 +1,190 @@
+{% set test_method_names = [] %}
+
+// We have to do this whacky split of the code from where it's used since the
+// JVM limits method length to 64k and we easily exceed that with all this
+// autogenerated code. This makes it so each test step is in its own method so
+// that each individual method isn't too big.
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="unittest: GPU",
+ num_shards=3,
+ node="GPU",
+ ws="tvm/ut-python-gpu",
+ platform="gpu",
+ test_method_names=test_method_names,
+) %}
+ {% if shard_index == 1 %}
+ {{ m.download_artifacts(tag='gpu2', filenames=tvm_multilib) }}
+ cpp_unittest(ci_gpu)
+
+ {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
+ ci_setup(ci_gpu)
+ cpp_unittest(ci_gpu)
+ {% else %}
+ {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
+ ci_setup(ci_gpu)
+ {% endif %}
+ {% if shard_index == 2 or num_shards < 2 %}
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",
+ label: 'Run Java unit tests',
+ )
+ {% endif %}
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
+ label: 'Run Python GPU unit tests',
+ )
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
+ label: 'Run Python GPU integration tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="integration: CPU",
+ node="CPU-SMALL",
+ num_shards=6,
+ ws="tvm/integration-python-cpu",
+ platform="cpu",
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='cpu', filenames=tvm_multilib_tsim) }}
+ ci_setup(ci_cpu)
+ sh (
+ script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="python: i386",
+ node="CPU-SMALL",
+ num_shards=5,
+ ws="tvm/integration-python-i386",
+ platform="i386",
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='i386', filenames=tvm_multilib) }}
+ ci_setup(ci_i386)
+ {% if shard_index == 1 %}
+ cpp_unittest(ci_i386)
+ {% endif %}
+ python_unittest(ci_i386)
+ sh (
+ script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
+ label: 'Run i386 integration tests',
+ )
+ fsim_test(ci_i386)
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="test: Hexagon",
+ node="CPU-SMALL",
+ ws="tvm/test-hexagon",
+ platform="hexagon",
+ test_method_names=test_method_names,
+ num_shards=7,
+) %}
+ {{ m.download_artifacts(tag='hexagon', filenames=tvm_lib, folders=hexagon_api) }}
+ add_hexagon_permissions()
+ ci_setup(ci_hexagon)
+ {% if shard_index == 1 %}
+ cpp_unittest(ci_hexagon)
+ {% endif %}
+ sh (
+ script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
+ label: 'Run Hexagon tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="integration: aarch64",
+ num_shards=4,
+ node="ARM", ws="tvm/ut-python-arm",
+ platform="arm",
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
+ ci_setup(ci_arm)
+ python_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
+ label: 'Run CPU integration tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="topi: GPU",
+ node="GPU",
+ num_shards=4,
+ ws="tvm/topi-python-gpu",
+ platform="gpu",
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="frontend: GPU",
+ node="GPU",
+ num_shards=6,
+ ws="tvm/frontend-python-gpu",
+ platform="gpu",
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
+ ci_setup(ci_gpu)
+ sh (
+ script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
+ label: 'Run Python frontend tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="topi: aarch64",
+ node="ARM",
+ ws="tvm/ut-python-arm",
+ platform="arm",
+ num_shards=2,
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
+ ci_setup(ci_arm)
+ cpp_unittest(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
+ label: 'Run test_arm_compute_lib test',
+ )
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
+ label: 'Run TOPI tests',
+ )
+{% endcall %}
+{% call(shard_index, num_shards) m.sharded_test_step(
+ name="frontend: aarch64",
+ node="ARM",
+ ws="tvm/frontend-python-arm",
+ platform="arm",
+ num_shards=2,
+ test_method_names=test_method_names,
+) %}
+ {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
+ ci_setup(ci_arm)
+ sh (
+ script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh",
+ label: 'Run Python frontend tests',
+ )
+{% endcall %}
+
+
def test() {
stage('Test') {
environment {
SKIP_SLOW_TESTS = "${skip_slow_tests}"
}
parallel(
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="unittest: GPU",
- num_shards=2,
- node="GPU",
- ws="tvm/ut-python-gpu",
- platform="gpu",
- ) %}
- {% if shard_index == 1 %}
- {{ m.download_artifacts(tag='gpu2', filenames=tvm_multilib) }}
- cpp_unittest(ci_gpu)
-
- {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
- ci_setup(ci_gpu)
- cpp_unittest(ci_gpu)
- {% else %}
- {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
- ci_setup(ci_gpu)
- {% endif %}
- {% if shard_index == 2 or num_shards < 2 %}
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",
- label: 'Run Java unit tests',
- )
- {% endif %}
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
- label: 'Run Python GPU unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
- label: 'Run Python GPU integration tests',
- )
- {% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="integration: CPU",
- node="CPU",
- num_shards=2,
- ws="tvm/integration-python-cpu",
- platform="cpu",
- ) %}
- {{ m.download_artifacts(tag='cpu', filenames=tvm_multilib_tsim) }}
- ci_setup(ci_cpu)
- sh (
- script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- {% endcall %}
+ {% for stage_name, method_name in test_method_names %}
+ '{{ stage_name }}': {
+ {{ method_name }}()
+ },
+ {% endfor %}
{% call m.test_step(
name="unittest: CPU",
node="CPU-SMALL",
@@ -67,46 +201,6 @@ stage('Test') {
label: 'Run VTA tests in TSIM',
)
{% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="python: i386",
- node="CPU-SMALL",
- num_shards=3,
- ws="tvm/integration-python-i386",
- platform="i386",
- ) %}
- {{ m.download_artifacts(tag='i386', filenames=tvm_multilib) }}
- ci_setup(ci_i386)
- {% if shard_index == 1 %}
- cpp_unittest(ci_i386)
- {% endif %}
- python_unittest(ci_i386)
- sh (
- script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
- label: 'Run i386 integration tests',
- )
- fsim_test(ci_i386)
- {% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="test: Hexagon",
- node="CPU-SMALL",
- ws="tvm/test-hexagon",
- platform="hexagon",
- num_shards=4,
- ) %}
- {{ m.download_artifacts(tag='hexagon', filenames=tvm_lib) }}
- ci_setup(ci_hexagon)
- {% if shard_index == 1 %}
- cpp_unittest(ci_hexagon)
- {% endif %}
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
- label: 'Build Hexagon API',
- )
- sh (
- script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
- label: 'Run Hexagon tests',
- )
- {% endcall %}
{% call m.test_step(
name="test: QEMU",
node="CPU-SMALL",
@@ -126,68 +220,9 @@ stage('Test') {
label: 'Run microTVM demos',
)
{% endcall %}
- {% call m.test_step(
- name="topi: aarch64",
- node="ARM",
- ws="tvm/ut-python-arm",
- platform="arm",
-) %}
- {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
- ci_setup(ci_arm)
- cpp_unittest(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
- label: 'Run test_arm_compute_lib test',
- )
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
- label: 'Run TOPI tests',
- )
- {% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="integration: aarch64",
- num_shards=2,
- node="ARM", ws="tvm/ut-python-arm",
- platform="arm",
- ) %}
- {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
- ci_setup(ci_arm)
- python_unittest(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh",
- label: 'Run CPU integration tests',
- )
- {% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="topi: GPU",
- node="GPU",
- num_shards=2,
- ws="tvm/topi-python-gpu",
- platform="gpu",
- ) %}
- {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
- label: 'Run TOPI tests',
- )
- {% endcall %}
- {% call(shard_index, num_shards) m.sharded_test_step(
- name="frontend: GPU", node="GPU",
- num_shards=3,
- ws="tvm/frontend-python-gpu",
- platform="gpu",
- ) %}
- {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
- label: 'Run Python frontend tests',
- )
- {% endcall %}
{% call m.test_step(
name="frontend: CPU",
- node="CPU",
+ node="CPU-SMALL",
ws="tvm/frontend-python-cpu",
platform="cpu",
) %}
@@ -198,19 +233,6 @@ stage('Test') {
label: 'Run Python frontend tests',
)
{% endcall %}
- {% call m.test_step(
- name="frontend: aarch64",
- node="ARM",
- ws="tvm/frontend-python-arm",
- platform="arm",
-) %}
- {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }}
- ci_setup(ci_arm)
- sh (
- script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh",
- label: 'Run Python frontend tests',
- )
- {% endcall %}
'docs: GPU': {
if (!skip_ci) {
node('GPU') {
diff --git a/jenkins/macros.j2 b/jenkins/macros.j2
index ce29aa2d580d..1c649e31fabf 100644
--- a/jenkins/macros.j2
+++ b/jenkins/macros.j2
@@ -19,31 +19,35 @@
"workspace/exec_${env.EXECUTOR_NUMBER}/{{ folder }}"
{%- endmacro -%}
-{% macro sharded_test_step(name, num_shards, node, ws, platform) %}
+{% macro sharded_test_step(name, num_shards, node, ws, platform, test_method_names) %}
+
{% for shard_index in range(1, num_shards + 1) %}
- '{{ name }} {{ shard_index }} of {{ num_shards }}': {
- if (!skip_ci && is_docs_only_build != 1) {
- node('{{ node }}') {
- ws({{ per_exec_ws(ws) }}) {
- try {
- init_git()
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM={{ platform }}',
- 'TVM_NUM_SHARDS={{ num_shards }}',
- 'TVM_SHARD_INDEX={{ shard_index - 1 }}'], {
- {{ caller(shard_index, num_shards) | trim | indent(width=12) }}
- })
- }
- } finally {
- junit 'build/pytest-results/*.xml'
+{% set method_name = "shard_run_" + name.replace(":", "").replace(" ", "-").replace("-", "_") + "_" + shard_index|string + "_of_" + num_shards|string %}
+def {{ method_name }}() {
+ if (!skip_ci && is_docs_only_build != 1) {
+ node('{{ node }}') {
+ ws({{ per_exec_ws(ws) }}) {
+ try {
+ init_git()
+ timeout(time: max_time, unit: 'MINUTES') {
+ withEnv([
+ 'PLATFORM={{ platform }}',
+ 'TVM_NUM_SHARDS={{ num_shards }}',
+ 'TVM_SHARD_INDEX={{ shard_index - 1 }}'], {
+ {{ caller(shard_index, num_shards) | trim | indent(width=12) }}
+ })
}
+ } finally {
+ junit 'build/pytest-results/*.xml'
}
}
- } else {
- Utils.markStageSkippedForConditional('{{ name }} {{ shard_index }} of {{ num_shards }}')
}
- },
+ } else {
+ Utils.markStageSkippedForConditional('{{ name }} {{ shard_index }} of {{ num_shards }}')
+ }
+}
+{% set _ = test_method_names.append((name + " " + shard_index|string + " of " + num_shards|string, method_name)) %}
+
{% endfor %}
{% endmacro %}
diff --git a/python/tvm/tir/schedule/_type_checker.py b/python/tvm/tir/schedule/_type_checker.py
index 21ca0c5a922b..2dc8ff9d58a1 100644
--- a/python/tvm/tir/schedule/_type_checker.py
+++ b/python/tvm/tir/schedule/_type_checker.py
@@ -196,7 +196,7 @@ def _type_check_union(v: Any, name: str, *types: Any) -> Optional[str]:
error_msg = _type_check(v, name, type_)
if error_msg is None:
return None
- return _type_check_err(v, name, types)
+ return _type_check_err(v, name, Union[types])
return {
"none": _type_check_none,
diff --git a/src/arith/bound_deducer.cc b/src/arith/bound_deducer.cc
index 9275ec1bc394..ba6b11dbb71b 100644
--- a/src/arith/bound_deducer.cc
+++ b/src/arith/bound_deducer.cc
@@ -71,7 +71,7 @@ std::vector GetPath(PrimExpr target, PrimExpr expr) {
enum CompareOp { kGreater, kLess, kEqual };
// a visitor to deduce the bound of a variable from a expression
-class BoundDeducer : public ExprVisitor {
+class BoundDeducer : public ExprFunctor {
public:
friend class BoundDeduceInputChecker;
friend class Converter;
@@ -85,20 +85,16 @@ class BoundDeducer : public ExprVisitor {
void VisitExpr(const PrimExpr& e) final {
if (!success_) return;
if (iter_ < path_.size() && e.get() == path_[iter_++]) {
- ExprVisitor::VisitExpr(e);
+ ExprFunctor::VisitExpr(e);
} else {
success_ = false;
return;
}
}
- void VisitExpr_(const LTNode* op) final { success_ = false; }
+ void VisitExprDefault_(const Object* op) final { success_ = false; }
- void VisitExpr_(const LENode* op) final { success_ = false; }
-
- void VisitExpr_(const GTNode* op) final { success_ = false; }
-
- void VisitExpr_(const GENode* op) final { success_ = false; }
+ void VisitExpr_(const VarNode* op) final {}
void VisitExpr_(const AddNode* op) final {
bool left = op->a.get() == path_[iter_];
diff --git a/src/runtime/minrpc/minrpc_server.h b/src/runtime/minrpc/minrpc_server.h
index ae50f16f33fe..4684aa0e1616 100644
--- a/src/runtime/minrpc/minrpc_server.h
+++ b/src/runtime/minrpc/minrpc_server.h
@@ -150,7 +150,7 @@ class MinRPCReturns : public MinRPCReturnInterface {
const uint8_t* buf = static_cast(data);
size_t ndone = 0;
while (ndone < size) {
- tvm_ssize_t ret = io_->PosixWrite(buf, size - ndone);
+ ssize_t ret = io_->PosixWrite(buf, size - ndone);
if (ret <= 0) {
this->ThrowError(RPCServerStatus::kWriteError);
}
@@ -526,7 +526,7 @@ class MinRPCExecute : public MinRPCExecInterface {
uint8_t* buf = static_cast(data);
size_t ndone = 0;
while (ndone < size) {
- tvm_ssize_t ret = io_->PosixRead(buf, size - ndone);
+ ssize_t ret = io_->PosixRead(buf, size - ndone);
if (ret <= 0) return ret;
ndone += ret;
buf += ret;
@@ -757,7 +757,7 @@ class MinRPCServer {
uint8_t* buf = static_cast(data);
size_t ndone = 0;
while (ndone < size) {
- tvm_ssize_t ret = io_->PosixRead(buf, size - ndone);
+ ssize_t ret = io_->PosixRead(buf, size - ndone);
if (ret == 0) {
if (allow_clean_shutdown_) {
Shutdown();
diff --git a/src/runtime/minrpc/minrpc_server_logging.h b/src/runtime/minrpc/minrpc_server_logging.h
index ccfe1af44a7a..deca2156ce62 100644
--- a/src/runtime/minrpc/minrpc_server_logging.h
+++ b/src/runtime/minrpc/minrpc_server_logging.h
@@ -140,7 +140,7 @@ class MinRPCSniffer {
uint8_t* buf = reinterpret_cast(data);
size_t ndone = 0;
while (ndone < size) {
- tvm_ssize_t ret = io_->PosixRead(buf, size - ndone);
+ ssize_t ret = io_->PosixRead(buf, size - ndone);
if (ret <= 0) {
this->ThrowError(RPCServerStatus::kReadError);
return false;
diff --git a/src/runtime/rpc/rpc_channel_logger.h b/src/runtime/rpc/rpc_channel_logger.h
index 7f26841d9ad0..8fe68f669007 100644
--- a/src/runtime/rpc/rpc_channel_logger.h
+++ b/src/runtime/rpc/rpc_channel_logger.h
@@ -29,6 +29,7 @@
#include
#include
+#include "../../support/ssize.h"
#include "../minrpc/minrpc_server_logging.h"
#include "rpc_channel.h"
@@ -98,11 +99,11 @@ class SnifferIOHandler {
void MessageStart(size_t message_size_bytes) {}
- tvm_ssize_t PosixWrite(const uint8_t* buf, size_t buf_size_bytes) { return 0; }
+ ssize_t PosixWrite(const uint8_t* buf, size_t buf_size_bytes) { return 0; }
void MessageDone() {}
- tvm_ssize_t PosixRead(uint8_t* buf, size_t buf_size_bytes) {
+ ssize_t PosixRead(uint8_t* buf, size_t buf_size_bytes) {
return receive_buffer_->Read(buf, buf_size_bytes);
}
diff --git a/src/support/socket.h b/src/support/socket.h
index 42d5d9004c15..52de2f72f548 100644
--- a/src/support/socket.h
+++ b/src/support/socket.h
@@ -34,7 +34,6 @@
#include
#include
-using ssize_t = int;
#ifdef _MSC_VER
#pragma comment(lib, "Ws2_32.lib")
#endif
@@ -57,6 +56,7 @@ using ssize_t = int;
#include
#include
+#include "../support/ssize.h"
#include "../support/utils.h"
#if defined(_WIN32)
diff --git a/src/support/ssize.h b/src/support/ssize.h
new file mode 100644
index 000000000000..2a62a9b36989
--- /dev/null
+++ b/src/support/ssize.h
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*!
+ * \file ssize.h
+ * \brief this file aims to define ssize_t for Windows platform
+ */
+
+#ifndef TVM_SUPPORT_SSIZE_H_
+#define TVM_SUPPORT_SSIZE_H_
+
+#if defined(_MSC_VER)
+#if defined(_WIN32)
+using ssize_t = int32_t;
+#else
+using ssize_t = int64_t;
+#endif
+#endif
+
+#endif // TVM_SUPPORT_SSIZE_H_
diff --git a/tests/python/frontend/paddlepaddle/test_forward.py b/tests/python/frontend/paddlepaddle/test_forward.py
index 0f243e0ea02c..b6caac1f20fe 100644
--- a/tests/python/frontend/paddlepaddle/test_forward.py
+++ b/tests/python/frontend/paddlepaddle/test_forward.py
@@ -707,6 +707,7 @@ def forward(self, x, index):
verify_model(GatherNd(), [x_data, y_data])
+@pytest.skip(reason="See https://github.com/apache/tvm/issues/11435")
@tvm.testing.uses_gpu
def test_forward_group_norm():
class GroupNorm(nn.Layer):
diff --git a/tests/python/unittest/test_arith_deduce_bound.py b/tests/python/unittest/test_arith_deduce_bound.py
index 5c6976ab5074..ef478b4c2ffb 100644
--- a/tests/python/unittest/test_arith_deduce_bound.py
+++ b/tests/python/unittest/test_arith_deduce_bound.py
@@ -14,9 +14,11 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+import pytest
import tvm
import tvm.testing
from tvm import te
+from tvm.tir.buffer import decl_buffer
def test_deduce():
@@ -210,8 +212,26 @@ def test_complex(a1, a2, coff):
test_complex(2, 6, -4)
+def test_deduce_non_support():
+ a = te.var("a")
+
+ def test_non_support(lhs):
+ res = tvm.arith.deduce_bound(a, lhs < 10, {}, {})
+ assert res.is_nothing()
+
+ test_non_support(tvm.tir.floordiv(a, 16))
+ test_non_support(tvm.tir.floormod(a, 16))
+ test_non_support(tvm.tir.Min(a, 16))
+ test_non_support(tvm.tir.Max(a, 16))
+ test_non_support(tvm.tir.LE(a, 16))
+ test_non_support(tvm.tir.LT(a, 16))
+ test_non_support(tvm.tir.GE(a, 16))
+ test_non_support(tvm.tir.GT(a, 16))
+ test_non_support(tvm.tir.EQ(a, 16))
+ test_non_support(tvm.tir.NE(a, 16))
+ test_non_support(tvm.tir.log(a))
+ test_non_support(tvm.tir.BufferLoad(decl_buffer([16], "int32"), [a]))
+
+
if __name__ == "__main__":
- test_check()
- test_deduce()
- test_deduce_basic()
- test_deduce_complex()
+ pytest.main([__file__])
diff --git a/tests/python/unittest/test_auto_scheduler_evolutionary_search.py b/tests/python/unittest/test_auto_scheduler_evolutionary_search.py
index b5c99c0f05fd..080339059bf3 100644
--- a/tests/python/unittest/test_auto_scheduler_evolutionary_search.py
+++ b/tests/python/unittest/test_auto_scheduler_evolutionary_search.py
@@ -68,6 +68,7 @@ def predict(self, task, states):
assert found
+@pytest.skip(reason="See https://github.com/apache/tvm/issues/11440")
def test_mutate_parallel():
"""
The test case initializes evo search with a batch of "bad" states and check whether
diff --git a/tests/python/unittest/test_type_annotation_checker.py b/tests/python/unittest/test_type_annotation_checker.py
index 7317e05b1a75..9f6f29c7ffb3 100644
--- a/tests/python/unittest/test_type_annotation_checker.py
+++ b/tests/python/unittest/test_type_annotation_checker.py
@@ -16,7 +16,7 @@
# under the License.
"""Test type checker based on python's type annotations"""
-from typing import List, Tuple
+from typing import List, Tuple, Union
import pytest
@@ -70,6 +70,18 @@
(None, 5),
],
},
+ {
+ "type_annotation": Union[str, int],
+ "positive_cases": [
+ "x",
+ 5,
+ ],
+ "negative_cases": [
+ 5.0,
+ ("x", 5, 6),
+ None,
+ ],
+ },
]
positive_cases = [
diff --git a/tests/scripts/task_ci_setup.sh b/tests/scripts/task_ci_setup.sh
index 91c879248789..5af0d0c9801e 100755
--- a/tests/scripts/task_ci_setup.sh
+++ b/tests/scripts/task_ci_setup.sh
@@ -16,9 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
-set -o pipefail
+set -euxo pipefail
# Script to setup additional python env.
#
diff --git a/tests/scripts/task_clean.sh b/tests/scripts/task_clean.sh
index 2ddc0d3db84d..3ae70b346c1b 100755
--- a/tests/scripts/task_clean.sh
+++ b/tests/scripts/task_clean.sh
@@ -15,5 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+set -euxo pipefail
+
echo "Cleanup data..."
cd $1 && rm -rf standalone_crt && rm -rf host_standalone_crt && rm -rf CMake* && cd ..
diff --git a/tests/scripts/task_config_build_arm.sh b/tests/scripts/task_config_build_arm.sh
index b95b20aa4f06..189bdc250a8c 100755
--- a/tests/scripts/task_config_build_arm.sh
+++ b/tests/scripts/task_config_build_arm.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_cpu.sh b/tests/scripts/task_config_build_cpu.sh
index a43edcf74485..b67d3823ca84 100755
--- a/tests/scripts/task_config_build_cpu.sh
+++ b/tests/scripts/task_config_build_cpu.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_gpu.sh b/tests/scripts/task_config_build_gpu.sh
index 0145eb387bf4..9a71983886dd 100755
--- a/tests/scripts/task_config_build_gpu.sh
+++ b/tests/scripts/task_config_build_gpu.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_gpu_other.sh b/tests/scripts/task_config_build_gpu_other.sh
index 07515d64ada3..9943d9b2514e 100755
--- a/tests/scripts/task_config_build_gpu_other.sh
+++ b/tests/scripts/task_config_build_gpu_other.sh
@@ -18,9 +18,7 @@
# This file is a compiler test to ensure that runtimes can compile
# correctly, even if they aren't actively tested in the CI.
-
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_gpu_vulkan.sh b/tests/scripts/task_config_build_gpu_vulkan.sh
index eb26730e89d4..f3859b9aa04d 100755
--- a/tests/scripts/task_config_build_gpu_vulkan.sh
+++ b/tests/scripts/task_config_build_gpu_vulkan.sh
@@ -23,6 +23,6 @@
# Jenkinsfile from the ci-docker-staging branch, but the task scripts
# from the PR branch.
-set -euo pipefail
+set -euxo pipefail
./tests/scripts/task_config_build_gpu_other.sh
diff --git a/tests/scripts/task_config_build_hexagon.sh b/tests/scripts/task_config_build_hexagon.sh
index a38180a2d971..a943d72e3635 100755
--- a/tests/scripts/task_config_build_hexagon.sh
+++ b/tests/scripts/task_config_build_hexagon.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_i386.sh b/tests/scripts/task_config_build_i386.sh
index b06fe5f3e7d7..c92aed3c1450 100755
--- a/tests/scripts/task_config_build_i386.sh
+++ b/tests/scripts/task_config_build_i386.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/apps/android_camera/app/src/main/jni/build.sh b/tests/scripts/task_config_build_jvm.sh
similarity index 58%
rename from apps/android_camera/app/src/main/jni/build.sh
rename to tests/scripts/task_config_build_jvm.sh
index e9b7303d901b..f14c90bebd4b 100755
--- a/apps/android_camera/app/src/main/jni/build.sh
+++ b/tests/scripts/task_config_build_jvm.sh
@@ -1,4 +1,5 @@
-#!/bin/bash
+
+#!/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,13 +16,19 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-set -x
-PATH="$PATH:/usr/local/bin"
-CURR_DIR=$(cd `dirname $0`; pwd)
-ROOT_DIR="$CURR_DIR/../../../../../.."
-javac -h $CURR_DIR -classpath "$ROOT_DIR/jvm/core/target/*" $ROOT_DIR/jvm/core/src/main/java/org/apache/tvm/LibInfo.java || exit -1
-mv $CURR_DIR/org_apache_tvm_LibInfo.h $CURR_DIR/org_apache_tvm_native_c_api.h
-cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
-cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
-rm -rf $CURR_DIR/../libs
-ndk-build --directory=$CURR_DIR
+
+set -e
+set -u
+
+BUILD_DIR=$1
+mkdir -p "$BUILD_DIR"
+cd "$BUILD_DIR"
+cp ../cmake/config.cmake .
+
+echo set\(USE_SORT ON\) >> config.cmake
+echo set\(USE_RPC ON\) >> config.cmake
+echo set\(USE_PROFILER ON\) >> config.cmake
+echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
+echo set\(USE_CCACHE OFF\) >> config.cmake
+echo set\(SUMMARIZE ON\) >> config.cmake
+echo set\(USE_LLVM ON\) >> config.cmake
\ No newline at end of file
diff --git a/tests/scripts/task_config_build_qemu.sh b/tests/scripts/task_config_build_qemu.sh
index d312f2f6c5f0..a2c708c6d113 100755
--- a/tests/scripts/task_config_build_qemu.sh
+++ b/tests/scripts/task_config_build_qemu.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_config_build_wasm.sh b/tests/scripts/task_config_build_wasm.sh
index b55463d3244c..daa5481bea9d 100755
--- a/tests/scripts/task_config_build_wasm.sh
+++ b/tests/scripts/task_config_build_wasm.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
BUILD_DIR=$1
mkdir -p "$BUILD_DIR"
diff --git a/tests/scripts/task_convert_scripts_to_python.sh b/tests/scripts/task_convert_scripts_to_python.sh
index b2164cbdbbcf..521abc5e208c 100755
--- a/tests/scripts/task_convert_scripts_to_python.sh
+++ b/tests/scripts/task_convert_scripts_to_python.sh
@@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+set -euxo pipefail
SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")
TVM_DIR=$(cd "${SCRIPTS_DIR}" && git rev-parse --show-toplevel)
diff --git a/tests/scripts/task_golang.sh b/tests/scripts/task_golang.sh
index b79a2a5d9208..62eb8081eb9d 100755
--- a/tests/scripts/task_golang.sh
+++ b/tests/scripts/task_golang.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
diff --git a/tests/scripts/task_java_unittest.sh b/tests/scripts/task_java_unittest.sh
index 70ad53d62737..33467e661487 100755
--- a/tests/scripts/task_java_unittest.sh
+++ b/tests/scripts/task_java_unittest.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
export PYTHONPATH=python
export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
diff --git a/tests/scripts/task_mypy.sh b/tests/scripts/task_mypy.sh
index c26ab73846b3..1ef7db589432 100755
--- a/tests/scripts/task_mypy.sh
+++ b/tests/scripts/task_mypy.sh
@@ -16,9 +16,8 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
-set -o pipefail
+set -euxo pipefail
+
source tests/scripts/setup-pytest-env.sh
echo "Checking MyPy Type defs in the TensorIR schedule package."
diff --git a/tests/scripts/task_python_arm_compute_library.sh b/tests/scripts/task_python_arm_compute_library.sh
index bc0cf176099b..51b453e2b862 100755
--- a/tests/scripts/task_python_arm_compute_library.sh
+++ b/tests/scripts/task_python_arm_compute_library.sh
@@ -16,8 +16,8 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
+
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_docs.sh b/tests/scripts/task_python_docs.sh
index b947c65ec6cc..b4b52ed36ccf 100755
--- a/tests/scripts/task_python_docs.sh
+++ b/tests/scripts/task_python_docs.sh
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -euo pipefail
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_ethosn_tests.sh b/tests/scripts/task_python_ethosn_tests.sh
index aeef9e64b251..d49b8518a4ad 100755
--- a/tests/scripts/task_python_ethosn_tests.sh
+++ b/tests/scripts/task_python_ethosn_tests.sh
@@ -16,8 +16,8 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
+
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_frontend_cpu.sh b/tests/scripts/task_python_frontend_cpu.sh
index f12177dc7f93..52c3d1078edf 100755
--- a/tests/scripts/task_python_frontend_cpu.sh
+++ b/tests/scripts/task_python_frontend_cpu.sh
@@ -17,8 +17,7 @@
# under the License.
# Test frontends that only need CPU resources
-set -e
-set -u
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
# to avoid openblas threading error
diff --git a/tests/scripts/task_python_hexagon.sh b/tests/scripts/task_python_hexagon.sh
index 883c296c5056..c87bc9b250fa 100755
--- a/tests/scripts/task_python_hexagon.sh
+++ b/tests/scripts/task_python_hexagon.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
device_serial="simulator"
if [ $# -ge 1 ] && [[ "$1" = "--device" ]]; then
diff --git a/tests/scripts/task_python_integration_gpuonly.sh b/tests/scripts/task_python_integration_gpuonly.sh
index d4d6e26d88f2..3ce5571caa0e 100755
--- a/tests/scripts/task_python_integration_gpuonly.sh
+++ b/tests/scripts/task_python_integration_gpuonly.sh
@@ -16,6 +16,8 @@
# specific language governing permissions and limitations
# under the License.
+set -exo pipefail
+
export TVM_TEST_TARGETS="cuda;opencl;metal;rocm;nvptx;opencl -device=mali,aocl_sw_emu"
export PYTEST_ADDOPTS="-m gpu $PYTEST_ADDOPTS"
export TVM_RELAY_TEST_TARGETS="cuda"
diff --git a/tests/scripts/task_python_integration_i386only.sh b/tests/scripts/task_python_integration_i386only.sh
index 9b0c30b7aeef..f4fe311671ff 100755
--- a/tests/scripts/task_python_integration_i386only.sh
+++ b/tests/scripts/task_python_integration_i386only.sh
@@ -15,8 +15,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
+
export TVM_INTEGRATION_I386_ONLY=1
diff --git a/tests/scripts/task_python_microtvm.sh b/tests/scripts/task_python_microtvm.sh
index 7301c6f833ab..557e938a6ed3 100755
--- a/tests/scripts/task_python_microtvm.sh
+++ b/tests/scripts/task_python_microtvm.sh
@@ -16,9 +16,8 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
-set -x # NOTE(areusch): Adding to diagnose flaky timeouts
+set -euxo pipefail
+
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_nightly.sh b/tests/scripts/task_python_nightly.sh
index 225892b02b79..f8423602bd4b 100755
--- a/tests/scripts/task_python_nightly.sh
+++ b/tests/scripts/task_python_nightly.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_topi.sh b/tests/scripts/task_python_topi.sh
index 8389e12f5b0c..3916e0a754f3 100755
--- a/tests/scripts/task_python_topi.sh
+++ b/tests/scripts/task_python_topi.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
diff --git a/tests/scripts/task_python_vta_fsim.sh b/tests/scripts/task_python_vta_fsim.sh
index 6ba78167ac8c..cd96b278d860 100755
--- a/tests/scripts/task_python_vta_fsim.sh
+++ b/tests/scripts/task_python_vta_fsim.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
# to avoid CI thread throttling.
diff --git a/tests/scripts/task_python_vta_tsim.sh b/tests/scripts/task_python_vta_tsim.sh
index 95d1a2cbf001..d6a181fb570c 100755
--- a/tests/scripts/task_python_vta_tsim.sh
+++ b/tests/scripts/task_python_vta_tsim.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
source tests/scripts/setup-pytest-env.sh
export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/vta/python
diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh
index 0c0e283afd35..93e5346f4932 100755
--- a/tests/scripts/task_rust.sh
+++ b/tests/scripts/task_rust.sh
@@ -16,8 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
+set -euxo pipefail
export TVM_HOME="$(git rev-parse --show-toplevel)"
echo "Using TVM_HOME=$TVM_HOME"
diff --git a/tests/scripts/task_show_node_info.sh b/tests/scripts/task_show_node_info.sh
index a89e10e8c769..f68216723484 100755
--- a/tests/scripts/task_show_node_info.sh
+++ b/tests/scripts/task_show_node_info.sh
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -x
+set -euxo pipefail
echo "===== JENKINS INFO ====="
echo "NODE_NAME=$NODE_NAME"