diff --git a/Jenkinsfile b/Jenkinsfile index c2f640733338..f09a51867f39 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2995,6 +2995,220 @@ def shard_run_frontend_aarch64_2_of_2() { } +def shard_run_test_Qemu_1_of_4() { + if (!skip_ci && is_docs_only_build != 1) { + node('CPU-SMALL') { + ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") { + try { + docker_init(ci_qemu) + init_git() + timeout(time: max_time, unit: 'MINUTES') { + withEnv([ + 'PLATFORM=qemu', + 'TVM_NUM_SHARDS=4', + 'TVM_SHARD_INDEX=0'], { + sh( + script: """ + set -eux + 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}/qemu/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 + 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', + ) + + add_microtvm_permissions() + ci_setup(ci_qemu) + cpp_unittest(ci_qemu) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh", + label: 'Run microTVM demos', + ) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh", + label: 'Run microTVM tests', + ) + }) + } + } finally { + sh( + script: """ + set -eux + aws s3 cp --no-progress build/pytest-results s3://${s3_prefix}/pytest-results --recursive + """, + label: 'Upload JUnits to S3', + ) + + junit 'build/pytest-results/*.xml' + } + } + } + } else { + Utils.markStageSkippedForConditional('test: Qemu 1 of 4') + } +} + +def shard_run_test_Qemu_2_of_4() { + if (!skip_ci && is_docs_only_build != 1) { + node('CPU-SMALL') { + ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") { + try { + docker_init(ci_qemu) + init_git() + timeout(time: max_time, unit: 'MINUTES') { + withEnv([ + 'PLATFORM=qemu', + 'TVM_NUM_SHARDS=4', + 'TVM_SHARD_INDEX=1'], { + sh( + script: """ + set -eux + 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}/qemu/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 + 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', + ) + + add_microtvm_permissions() + ci_setup(ci_qemu) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh", + label: 'Run microTVM tests', + ) + }) + } + } finally { + sh( + script: """ + set -eux + aws s3 cp --no-progress build/pytest-results s3://${s3_prefix}/pytest-results --recursive + """, + label: 'Upload JUnits to S3', + ) + + junit 'build/pytest-results/*.xml' + } + } + } + } else { + Utils.markStageSkippedForConditional('test: Qemu 2 of 4') + } +} + +def shard_run_test_Qemu_3_of_4() { + if (!skip_ci && is_docs_only_build != 1) { + node('CPU-SMALL') { + ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") { + try { + docker_init(ci_qemu) + init_git() + timeout(time: max_time, unit: 'MINUTES') { + withEnv([ + 'PLATFORM=qemu', + 'TVM_NUM_SHARDS=4', + 'TVM_SHARD_INDEX=2'], { + sh( + script: """ + set -eux + 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}/qemu/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 + 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', + ) + + add_microtvm_permissions() + ci_setup(ci_qemu) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh", + label: 'Run microTVM tests', + ) + }) + } + } finally { + sh( + script: """ + set -eux + aws s3 cp --no-progress build/pytest-results s3://${s3_prefix}/pytest-results --recursive + """, + label: 'Upload JUnits to S3', + ) + + junit 'build/pytest-results/*.xml' + } + } + } + } else { + Utils.markStageSkippedForConditional('test: Qemu 3 of 4') + } +} + +def shard_run_test_Qemu_4_of_4() { + if (!skip_ci && is_docs_only_build != 1) { + node('CPU-SMALL') { + ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") { + try { + docker_init(ci_qemu) + init_git() + timeout(time: max_time, unit: 'MINUTES') { + withEnv([ + 'PLATFORM=qemu', + 'TVM_NUM_SHARDS=4', + 'TVM_SHARD_INDEX=3'], { + sh( + script: """ + set -eux + 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}/qemu/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 + 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', + ) + + add_microtvm_permissions() + ci_setup(ci_qemu) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh", + label: 'Run microTVM tests', + ) + }) + } + } finally { + sh( + script: """ + set -eux + aws s3 cp --no-progress build/pytest-results s3://${s3_prefix}/pytest-results --recursive + """, + label: 'Upload JUnits to S3', + ) + + junit 'build/pytest-results/*.xml' + } + } + } + } else { + Utils.markStageSkippedForConditional('test: Qemu 4 of 4') + } +} + + def test() { stage('Test') { @@ -3119,6 +3333,18 @@ stage('Test') { 'frontend: aarch64 2 of 2': { shard_run_frontend_aarch64_2_of_2() }, + 'test: Qemu 1 of 4': { + shard_run_test_Qemu_1_of_4() + }, + 'test: Qemu 2 of 4': { + shard_run_test_Qemu_2_of_4() + }, + 'test: Qemu 3 of 4': { + shard_run_test_Qemu_3_of_4() + }, + 'test: Qemu 4 of 4': { + shard_run_test_Qemu_4_of_4() + }, 'unittest: CPU': { if (!skip_ci && is_docs_only_build != 1) { node('CPU-SMALL') { @@ -3172,59 +3398,6 @@ stage('Test') { Utils.markStageSkippedForConditional('unittest: CPU') } }, - 'test: QEMU': { - if (!skip_ci && is_docs_only_build != 1) { - node('CPU-SMALL') { - ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") { - timeout(time: max_time, unit: 'MINUTES') { - try { - docker_init(ci_qemu) - init_git() - withEnv(['PLATFORM=qemu'], { - sh( - script: """ - set -eux - 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}/qemu/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 - 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', - ) - - 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 { - sh( - script: """ - set -eux - aws s3 cp --no-progress build/pytest-results s3://${s3_prefix}/pytest-results --recursive - """, - label: 'Upload JUnits to S3', - ) - - junit 'build/pytest-results/*.xml' - } - } - } - } - } else { - Utils.markStageSkippedForConditional('test: QEMU') - } - }, 'frontend: CPU': { if (!skip_ci && is_docs_only_build != 1) { node('CPU-SMALL') { diff --git a/ci/jenkins/Test.groovy.j2 b/ci/jenkins/Test.groovy.j2 index d219b47bc792..de2a1b5cfdd9 100644 --- a/ci/jenkins/Test.groovy.j2 +++ b/ci/jenkins/Test.groovy.j2 @@ -186,6 +186,30 @@ label: 'Run Python frontend tests', ) {% endcall %} +{% call(shard_index, num_shards) m.sharded_test_step( + name="test: Qemu", + node="CPU-SMALL", + ws="tvm/test-qemu", + platform="qemu", + docker_image="ci_qemu", + num_shards=4, + test_method_names=test_method_names, +) %} + {{ m.download_artifacts(tag='qemu', filenames=tvm_lib, folders=microtvm_template_projects) }} + add_microtvm_permissions() + ci_setup(ci_qemu) + {% if shard_index == 1%} + cpp_unittest(ci_qemu) + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh", + label: 'Run microTVM demos', + ) + {% endif %} + sh ( + script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh", + label: 'Run microTVM tests', + ) +{% endcall %} def test() { @@ -216,26 +240,6 @@ stage('Test') { label: 'Run VTA tests in TSIM', ) {% endcall %} - {% call m.test_step( - name="test: QEMU", - node="CPU-SMALL", - ws="tvm/test-qemu", - platform="qemu", - docker_image="ci_qemu", - ) %} - {{ m.download_artifacts(tag='qemu', filenames=tvm_lib, folders=microtvm_template_projects) }} - 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', - ) - {% endcall %} {% call m.test_step( name="frontend: CPU", node="CPU-SMALL",