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 25, 2022
1 parent c698cb5 commit d3cefda
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 1 deletion.
98 changes: 97 additions & 1 deletion Jenkinsfile

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

18 changes: 18 additions & 0 deletions ci/jenkins/Build.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,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 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:20220715-060127-37f9d3c49'
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
38 changes: 38 additions & 0 deletions ci/jenkins/Test.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,41 @@
)
{% endcall %}

def run_unittest_minimal() {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU-SMALL') {
ws({{ m.per_exec_ws('tvm/ut-python-cpu-minimal') }}) {
timeout(time: max_time, unit: 'MINUTES') {
try {
docker_init(ci_minimal)
init_git()
withEnv(['PLATFORM=minimal'], {
sh(
script: """
set -eux
aws s3 cp --no-progress s3://${s3_prefix}/cpu-minimal/build/libtvm.so build/libtvm.so
md5sum build/libtvm.so
aws s3 cp --no-progress s3://${s3_prefix}/cpu-minimal/build/libtvm_runtime.so build/libtvm_runtime.so
md5sum build/libtvm_runtime.so
aws s3 cp --no-progress s3://${s3_prefix}/cpu-minimal/build/config.cmake build/config.cmake
md5sum build/config.cmake
""",
label: 'Download artifacts from S3',
)
cpp_unittest(ci_minimal)
python_unittest(ci_minimal)
})
} finally {
{{ m.junit_to_s3() }}
junit 'build/pytest-results/*.xml'
}
}
}
}
} else {
Utils.markStageSkippedForConditional('unittest: CPU MINIMAL')
}
}

def test() {
stage('Test') {
Expand All @@ -199,6 +234,9 @@ stage('Test') {
{{ method_name }}()
},
{% endfor %}
'unittest: CPU MINIMAL': {
run_unittest_minimal()
},
{% call m.test_step(
name="unittest: CPU",
node="CPU-SMALL",
Expand Down
4 changes: 4 additions & 0 deletions ci/jenkins/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"name": "ci_cpu",
"platform": "CPU",
},
{
"name": "ci_minimal",
"platform": "CPU",
},
{
"name": "ci_gpu",
"platform": "CPU",
Expand Down

0 comments on commit d3cefda

Please sign in to comment.