Skip to content

Commit

Permalink
Add minimal TVM build and testing to Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin-Gabriel Blanaru committed Jul 27, 2022
1 parent c698cb5 commit ef9fc51
Show file tree
Hide file tree
Showing 12 changed files with 273 additions and 18 deletions.
114 changes: 113 additions & 1 deletion Jenkinsfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions ci/jenkins/Build.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ def cpp_unittest(image) {
)
}

def cpp_micro_unittest(image) {
sh (
script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_cpp_unittest_micro.sh",
label: 'Build and run Micro C++ tests',
)
}


def add_microtvm_permissions() {
{% for folder in microtvm_template_projects %}
Expand Down Expand Up @@ -123,6 +130,24 @@ stage('Build') {
Utils.markStageSkippedForConditional('BUILD: CPU')
}
},
'BUILD: CPU MINIMAL': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
ws({{ m.per_exec_ws('tvm/build-cpu-minimal') }}) {
docker_init(ci_minimal)
init_git()
sh (
script: "${docker_run} ${ci_minimal} ./tests/scripts/task_config_build_minimal.sh build",
label: 'Create CPU minimal cmake config',
)
make(ci_minimal, 'build', '-j2')
{{ m.upload_artifacts(tag='cpu-minimal', filenames=tvm_lib) }}
}
}
} else {
Utils.markStageSkippedForConditional('BUILD: CPU MINIMAL')
}
},
'BUILD: WASM': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
Expand All @@ -135,6 +160,7 @@ stage('Build') {
)
make(ci_wasm, 'build', '-j2')
cpp_unittest(ci_wasm)
cpp_micro_unittest(ci_wasm)
timeout(time: max_time, unit: 'MINUTES') {
ci_setup(ci_wasm)
sh (
Expand Down
1 change: 1 addition & 0 deletions ci/jenkins/Jenkinsfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
ci_lint = 'tlcpack/ci-lint:20220715-060127-37f9d3c49'
ci_gpu = 'tlcpack/ci-gpu:20220715-060127-37f9d3c49'
ci_cpu = 'tlcpack/ci-cpu:20220715-060127-37f9d3c49'
ci_minimal = 'tlcpack/ci-minimal:20220725-133226-d3cefdaf1'
ci_wasm = 'tlcpack/ci-wasm:20220715-060127-37f9d3c49'
ci_i386 = 'tlcpack/ci-i386:20220715-060127-37f9d3c49'
ci_qemu = 'tlcpack/ci-qemu:20220630-060117-558ba99c7'
Expand Down
23 changes: 23 additions & 0 deletions ci/jenkins/Test.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
{% if shard_index == 1 %}
{{ m.download_artifacts(tag='gpu2', filenames=tvm_multilib) }}
cpp_unittest(ci_gpu)
cpp_micro_unittest(ci_gpu)

{{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
ci_setup(ci_gpu)
cpp_unittest(ci_gpu)
cpp_micro_unittest(ci_gpu)
{% else %}
{{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }}
ci_setup(ci_gpu)
Expand Down Expand Up @@ -68,6 +70,7 @@
ci_setup(ci_i386)
{% if shard_index == 1 %}
cpp_unittest(ci_i386)
cpp_micro_unittest(ci_i386)
{% endif %}
python_unittest(ci_i386)
sh (
Expand All @@ -92,6 +95,7 @@
ci_setup(ci_hexagon)
{% if shard_index == 1 %}
cpp_unittest(ci_hexagon)
cpp_micro_unittest(ci_hexagon)
{% endif %}
sh (
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
Expand Down Expand Up @@ -160,6 +164,7 @@
ci_setup(ci_arm)
{% if shard_index == 1 %}
cpp_unittest(ci_arm)
cpp_micro_unittest(ci_arm)
{% endif %}
sh (
script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
Expand Down Expand Up @@ -187,6 +192,19 @@
)
{% endcall %}

def run_unittest_minimal() {
{% call m.test_step_body(
name="unittest: CPU MINIMAL",
node="CPU-SMALL",
ws="tvm/ut-python-cpu-minimal",
platform="minimal",
docker_image="ci_minimal",
) %}
{{ m.download_artifacts(tag='cpu-minimal', filenames=tvm_lib) }}
cpp_unittest(ci_minimal)
python_unittest(ci_minimal)
{% endcall %}
}

def test() {
stage('Test') {
Expand All @@ -199,6 +217,9 @@ stage('Test') {
{{ method_name }}()
},
{% endfor %}
'unittest: CPU MINIMAL': {
run_unittest_minimal()
},
{% call m.test_step(
name="unittest: CPU",
node="CPU-SMALL",
Expand All @@ -209,6 +230,7 @@ stage('Test') {
{{ m.download_artifacts(tag='cpu', filenames=tvm_multilib_tsim) }}
ci_setup(ci_cpu)
cpp_unittest(ci_cpu)
cpp_micro_unittest(ci_cpu)
python_unittest(ci_cpu)
fsim_test(ci_cpu)
sh (
Expand All @@ -227,6 +249,7 @@ stage('Test') {
add_microtvm_permissions()
ci_setup(ci_qemu)
cpp_unittest(ci_qemu)
cpp_micro_unittest(ci_qemu)
sh (
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh",
label: 'Run microTVM tests',
Expand Down
Loading

0 comments on commit ef9fc51

Please sign in to comment.