Skip to content

Commit ccbc5a9

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 ccbc5a9

File tree

2 files changed

+99
-71
lines changed

2 files changed

+99
-71
lines changed

Jenkinsfile

Lines changed: 65 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-08T17:26:46.337876
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. -->
@@ -576,23 +576,8 @@ stage('Build') {
576576
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
577577
label: 'Create QEMU cmake config',
578578
)
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-
}
579+
make(ci_qemu, 'build', '-j2')
580+
pack_lib('qemu', tvm_lib)
596581
}
597582
}
598583
} else {
@@ -608,24 +593,8 @@ stage('Build') {
608593
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
609594
label: 'Create Hexagon cmake config',
610595
)
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-
}
596+
make(ci_hexagon, 'build', '-j2')
597+
pack_lib('hexagon', tvm_lib)
629598
}
630599
}
631600
} else {
@@ -779,6 +748,66 @@ stage('Test') {
779748
Utils.markStageSkippedForConditional('python3: i386')
780749
}
781750
},
751+
'test: Hexagon': {
752+
if (!skip_ci && is_docs_only_build != 1) {
753+
node('CPU') {
754+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
755+
timeout(time: max_time, unit: 'MINUTES') {
756+
try {
757+
init_git()
758+
unpack_lib('hexagon', tvm_lib)
759+
ci_setup(ci_hexagon)
760+
cpp_unittest(ci_hexagon)
761+
sh (
762+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
763+
label: 'Build Hexagon API',
764+
)
765+
sh (
766+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
767+
label: 'Run Hexagon tests',
768+
)
769+
sh (
770+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
771+
label: 'Run Hexagon tests on simulator',
772+
)
773+
} finally {
774+
junit 'build/pytest-results/*.xml'
775+
}
776+
}
777+
}
778+
}
779+
} else {
780+
Utils.markStageSkippedForConditional('test: Hexagon')
781+
}
782+
},
783+
'test: QEMU': {
784+
if (!skip_ci && is_docs_only_build != 1) {
785+
node('CPU') {
786+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-qemu") {
787+
timeout(time: max_time, unit: 'MINUTES') {
788+
try {
789+
init_git()
790+
unpack_lib('qemu', tvm_lib)
791+
ci_setup(ci_qemu)
792+
cpp_unittest(ci_qemu)
793+
sh (
794+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
795+
label: 'Run microTVM tests',
796+
)
797+
sh (
798+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
799+
label: 'Run microTVM demos',
800+
)
801+
} finally {
802+
junit 'build/pytest-results/*.xml'
803+
}
804+
}
805+
}
806+
}
807+
} else {
808+
Utils.markStageSkippedForConditional('test: QEMU')
809+
}
810+
},
782811
'topi: aarch64': {
783812
if (!skip_ci && is_docs_only_build != 1) {
784813
node('ARM') {

jenkins/Jenkinsfile.j2

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -573,23 +573,8 @@ stage('Build') {
573573
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
574574
label: 'Create QEMU cmake config',
575575
)
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-
}
576+
make(ci_qemu, 'build', '-j2')
577+
pack_lib('qemu', tvm_lib)
593578
}
594579
}
595580
} else {
@@ -605,24 +590,8 @@ stage('Build') {
605590
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
606591
label: 'Create Hexagon cmake config',
607592
)
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-
}
593+
make(ci_hexagon, 'build', '-j2')
594+
pack_lib('hexagon', tvm_lib)
626595
}
627596
}
628597
} else {
@@ -730,6 +699,36 @@ stage('Test') {
730699
Utils.markStageSkippedForConditional('python3: i386')
731700
}
732701
},
702+
{% call m.test_step(name="test: Hexagon", node="CPU", ws="tvm/test-hexagon") %}
703+
unpack_lib('hexagon', tvm_lib)
704+
ci_setup(ci_hexagon)
705+
cpp_unittest(ci_hexagon)
706+
sh (
707+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
708+
label: 'Build Hexagon API',
709+
)
710+
sh (
711+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
712+
label: 'Run Hexagon tests',
713+
)
714+
sh (
715+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
716+
label: 'Run Hexagon tests on simulator',
717+
)
718+
{% endcall %}
719+
{% call m.test_step(name="test: QEMU", node="CPU", ws="tvm/test-qemu") %}
720+
unpack_lib('qemu', tvm_lib)
721+
ci_setup(ci_qemu)
722+
cpp_unittest(ci_qemu)
723+
sh (
724+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
725+
label: 'Run microTVM tests',
726+
)
727+
sh (
728+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_demo_microtvm.sh",
729+
label: 'Run microTVM demos',
730+
)
731+
{% endcall %}
733732
{% call m.test_step(name="topi: aarch64", node="ARM", ws="tvm/ut-python-arm") %}
734733
unpack_lib('arm', tvm_multilib)
735734
ci_setup(ci_arm)

0 commit comments

Comments
 (0)