Skip to content

Commit e496d02

Browse files
committed
[ci] Split hexagon into 2 steps
This shards up the hexagon build since after #11016 it's the longest test step. This also drops the max runtime per stage down to 2 hours from 4 hours to make these kind of increases more obvious in the future
1 parent 6846484 commit e496d02

File tree

3 files changed

+123
-21
lines changed

3 files changed

+123
-21
lines changed

Jenkinsfile

Lines changed: 110 additions & 11 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-22T12:59:15.071304
48+
// Generated at 2022-04-26T14:53:42.817114
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. -->
@@ -92,7 +92,7 @@ upstream_revision = null
9292
docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
9393
docker_build = 'docker/build.sh'
9494
// timeout in minutes
95-
max_time = 240
95+
max_time = 120
9696
rebuild_docker_images = false
9797

9898
def per_exec_ws(folder) {
@@ -837,17 +837,52 @@ stage('Test') {
837837
Utils.markStageSkippedForConditional('python: i386 2 of 2')
838838
}
839839
},
840-
'test: Hexagon': {
840+
'test: Hexagon 1 of 4': {
841841
if (!skip_ci && is_docs_only_build != 1) {
842842
node('CPU') {
843843
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
844-
timeout(time: max_time, unit: 'MINUTES') {
845-
try {
846-
init_git()
847-
withEnv(['PLATFORM=hexagon'], {
844+
try {
845+
init_git()
846+
timeout(time: max_time, unit: 'MINUTES') {
847+
withEnv([
848+
'PLATFORM=hexagon',
849+
'TVM_NUM_SHARDS=4',
850+
'TVM_SHARD_INDEX=0'], {
851+
unpack_lib('hexagon', tvm_lib)
852+
ci_setup(ci_hexagon)
853+
cpp_unittest(ci_hexagon)
854+
sh (
855+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
856+
label: 'Build Hexagon API',
857+
)
858+
sh (
859+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
860+
label: 'Run Hexagon tests',
861+
)
862+
})
863+
}
864+
} finally {
865+
junit 'build/pytest-results/*.xml'
866+
}
867+
}
868+
}
869+
} else {
870+
Utils.markStageSkippedForConditional('test: Hexagon 1 of 4')
871+
}
872+
},
873+
'test: Hexagon 2 of 4': {
874+
if (!skip_ci && is_docs_only_build != 1) {
875+
node('CPU') {
876+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
877+
try {
878+
init_git()
879+
timeout(time: max_time, unit: 'MINUTES') {
880+
withEnv([
881+
'PLATFORM=hexagon',
882+
'TVM_NUM_SHARDS=4',
883+
'TVM_SHARD_INDEX=1'], {
848884
unpack_lib('hexagon', tvm_lib)
849885
ci_setup(ci_hexagon)
850-
cpp_unittest(ci_hexagon)
851886
sh (
852887
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
853888
label: 'Build Hexagon API',
@@ -857,14 +892,78 @@ stage('Test') {
857892
label: 'Run Hexagon tests',
858893
)
859894
})
860-
} finally {
861-
junit 'build/pytest-results/*.xml'
862895
}
896+
} finally {
897+
junit 'build/pytest-results/*.xml'
898+
}
899+
}
900+
}
901+
} else {
902+
Utils.markStageSkippedForConditional('test: Hexagon 2 of 4')
903+
}
904+
},
905+
'test: Hexagon 3 of 4': {
906+
if (!skip_ci && is_docs_only_build != 1) {
907+
node('CPU') {
908+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
909+
try {
910+
init_git()
911+
timeout(time: max_time, unit: 'MINUTES') {
912+
withEnv([
913+
'PLATFORM=hexagon',
914+
'TVM_NUM_SHARDS=4',
915+
'TVM_SHARD_INDEX=2'], {
916+
unpack_lib('hexagon', tvm_lib)
917+
ci_setup(ci_hexagon)
918+
sh (
919+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
920+
label: 'Build Hexagon API',
921+
)
922+
sh (
923+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
924+
label: 'Run Hexagon tests',
925+
)
926+
})
927+
}
928+
} finally {
929+
junit 'build/pytest-results/*.xml'
930+
}
931+
}
932+
}
933+
} else {
934+
Utils.markStageSkippedForConditional('test: Hexagon 3 of 4')
935+
}
936+
},
937+
'test: Hexagon 4 of 4': {
938+
if (!skip_ci && is_docs_only_build != 1) {
939+
node('CPU') {
940+
ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/test-hexagon") {
941+
try {
942+
init_git()
943+
timeout(time: max_time, unit: 'MINUTES') {
944+
withEnv([
945+
'PLATFORM=hexagon',
946+
'TVM_NUM_SHARDS=4',
947+
'TVM_SHARD_INDEX=3'], {
948+
unpack_lib('hexagon', tvm_lib)
949+
ci_setup(ci_hexagon)
950+
sh (
951+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
952+
label: 'Build Hexagon API',
953+
)
954+
sh (
955+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
956+
label: 'Run Hexagon tests',
957+
)
958+
})
959+
}
960+
} finally {
961+
junit 'build/pytest-results/*.xml'
863962
}
864963
}
865964
}
866965
} else {
867-
Utils.markStageSkippedForConditional('test: Hexagon')
966+
Utils.markStageSkippedForConditional('test: Hexagon 4 of 4')
868967
}
869968
},
870969
'test: QEMU': {

jenkins/Jenkinsfile.j2

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ upstream_revision = null
8989
docker_run = 'docker/bash.sh --env CI --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM'
9090
docker_build = 'docker/build.sh'
9191
// timeout in minutes
92-
max_time = 240
92+
max_time = 120
9393
rebuild_docker_images = false
9494

9595
def per_exec_ws(folder) {
@@ -608,7 +608,7 @@ stage('Test') {
608608
SKIP_SLOW_TESTS = "${skip_slow_tests}"
609609
}
610610
parallel(
611-
{% call m.sharded_test_step(
611+
{% call(shard_index) m.sharded_test_step(
612612
name="unittest: GPU",
613613
num_shards=2,
614614
node="GPU",
@@ -634,7 +634,7 @@ stage('Test') {
634634
label: 'Run Python GPU integration tests',
635635
)
636636
{% endcall %}
637-
{% call m.sharded_test_step(
637+
{% call(shard_index) m.sharded_test_step(
638638
name="integration: CPU",
639639
node="CPU",
640640
num_shards=2,
@@ -663,7 +663,7 @@ stage('Test') {
663663
label: 'Run VTA tests in TSIM',
664664
)
665665
{% endcall %}
666-
{% call m.sharded_test_step(
666+
{% call(shard_index) m.sharded_test_step(
667667
name="python: i386",
668668
node="CPU",
669669
num_shards=2,
@@ -680,14 +680,17 @@ stage('Test') {
680680
)
681681
fsim_test(ci_i386)
682682
{% endcall %}
683-
{% call m.test_step(
683+
{% call(shard_index) m.sharded_test_step(
684684
name="test: Hexagon",
685685
node="CPU", ws="tvm/test-hexagon",
686686
platform="hexagon",
687+
num_shards=4,
687688
) %}
688689
unpack_lib('hexagon', tvm_lib)
689690
ci_setup(ci_hexagon)
690-
cpp_unittest(ci_hexagon)
691+
{% if shard_index == 1 %}
692+
cpp_unittest(ci_hexagon)
693+
{% endif %}
691694
sh (
692695
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_build_hexagon_api.sh",
693696
label: 'Build Hexagon API',
@@ -736,7 +739,7 @@ stage('Test') {
736739
label: 'Run TOPI tests',
737740
)
738741
{% endcall %}
739-
{% call m.sharded_test_step(
742+
{% call(shard_index) m.sharded_test_step(
740743
name="integration: aarch64",
741744
num_shards=2,
742745
node="ARM", ws="tvm/ut-python-arm",
@@ -750,7 +753,7 @@ stage('Test') {
750753
label: 'Run CPU integration tests',
751754
)
752755
{% endcall %}
753-
{% call m.sharded_test_step(
756+
{% call(shard_index) m.sharded_test_step(
754757
name="topi: GPU",
755758
node="GPU",
756759
num_shards=2,
@@ -764,7 +767,7 @@ stage('Test') {
764767
label: 'Run TOPI tests',
765768
)
766769
{% endcall %}
767-
{% call m.sharded_test_step(
770+
{% call(shard_index) m.sharded_test_step(
768771
name="frontend: GPU", node="GPU",
769772
num_shards=3,
770773
ws="tvm/frontend-python-gpu",

jenkins/macros.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'PLATFORM={{ platform }}',
3333
'TVM_NUM_SHARDS={{ num_shards }}',
3434
'TVM_SHARD_INDEX={{ shard_index - 1 }}'], {
35-
{{ caller() | trim | indent(width=12) }}
35+
{{ caller(shard_index) | trim | indent(width=12) }}
3636
})
3737
}
3838
} finally {

0 commit comments

Comments
 (0)