Skip to content

Commit ee1f118

Browse files
driazatiLucien0
authored andcommitted
[ci] Break out test steps for Hexagon / microTVM (apache#10946)
Since we gate all tests on all builds currently in Jenkins, the longest running build is a bottleneck for overall runtime. This moves them to their own test steps so that the longer-running GPU/CPU tests can start earlier. This should shave off another 30 minutes or so of CI time. As a follow up we can investigate per-platform parallelism, e.g. the CPU tests only wait on the CPU build, but Jenkins doesn't have good support for this so we might have to work on the UX a bit first. Co-authored-by: driazati <[email protected]>
1 parent 504fc07 commit ee1f118

File tree

2 files changed

+117
-71
lines changed

2 files changed

+117
-71
lines changed

Jenkinsfile

Lines changed: 74 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// 'python3 jenkins/generate.py'
4646
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
4747
// always rebased on main before merging:
48-
// Generated at 2022-04-11T10:45:26.226802
48+
// Generated at 2022-04-11T12:22:12.040444
4949

5050
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
5151
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -85,6 +85,7 @@ tvm_multilib = 'build/libtvm.so, ' +
8585

8686
tvm_multilib_tsim = 'build/libvta_tsim.so, ' +
8787
tvm_multilib
88+
microtvm_lib = 'build/microtvm_template_projects.tar.gz, ' + tvm_lib
8889
upstream_revision = null
8990

9091
// command to start a docker container
@@ -576,23 +577,12 @@ stage('Build') {
576577
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
577578
label: 'Create QEMU cmake config',
578579
)
579-
try {
580-
make(ci_qemu, 'build', '-j2')
581-
cpp_unittest(ci_qemu)
582-
timeout(time: max_time, unit: 'MINUTES') {
583-
ci_setup(ci_qemu)
584-
sh (
585-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
586-
label: 'Run microTVM tests',
587-
)
588-
sh (
589-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
590-
label: 'Run microTVM demos',
591-
)
592-
}
593-
} finally {
594-
junit 'build/pytest-results/*.xml'
595-
}
580+
make(ci_qemu, 'build', '-j2')
581+
sh(
582+
script: 'cd build && tar -czvf microtvm_template_projects.tar.gz microtvm_template_projects/',
583+
label: 'Compress microtvm_template_projects'
584+
)
585+
pack_lib('qemu', microtvm_lib)
596586
}
597587
}
598588
} else {
@@ -608,24 +598,8 @@ stage('Build') {
608598
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
609599
label: 'Create Hexagon cmake config',
610600
)
611-
try {
612-
make(ci_hexagon, 'build', '-j2')
613-
cpp_unittest(ci_hexagon)
614-
sh (
615-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
616-
label: 'Build Hexagon API',
617-
)
618-
sh (
619-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
620-
label: 'Run Hexagon tests',
621-
)
622-
sh (
623-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
624-
label: 'Run Hexagon tests on simulator',
625-
)
626-
} finally {
627-
junit 'build/pytest-results/*.xml'
628-
}
601+
make(ci_hexagon, 'build', '-j2')
602+
pack_lib('hexagon', tvm_lib)
629603
}
630604
}
631605
} else {
@@ -779,6 +753,70 @@ stage('Test') {
779753
Utils.markStageSkippedForConditional('python3: i386')
780754
}
781755
},
756+
'test: Hexagon': {
757+
if (!skip_ci && is_docs_only_build != 1) {
758+
node('CPU') {
759+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
760+
timeout(time: max_time, unit: 'MINUTES') {
761+
try {
762+
init_git()
763+
unpack_lib('hexagon', tvm_lib)
764+
ci_setup(ci_hexagon)
765+
cpp_unittest(ci_hexagon)
766+
sh (
767+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
768+
label: 'Build Hexagon API',
769+
)
770+
sh (
771+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
772+
label: 'Run Hexagon tests',
773+
)
774+
sh (
775+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
776+
label: 'Run Hexagon tests on simulator',
777+
)
778+
} finally {
779+
junit 'build/pytest-results/*.xml'
780+
}
781+
}
782+
}
783+
}
784+
} else {
785+
Utils.markStageSkippedForConditional('test: Hexagon')
786+
}
787+
},
788+
'test: QEMU': {
789+
if (!skip_ci && is_docs_only_build != 1) {
790+
node('CPU') {
791+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
792+
timeout(time: max_time, unit: 'MINUTES') {
793+
try {
794+
init_git()
795+
unpack_lib('qemu', microtvm_lib)
796+
sh(
797+
script: 'cd build && tar -xzvf microtvm_template_projects.tar.gz',
798+
label: 'Unpack microtvm_template_projects'
799+
)
800+
ci_setup(ci_qemu)
801+
cpp_unittest(ci_qemu)
802+
sh (
803+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
804+
label: 'Run microTVM tests',
805+
)
806+
sh (
807+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
808+
label: 'Run microTVM demos',
809+
)
810+
} finally {
811+
junit 'build/pytest-results/*.xml'
812+
}
813+
}
814+
}
815+
}
816+
} else {
817+
Utils.markStageSkippedForConditional('test: QEMU')
818+
}
819+
},
782820
'topi: aarch64': {
783821
if (!skip_ci && is_docs_only_build != 1) {
784822
node('ARM') {

jenkins/Jenkinsfile.j2

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ tvm_multilib = 'build/libtvm.so, ' +
8282

8383
tvm_multilib_tsim = 'build/libvta_tsim.so, ' +
8484
tvm_multilib
85+
microtvm_lib = 'build/microtvm_template_projects.tar.gz, ' + tvm_lib
8586
upstream_revision = null
8687

8788
// command to start a docker container
@@ -573,23 +574,12 @@ stage('Build') {
573574
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
574575
label: 'Create QEMU cmake config',
575576
)
576-
try {
577-
make(ci_qemu, 'build', '-j2')
578-
cpp_unittest(ci_qemu)
579-
timeout(time: max_time, unit: 'MINUTES') {
580-
ci_setup(ci_qemu)
581-
sh (
582-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
583-
label: 'Run microTVM tests',
584-
)
585-
sh (
586-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
587-
label: 'Run microTVM demos',
588-
)
589-
}
590-
} finally {
591-
junit 'build/pytest-results/*.xml'
592-
}
577+
make(ci_qemu, 'build', '-j2')
578+
sh(
579+
script: 'cd build && tar -czvf microtvm_template_projects.tar.gz microtvm_template_projects/',
580+
label: 'Compress microtvm_template_projects'
581+
)
582+
pack_lib('qemu', microtvm_lib)
593583
}
594584
}
595585
} else {
@@ -605,24 +595,8 @@ stage('Build') {
605595
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
606596
label: 'Create Hexagon cmake config',
607597
)
608-
try {
609-
make(ci_hexagon, 'build', '-j2')
610-
cpp_unittest(ci_hexagon)
611-
sh (
612-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
613-
label: 'Build Hexagon API',
614-
)
615-
sh (
616-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
617-
label: 'Run Hexagon tests',
618-
)
619-
sh (
620-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
621-
label: 'Run Hexagon tests on simulator',
622-
)
623-
} finally {
624-
junit 'build/pytest-results/*.xml'
625-
}
598+
make(ci_hexagon, 'build', '-j2')
599+
pack_lib('hexagon', tvm_lib)
626600
}
627601
}
628602
} else {
@@ -730,6 +704,40 @@ stage('Test') {
730704
Utils.markStageSkippedForConditional('python3: i386')
731705
}
732706
},
707+
{% call m.test_step(name="test: Hexagon", node="CPU", ws="tvm/test-hexagon") %}
708+
unpack_lib('hexagon', tvm_lib)
709+
ci_setup(ci_hexagon)
710+
cpp_unittest(ci_hexagon)
711+
sh (
712+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
713+
label: 'Build Hexagon API',
714+
)
715+
sh (
716+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
717+
label: 'Run Hexagon tests',
718+
)
719+
sh (
720+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
721+
label: 'Run Hexagon tests on simulator',
722+
)
723+
{% endcall %}
724+
{% call m.test_step(name="test: QEMU", node="CPU", ws="tvm/test-qemu") %}
725+
unpack_lib('qemu', microtvm_lib)
726+
sh(
727+
script: 'cd build && tar -xzvf microtvm_template_projects.tar.gz',
728+
label: 'Unpack microtvm_template_projects'
729+
)
730+
ci_setup(ci_qemu)
731+
cpp_unittest(ci_qemu)
732+
sh (
733+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
734+
label: 'Run microTVM tests',
735+
)
736+
sh (
737+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
738+
label: 'Run microTVM demos',
739+
)
740+
{% endcall %}
733741
{% call m.test_step(name="topi: aarch64", node="ARM", ws="tvm/ut-python-arm") %}
734742
unpack_lib('arm', tvm_multilib)
735743
ci_setup(ci_arm)

0 commit comments

Comments
 (0)