Skip to content

Commit 73a65e1

Browse files
committed
[ci] Break out test steps for Hexagon / microTVM
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.
1 parent bf7a27b commit 73a65e1

File tree

2 files changed

+103
-71
lines changed

2 files changed

+103
-71
lines changed

Jenkinsfile

Lines changed: 67 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-07T13:50:22.427152
48+
// Generated at 2022-04-11T10:13:43.924255
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, ' + tvm_lib
8889
upstream_revision = null
8990

9091
// command to start a docker container
@@ -576,23 +577,9 @@ 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 "find ." // todo: debugging only, remove this
582+
pack_lib('qemu', microtvm_lib)
596583
}
597584
}
598585
} else {
@@ -608,24 +595,8 @@ stage('Build') {
608595
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
609596
label: 'Create Hexagon cmake config',
610597
)
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-
}
598+
make(ci_hexagon, 'build', '-j2')
599+
pack_lib('hexagon', tvm_lib)
629600
}
630601
}
631602
} else {
@@ -779,6 +750,66 @@ stage('Test') {
779750
Utils.markStageSkippedForConditional('python3: i386')
780751
}
781752
},
753+
'test: Hexagon': {
754+
if (!skip_ci && is_docs_only_build != 1) {
755+
node('CPU') {
756+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
757+
timeout(time: max_time, unit: 'MINUTES') {
758+
try {
759+
init_git()
760+
unpack_lib('hexagon', tvm_lib)
761+
ci_setup(ci_hexagon)
762+
cpp_unittest(ci_hexagon)
763+
sh (
764+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
765+
label: 'Build Hexagon API',
766+
)
767+
sh (
768+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
769+
label: 'Run Hexagon tests',
770+
)
771+
sh (
772+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
773+
label: 'Run Hexagon tests on simulator',
774+
)
775+
} finally {
776+
junit 'build/pytest-results/*.xml'
777+
}
778+
}
779+
}
780+
}
781+
} else {
782+
Utils.markStageSkippedForConditional('test: Hexagon')
783+
}
784+
},
785+
'test: QEMU': {
786+
if (!skip_ci && is_docs_only_build != 1) {
787+
node('CPU') {
788+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
789+
timeout(time: max_time, unit: 'MINUTES') {
790+
try {
791+
init_git()
792+
unpack_lib('qemu', microtvm_lib)
793+
ci_setup(ci_qemu)
794+
cpp_unittest(ci_qemu)
795+
sh (
796+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
797+
label: 'Run microTVM tests',
798+
)
799+
sh (
800+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
801+
label: 'Run microTVM demos',
802+
)
803+
} finally {
804+
junit 'build/pytest-results/*.xml'
805+
}
806+
}
807+
}
808+
}
809+
} else {
810+
Utils.markStageSkippedForConditional('test: QEMU')
811+
}
812+
},
782813
'topi: aarch64': {
783814
if (!skip_ci && is_docs_only_build != 1) {
784815
node('ARM') {

jenkins/Jenkinsfile.j2

Lines changed: 36 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, ' + tvm_lib
8586
upstream_revision = null
8687

8788
// command to start a docker container
@@ -573,23 +574,9 @@ 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 "find ." // todo: debugging only, remove this
579+
pack_lib('qemu', microtvm_lib)
593580
}
594581
}
595582
} else {
@@ -605,24 +592,8 @@ stage('Build') {
605592
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
606593
label: 'Create Hexagon cmake config',
607594
)
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-
}
595+
make(ci_hexagon, 'build', '-j2')
596+
pack_lib('hexagon', tvm_lib)
626597
}
627598
}
628599
} else {
@@ -730,6 +701,36 @@ stage('Test') {
730701
Utils.markStageSkippedForConditional('python3: i386')
731702
}
732703
},
704+
{% call m.test_step(name="test: Hexagon", node="CPU", ws="tvm/test-hexagon") %}
705+
unpack_lib('hexagon', tvm_lib)
706+
ci_setup(ci_hexagon)
707+
cpp_unittest(ci_hexagon)
708+
sh (
709+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
710+
label: 'Build Hexagon API',
711+
)
712+
sh (
713+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
714+
label: 'Run Hexagon tests',
715+
)
716+
sh (
717+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
718+
label: 'Run Hexagon tests on simulator',
719+
)
720+
{% endcall %}
721+
{% call m.test_step(name="test: QEMU", node="CPU", ws="tvm/test-qemu") %}
722+
unpack_lib('qemu', microtvm_lib)
723+
ci_setup(ci_qemu)
724+
cpp_unittest(ci_qemu)
725+
sh (
726+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
727+
label: 'Run microTVM tests',
728+
)
729+
sh (
730+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
731+
label: 'Run microTVM demos',
732+
)
733+
{% endcall %}
733734
{% call m.test_step(name="topi: aarch64", node="ARM", ws="tvm/ut-python-arm") %}
734735
unpack_lib('arm', tvm_multilib)
735736
ci_setup(ci_arm)

0 commit comments

Comments
 (0)