diff --git a/Jenkinsfile b/Jenkinsfile index 7eab3e74d94c..dfa9a7eda284 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ // 'python3 jenkins/generate.py' // Note: This timestamp is here to ensure that updates to the Jenkinsfile are // always rebased on main before merging: -// Generated at 2022-11-15T16:25:54.047844 +// Generated at 2022-11-17T23:53:21.059864 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. --> @@ -729,28 +729,6 @@ def cmake_build(image, path, make_flag) { ) } -def add_microtvm_permissions() { - sh( - script: 'find build/microtvm_template_projects -type f | grep qemu-hack | xargs chmod +x', - label: 'Add execute permissions for microTVM files', - ) -} - -def add_hexagon_permissions() { - sh( - script: 'find build/hexagon_api_output -type f | xargs chmod +x', - label: 'Add execute permissions for hexagon files', - ) -} - -def add_crttest_permissions() { - sh( - script: 'chmod +x build/crttest', - label: 'Add execute permissions for crttest', - ) -} - - def build() { stage('Build') { environment { @@ -769,7 +747,7 @@ stage('Build') { cmake_build("${ci_gpu} --no-gpu", 'build', '-j2') make_standalone_crt("${ci_gpu} --no-gpu", 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/crttest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/libtvm_allvisible.so build/microtvm_template_projects build/crttest build/standalone_crt build/build.ninja", label: 'Upload artifacts to S3', ) @@ -780,7 +758,7 @@ stage('Build') { cmake_build("${ci_gpu} --no-gpu", 'build', '-j2') make_standalone_crt("${ci_gpu} --no-gpu", 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu2 --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/crttest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu2 --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/crttest build/standalone_crt build/build.ninja", label: 'Upload artifacts to S3', ) } @@ -806,7 +784,7 @@ stage('Build') { make_standalone_crt(ci_cpu, 'build') make_cpp_tests(ci_cpu, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/crttest build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/libtvm_allvisible.so build/crttest build/cpptest build/build.ninja build/CMakeFiles/rules.ninja build/standalone_crt build/build.ninja", label: 'Upload artifacts to S3', ) @@ -836,7 +814,7 @@ stage('Build') { cmake_build(ci_minimal, 'build', '-j2') make_cpp_tests(ci_minimal, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu-minimal --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu-minimal --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/libtvm_allvisible.so build/cpptest build/build.ninja build/CMakeFiles/rules.ninja", label: 'Upload artifacts to S3', ) } @@ -890,7 +868,7 @@ stage('Build') { make_standalone_crt(ci_i386, 'build') make_cpp_tests(ci_i386, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/i386 --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt build/crttest build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/i386 --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt build/build.ninja build/crttest build/cpptest build/build.ninja build/CMakeFiles/rules.ninja", label: 'Upload artifacts to S3', ) } @@ -916,7 +894,7 @@ stage('Build') { make_standalone_crt(ci_arm, 'build') make_cpp_tests(ci_arm, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/cpptest build/build.ninja build/CMakeFiles/rules.ninja build/crttest build/standalone_crt build/build.ninja", label: 'Upload artifacts to S3', ) } @@ -942,7 +920,7 @@ stage('Build') { make_standalone_crt(ci_cortexm, 'build') make_cpp_tests(ci_cortexm, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/crttest build/standalone_crt build/cpptest build/microtvm_template_projects", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/libtvm_allvisible.so build/crttest build/standalone_crt build/build.ninja build/cpptest build/build.ninja build/CMakeFiles/rules.ninja build/microtvm_template_projects", label: 'Upload artifacts to S3', ) } @@ -971,7 +949,7 @@ stage('Build') { label: 'Build Hexagon API', ) sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/cpptest build/hexagon_api_output", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/cpptest build/build.ninja build/CMakeFiles/rules.ninja build/hexagon_api_output", label: 'Upload artifacts to S3', ) } @@ -997,7 +975,7 @@ stage('Build') { make_standalone_crt(ci_riscv, 'build') make_cpp_tests(ci_riscv, 'build') sh( - script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/riscv --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/crttest build/cpptest build/microtvm_template_projects", + script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/riscv --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/libtvm_allvisible.so build/standalone_crt build/build.ninja build/crttest build/cpptest build/build.ninja build/CMakeFiles/rules.ninja build/microtvm_template_projects", label: 'Upload artifacts to S3', ) } @@ -1019,6 +997,13 @@ def cpp_unittest(image) { ) } +def micro_cpp_unittest(image) { + sh ( + script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_microtvm_cpp_tests.sh build", + label: 'Run microTVM C++ tests', + ) +} + // We have to do this whacky split of the code from where it's used since the // JVM limits method length to 64k and we easily exceed that with all this // autogenerated code. This makes it so each test step is in its own method so @@ -1039,7 +1024,7 @@ def shard_run_unittest_GPU_1_of_3() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu2 --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/crttest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu2", label: 'Download artifacts from S3', ) @@ -1051,7 +1036,7 @@ def shard_run_unittest_GPU_1_of_3() { sh "rm -rf build" sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/crttest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -1060,6 +1045,7 @@ def shard_run_unittest_GPU_1_of_3() { make_standalone_crt(ci_gpu, 'build') make_cpp_tests(ci_gpu, 'build') cpp_unittest(ci_gpu) + micro_cpp_unittest(ci_gpu) sh ( script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh", label: 'Run Python GPU unit tests', @@ -1104,7 +1090,7 @@ def shard_run_unittest_GPU_2_of_3() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -1157,7 +1143,7 @@ def shard_run_unittest_GPU_3_of_3() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -1207,7 +1193,7 @@ def shard_run_integration_CPU_1_of_4() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) @@ -1252,7 +1238,7 @@ def shard_run_integration_CPU_2_of_4() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) @@ -1297,7 +1283,7 @@ def shard_run_integration_CPU_3_of_4() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) @@ -1342,7 +1328,7 @@ def shard_run_integration_CPU_4_of_4() { 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) @@ -1388,12 +1374,13 @@ def shard_run_python_i386_1_of_3() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386 --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt build/crttest build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386", label: 'Download artifacts from S3', ) ci_setup(ci_i386) cpp_unittest(ci_i386) + micro_cpp_unittest(ci_i386) python_unittest(ci_i386) sh ( script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh", @@ -1435,7 +1422,7 @@ def shard_run_python_i386_2_of_3() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386 --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt build/crttest build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386", label: 'Download artifacts from S3', ) @@ -1482,7 +1469,7 @@ def shard_run_python_i386_3_of_3() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386 --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt build/crttest build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/i386", label: 'Download artifacts from S3', ) @@ -1529,7 +1516,7 @@ def shard_run_test_Hexagon_1_of_8() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1575,7 +1562,7 @@ def shard_run_test_Hexagon_2_of_8() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1620,7 +1607,7 @@ def shard_run_test_Hexagon_3_of_8() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1665,7 +1652,7 @@ def shard_run_test_Hexagon_4_of_8() { 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1710,7 +1697,7 @@ def shard_run_test_Hexagon_5_of_8() { 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1755,7 +1742,7 @@ def shard_run_test_Hexagon_6_of_8() { 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1800,7 +1787,7 @@ def shard_run_test_Hexagon_7_of_8() { 'TVM_SHARD_INDEX=6', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1845,7 +1832,7 @@ def shard_run_test_Hexagon_8_of_8() { 'TVM_SHARD_INDEX=7', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/hexagon_api_output build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/hexagon", label: 'Download artifacts from S3', ) @@ -1891,7 +1878,7 @@ def shard_run_integration_aarch64_1_of_4() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -1937,7 +1924,7 @@ def shard_run_integration_aarch64_2_of_4() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -1983,7 +1970,7 @@ def shard_run_integration_aarch64_3_of_4() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -2029,7 +2016,7 @@ def shard_run_integration_aarch64_4_of_4() { 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -2076,7 +2063,7 @@ def shard_run_topi_GPU_1_of_3() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2121,7 +2108,7 @@ def shard_run_topi_GPU_2_of_3() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2166,7 +2153,7 @@ def shard_run_topi_GPU_3_of_3() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2212,7 +2199,7 @@ def shard_run_frontend_GPU_1_of_6() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2257,7 +2244,7 @@ def shard_run_frontend_GPU_2_of_6() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2302,7 +2289,7 @@ def shard_run_frontend_GPU_3_of_6() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2347,7 +2334,7 @@ def shard_run_frontend_GPU_4_of_6() { 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2392,7 +2379,7 @@ def shard_run_frontend_GPU_5_of_6() { 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2437,7 +2424,7 @@ def shard_run_frontend_GPU_6_of_6() { 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -2483,12 +2470,13 @@ def shard_run_topi_aarch64_1_of_2() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) ci_setup(ci_arm) cpp_unittest(ci_arm) + micro_cpp_unittest(ci_arm) sh ( script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh", label: 'Run test_arm_compute_lib test', @@ -2533,7 +2521,7 @@ def shard_run_topi_aarch64_2_of_2() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -2583,7 +2571,7 @@ def shard_run_frontend_aarch64_1_of_2() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -2628,7 +2616,7 @@ def shard_run_frontend_aarch64_2_of_2() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/arm", label: 'Download artifacts from S3', ) @@ -2674,12 +2662,13 @@ def shard_run_test_Cortex_M_1_of_12() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) ci_setup(ci_cortexm) cpp_unittest(ci_cortexm) + micro_cpp_unittest(ci_cortexm) sh ( script: "${docker_run} ${ci_cortexm} ./tests/scripts/task_demo_microtvm.sh", label: 'Run microTVM demos', @@ -2724,7 +2713,7 @@ def shard_run_test_Cortex_M_2_of_12() { 'TVM_SHARD_INDEX=1', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2769,7 +2758,7 @@ def shard_run_test_Cortex_M_3_of_12() { 'TVM_SHARD_INDEX=2', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2814,7 +2803,7 @@ def shard_run_test_Cortex_M_4_of_12() { 'TVM_SHARD_INDEX=3', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2859,7 +2848,7 @@ def shard_run_test_Cortex_M_5_of_12() { 'TVM_SHARD_INDEX=4', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2904,7 +2893,7 @@ def shard_run_test_Cortex_M_6_of_12() { 'TVM_SHARD_INDEX=5', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2949,7 +2938,7 @@ def shard_run_test_Cortex_M_7_of_12() { 'TVM_SHARD_INDEX=6', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -2994,7 +2983,7 @@ def shard_run_test_Cortex_M_8_of_12() { 'TVM_SHARD_INDEX=7', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -3039,7 +3028,7 @@ def shard_run_test_Cortex_M_9_of_12() { 'TVM_SHARD_INDEX=8', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -3084,7 +3073,7 @@ def shard_run_test_Cortex_M_10_of_12() { 'TVM_SHARD_INDEX=9', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -3129,7 +3118,7 @@ def shard_run_test_Cortex_M_11_of_12() { 'TVM_SHARD_INDEX=10', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -3174,7 +3163,7 @@ def shard_run_test_Cortex_M_12_of_12() { 'TVM_SHARD_INDEX=11', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cortexm", label: 'Download artifacts from S3', ) @@ -3220,12 +3209,13 @@ def shard_run_test_RISC_V_1_of_1() { 'TVM_SHARD_INDEX=0', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/riscv --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/riscv", label: 'Download artifacts from S3', ) ci_setup(ci_riscv) cpp_unittest(ci_cortexm) + micro_cpp_unittest(ci_cortexm) sh ( script: "${docker_run} ${ci_riscv} ./tests/scripts/task_riscv_microtvm.sh", label: 'Run microTVM tests', @@ -3262,7 +3252,7 @@ def run_unittest_minimal() { docker_init(ci_minimal) withEnv(['PLATFORM=minimal'], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu-minimal --items build/libtvm.so build/libtvm_runtime.so build/config.cmake build/cpptest", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu-minimal", label: 'Download artifacts from S3', ) @@ -3454,12 +3444,13 @@ stage('Test') { 'TEST_STEP_NAME=unittest: CPU', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libvta_tsim.so build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/cpptest build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) ci_setup(ci_cpu) cpp_unittest(ci_cpu) + micro_cpp_unittest(ci_cpu) python_unittest(ci_cpu) fsim_test(ci_cpu) sh ( @@ -3498,7 +3489,7 @@ stage('Test') { 'TEST_STEP_NAME=frontend: CPU', "SKIP_SLOW_TESTS=${skip_slow_tests}"], { sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/cpu", label: 'Download artifacts from S3', ) @@ -3534,7 +3525,7 @@ stage('Test') { init_git() docker_init(ci_gpu) sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu --items build/libtvm.so build/libvta_fsim.so build/libtvm_runtime.so build/config.cmake build/microtvm_template_projects build/standalone_crt", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu", label: 'Download artifacts from S3', ) @@ -3655,7 +3646,7 @@ def deploy() { timeout(time: max_time, unit: 'MINUTES') { init_git() sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/docs --items docs.tgz", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/docs", label: 'Download artifacts from S3', ) diff --git a/ci/jenkins/Build.groovy.j2 b/ci/jenkins/Build.groovy.j2 index 04499712c7b1..914e3e99b659 100644 --- a/ci/jenkins/Build.groovy.j2 +++ b/ci/jenkins/Build.groovy.j2 @@ -56,34 +56,6 @@ def cmake_build(image, path, make_flag) { ) } -def add_microtvm_permissions() { - {% for folder in microtvm_template_projects %} - sh( - script: 'find {{ folder }} -type f | grep qemu-hack | xargs chmod +x', - label: 'Add execute permissions for microTVM files', - ) - {% endfor %} -} - -def add_hexagon_permissions() { - {% for folder in hexagon_api %} - sh( - script: 'find {{ folder }} -type f | xargs chmod +x', - label: 'Add execute permissions for hexagon files', - ) - {% endfor %} -} - -def add_crttest_permissions() { - {% for file in crttest %} - sh( - script: 'chmod +x {{ file }}', - label: 'Add execute permissions for crttest', - ) - {% endfor %} -} - - def build() { stage('Build') { environment { @@ -101,7 +73,7 @@ stage('Build') { sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh build" cmake_build("${ci_gpu} --no-gpu", 'build', '-j2') make_standalone_crt("${ci_gpu} --no-gpu", 'build') - {{ m.upload_artifacts(tag='gpu', filenames=tvm_multilib + microtvm_template_projects + crttest + standalone_crt) }} + {{ m.upload_artifacts(tag='gpu', filenames=tvm_multilib + tvm_allvisible + microtvm_template_projects + crttest + standalone_crt) }} // compiler test sh "rm -rf build" @@ -125,7 +97,7 @@ stage('Build') { cmake_build(ci_cpu, 'build', '-j2') make_standalone_crt(ci_cpu, 'build') make_cpp_tests(ci_cpu, 'build') - {{ m.upload_artifacts(tag='cpu', filenames=tvm_multilib_tsim + crttest + cpptest + standalone_crt) }} + {{ m.upload_artifacts(tag='cpu', filenames=tvm_multilib_tsim + tvm_allvisible + crttest + cpptest + standalone_crt) }} ci_setup(ci_cpu) // sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh" // TODO(@jroesch): need to resolve CI issue will turn back on in follow up patch @@ -145,7 +117,7 @@ stage('Build') { ) cmake_build(ci_minimal, 'build', '-j2') make_cpp_tests(ci_minimal, 'build') - {{ m.upload_artifacts(tag='cpu-minimal', filenames=tvm_lib + cpptest) }} + {{ m.upload_artifacts(tag='cpu-minimal', filenames=tvm_lib + tvm_allvisible + cpptest) }} {% endcall %} {% call m.build_step( @@ -201,7 +173,7 @@ stage('Build') { cmake_build(ci_arm, 'build', '-j4') make_standalone_crt(ci_arm, 'build') make_cpp_tests(ci_arm, 'build') - {{ m.upload_artifacts(tag='arm', filenames=tvm_multilib + cpptest + standalone_crt) }} + {{ m.upload_artifacts(tag='arm', filenames=tvm_multilib + cpptest + crttest + standalone_crt) }} {% endcall %} {% call m.build_step( @@ -218,7 +190,7 @@ stage('Build') { cmake_build(ci_cortexm, 'build', '-j2') make_standalone_crt(ci_cortexm, 'build') make_cpp_tests(ci_cortexm, 'build') - {{ m.upload_artifacts(tag='cortexm', filenames=tvm_lib + crttest + standalone_crt + cpptest + microtvm_template_projects) }} + {{ m.upload_artifacts(tag='cortexm', filenames=tvm_lib + tvm_allvisible + crttest + standalone_crt + cpptest + microtvm_template_projects) }} {% endcall %} {% call m.build_step( @@ -255,7 +227,7 @@ stage('Build') { cmake_build(ci_riscv, 'build', '-j2') make_standalone_crt(ci_riscv, 'build') make_cpp_tests(ci_riscv, 'build') - {{ m.upload_artifacts(tag='riscv', filenames=tvm_lib + crttest + cpptest + microtvm_template_projects) }} + {{ m.upload_artifacts(tag='riscv', filenames=tvm_lib + tvm_allvisible + standalone_crt + crttest + cpptest + microtvm_template_projects) }} {% endcall %} ) diff --git a/ci/jenkins/Deploy.groovy.j2 b/ci/jenkins/Deploy.groovy.j2 index f11d901258f6..9bb6257f7a74 100644 --- a/ci/jenkins/Deploy.groovy.j2 +++ b/ci/jenkins/Deploy.groovy.j2 @@ -91,7 +91,7 @@ def deploy() { ws="tvm/deploy-docs", ) %} init_git() - {{ m.download_artifacts(tag='docs', filenames=["docs.tgz"]) }} + {{ m.download_artifacts(tag='docs') }} deploy_docs() {% endcall %} {% call m.deploy_step( diff --git a/ci/jenkins/Jenkinsfile.j2 b/ci/jenkins/Jenkinsfile.j2 index 5e15b608e2f6..2a3ade049361 100644 --- a/ci/jenkins/Jenkinsfile.j2 +++ b/ci/jenkins/Jenkinsfile.j2 @@ -94,13 +94,14 @@ rebuild_docker_images = false // Filenames for stashing between build and test steps {% set tvm_runtime = ['build/libtvm_runtime.so', 'build/config.cmake'] %} {% set crttest = ['build/crttest'] %} -{% set cpptest = ['build/cpptest'] %} +{% set tvm_allvisible = ['build/libtvm_allvisible.so'] %} +{% set cpptest = ['build/cpptest', 'build/build.ninja', 'build/CMakeFiles/rules.ninja'] %} {% set tvm_lib = ['build/libtvm.so'] + tvm_runtime %} {% set tvm_multilib = ['build/libtvm.so', 'build/libvta_fsim.so'] + tvm_runtime %} {% set tvm_multilib_tsim = ['build/libvta_tsim.so'] + tvm_multilib %} {% set microtvm_template_projects = ['build/microtvm_template_projects',] %} {% set hexagon_api = ['build/hexagon_api_output',] %} -{% set standalone_crt = ['build/standalone_crt'] %} +{% set standalone_crt = ['build/standalone_crt', 'build/build.ninja'] %} s3_bucket = 'tvm-jenkins-artifacts-prod' s3_prefix = "tvm/${env.BRANCH_NAME}/${env.BUILD_NUMBER}" diff --git a/ci/jenkins/Test.groovy.j2 b/ci/jenkins/Test.groovy.j2 index 4000e39ab2a9..eb7c8fdc0c0d 100644 --- a/ci/jenkins/Test.groovy.j2 +++ b/ci/jenkins/Test.groovy.j2 @@ -7,6 +7,13 @@ def cpp_unittest(image) { ) } +def micro_cpp_unittest(image) { + sh ( + script: "${docker_run} --env CI_NUM_EXECUTORS ${image} ./tests/scripts/task_microtvm_cpp_tests.sh build", + label: 'Run microTVM C++ tests', + ) +} + // We have to do this whacky split of the code from where it's used since the // JVM limits method length to 64k and we easily exceed that with all this // autogenerated code. This makes it so each test step is in its own method so @@ -21,7 +28,7 @@ def cpp_unittest(image) { test_method_names=test_method_names, ) %} {% if shard_index == 1 %} - {{ m.download_artifacts(tag='gpu2', filenames=tvm_multilib + crttest + standalone_crt) }} + {{ m.download_artifacts(tag='gpu2') }} sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu_other.sh build" // These require a GPU to finish the build (i.e. CUDA needs to be load-able) make_standalone_crt(ci_gpu, 'build') @@ -29,14 +36,15 @@ def cpp_unittest(image) { // cpp_unittest(ci_gpu) sh "rm -rf build" - {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib + microtvm_template_projects + crttest + standalone_crt) }} + {{ m.download_artifacts(tag='gpu') }} ci_setup(ci_gpu) sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh build" make_standalone_crt(ci_gpu, 'build') make_cpp_tests(ci_gpu, 'build') cpp_unittest(ci_gpu) + micro_cpp_unittest(ci_gpu) {% else %} - {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }} + {{ m.download_artifacts(tag='gpu') }} ci_setup(ci_gpu) {% endif %} {% if shard_index == 2 or num_shards < 2 %} @@ -63,7 +71,7 @@ def cpp_unittest(image) { docker_image="ci_cpu", test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='cpu', filenames=tvm_multilib_tsim + standalone_crt) }} + {{ m.download_artifacts(tag='cpu') }} ci_setup(ci_cpu) sh ( script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh", @@ -79,10 +87,11 @@ def cpp_unittest(image) { docker_image="ci_i386", test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='i386', filenames=tvm_multilib_tsim + standalone_crt + crttest + cpptest) }} + {{ m.download_artifacts(tag='i386') }} ci_setup(ci_i386) {% if shard_index == 1 %} cpp_unittest(ci_i386) + micro_cpp_unittest(ci_i386) {% endif %} python_unittest(ci_i386) sh ( @@ -102,7 +111,7 @@ def cpp_unittest(image) { test_method_names=test_method_names, num_shards=8, ) %} - {{ m.download_artifacts(tag='hexagon', filenames=tvm_lib + hexagon_api + cpptest) }} + {{ m.download_artifacts(tag='hexagon') }} ci_setup(ci_hexagon) {% if shard_index == 1 %} cpp_unittest(ci_hexagon) @@ -121,7 +130,7 @@ def cpp_unittest(image) { docker_image="ci_arm", test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='arm', filenames=tvm_multilib + standalone_crt) }} + {{ m.download_artifacts(tag='arm') }} ci_setup(ci_arm) python_unittest(ci_arm) sh ( @@ -138,7 +147,7 @@ def cpp_unittest(image) { docker_image="ci_gpu", test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }} + {{ m.download_artifacts(tag='gpu') }} ci_setup(ci_gpu) sh ( script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh", @@ -154,7 +163,7 @@ def cpp_unittest(image) { docker_image="ci_gpu", test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib) }} + {{ m.download_artifacts(tag='gpu') }} ci_setup(ci_gpu) sh ( script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh", @@ -170,10 +179,11 @@ def cpp_unittest(image) { num_shards=2, test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='arm', filenames=tvm_multilib + cpptest) }} + {{ m.download_artifacts(tag='arm') }} ci_setup(ci_arm) {% if shard_index == 1 %} cpp_unittest(ci_arm) + micro_cpp_unittest(ci_arm) {% endif %} sh ( script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh", @@ -193,7 +203,7 @@ def cpp_unittest(image) { num_shards=2, test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='arm', filenames=tvm_multilib) }} + {{ m.download_artifacts(tag='arm') }} ci_setup(ci_arm) sh ( script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_frontend_cpu.sh", @@ -209,10 +219,11 @@ def cpp_unittest(image) { num_shards=12, test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='cortexm', filenames=tvm_lib + microtvm_template_projects + cpptest + standalone_crt) }} + {{ m.download_artifacts(tag='cortexm') }} ci_setup(ci_cortexm) {% if shard_index == 1%} cpp_unittest(ci_cortexm) + micro_cpp_unittest(ci_cortexm) sh ( script: "${docker_run} ${ci_cortexm} ./tests/scripts/task_demo_microtvm.sh", label: 'Run microTVM demos', @@ -232,10 +243,11 @@ def cpp_unittest(image) { num_shards=1, test_method_names=test_method_names, ) %} - {{ m.download_artifacts(tag='riscv', filenames=tvm_lib + microtvm_template_projects + cpptest) }} + {{ m.download_artifacts(tag='riscv') }} ci_setup(ci_riscv) {% if shard_index == 1%} cpp_unittest(ci_cortexm) + micro_cpp_unittest(ci_cortexm) {% endif %} sh ( script: "${docker_run} ${ci_riscv} ./tests/scripts/task_riscv_microtvm.sh", @@ -251,7 +263,7 @@ def run_unittest_minimal() { platform="minimal", docker_image="ci_minimal", ) %} - {{ m.download_artifacts(tag='cpu-minimal', filenames=tvm_lib + cpptest) }} + {{ m.download_artifacts(tag='cpu-minimal') }} cpp_unittest(ci_minimal) python_unittest(ci_minimal) {% endcall %} @@ -278,9 +290,10 @@ stage('Test') { platform="cpu", docker_image="ci_cpu", ) %} - {{ m.download_artifacts(tag='cpu', filenames=tvm_multilib_tsim + cpptest + standalone_crt) }} + {{ m.download_artifacts(tag='cpu') }} ci_setup(ci_cpu) cpp_unittest(ci_cpu) + micro_cpp_unittest(ci_cpu) python_unittest(ci_cpu) fsim_test(ci_cpu) sh ( @@ -295,7 +308,7 @@ stage('Test') { platform="cpu", docker_image="ci_cpu", ) %} - {{ m.download_artifacts(tag='cpu', filenames=tvm_multilib) }} + {{ m.download_artifacts(tag='cpu') }} ci_setup(ci_cpu) sh ( script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_frontend_cpu.sh", @@ -308,7 +321,7 @@ stage('Test') { ws({{ m.per_exec_ws('tvm/docs-python-gpu') }}) { init_git() docker_init(ci_gpu) - {{ m.download_artifacts(tag='gpu', filenames=tvm_multilib + microtvm_template_projects + standalone_crt) }} + {{ m.download_artifacts(tag='gpu') }} timeout(time: 180, unit: 'MINUTES') { ci_setup(ci_gpu) sh ( diff --git a/ci/jenkins/macros.j2 b/ci/jenkins/macros.j2 index 3fec2cc741ca..ff59a4046179 100644 --- a/ci/jenkins/macros.j2 +++ b/ci/jenkins/macros.j2 @@ -191,10 +191,9 @@ sh( ) {% endmacro %} -{% macro download_artifacts(tag, filenames) %} -{% set items = ' '.join(filenames) %} +{% macro download_artifacts(tag) %} sh( - script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/{{ tag }} --items {{ items }}", + script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/{{ tag }}", label: 'Download artifacts from S3', ) {% endmacro %} diff --git a/ci/scripts/jenkins/cmd_utils.py b/ci/scripts/jenkins/cmd_utils.py index 52eaf9ac0ad2..1b282c50ba0f 100644 --- a/ci/scripts/jenkins/cmd_utils.py +++ b/ci/scripts/jenkins/cmd_utils.py @@ -20,6 +20,7 @@ import logging import sys import re +import tempfile from pathlib import Path from typing import List @@ -53,6 +54,16 @@ def __init__(self, env=None, cwd=None): self.env.update(env) self.cwd = cwd + def tee(self, cmd: str, **kwargs): + """ + Run 'cmd' in a shell then return the (process, stdout) as a tuple + """ + with tempfile.NamedTemporaryFile(delete=False) as f: + proc = self.run(f"{cmd} | tee {f.name}", **kwargs) + with open(f.name, "r") as f: + output = f.read() + return proc, output + def run(self, cmd: str, **kwargs): logging.info(f"+ {cmd}") defaults = { diff --git a/ci/scripts/jenkins/s3.py b/ci/scripts/jenkins/s3.py index c823a0fb9a65..f5aa535df8c4 100755 --- a/ci/scripts/jenkins/s3.py +++ b/ci/scripts/jenkins/s3.py @@ -18,11 +18,21 @@ import argparse import logging +import re from pathlib import Path +from typing import List +from enum import Enum from cmd_utils import Sh, REPO_ROOT, init_log RETRY_SCRIPT = REPO_ROOT / "ci" / "scripts" / "jenkins" / "retry.sh" +S3_DOWNLOAD_REGEX = re.compile(r"download: s3://.* to (.*)") +SH = Sh() + + +class Action(Enum): + UPLOAD = 1 + DOWNLOAD = 2 def show_md5(item: str) -> None: @@ -30,10 +40,48 @@ def show_md5(item: str) -> None: sh.run(f"md5sum {item}") -def is_file(bucket: str, prefix: str) -> bool: - cmd = f"aws s3api head-object --bucket {bucket} --key {prefix}" - proc = Sh().run(cmd, check=False) - return proc.returncode == 0 +def parse_output_files(stdout: str) -> List[str]: + """ + Grab the list of downloaded files from the output of 'aws s3 cp'. Lines look + like: + + download: s3://some/prefix/a_file.txt to a_file.txt + """ + files = [] + for line in stdout.split("\n"): + line = line.strip() + if line == "": + continue + m = S3_DOWNLOAD_REGEX.match(line) + if m: + files.append(m.groups()[0]) + + return files + + +def chmod(files: List[str]) -> None: + """ + S3 has no concept of file permissions so add them back in here to every file + """ + # Add execute bit for downloads + to_chmod = [str(f) for f in files] + logging.info(f"Adding execute bit for files: {to_chmod}") + if len(to_chmod) > 0: + SH.run(f"chmod +x {' '.join(to_chmod)}") + + +def s3(source: str, destination: str, recursive: bool) -> List[str]: + """ + Send or download the source to the destination in S3 + """ + cmd = f". {RETRY_SCRIPT.relative_to(REPO_ROOT)} && retry 3 aws s3 cp --no-progress" + + if recursive: + cmd += " --recursive" + + cmd += f" {source} {destination}" + _, stdout = SH.tee(cmd) + return stdout if __name__ == "__main__": @@ -45,7 +93,7 @@ def is_file(bucket: str, prefix: str) -> bool: parser.add_argument( "--prefix", help="s3 bucket + tag (e.g. s3://tvm-ci-prod/PR-1234/cpu", required=True ) - parser.add_argument("--items", help="files and folders to upload", nargs="+", required=True) + parser.add_argument("--items", help="files and folders to upload", nargs="+") args = parser.parse_args() logging.info(args) @@ -61,48 +109,32 @@ def is_file(bucket: str, prefix: str) -> bool: logging.info(f"Using s3 path: {s3_path}") if args.action == "upload": - upload = True + action = Action.UPLOAD elif args.action == "download": - upload = False + action = Action.DOWNLOAD else: logging.error(f"Unsupported action: {args.action}") exit(1) - for item in args.items: - destination = s3_path + "/" + item - recursive_arg = "" - - if upload: - # Show md5 before uploading - show_md5(item) - - # Download/upload the item - cmd = f". {RETRY_SCRIPT.relative_to(REPO_ROOT)} && retry 3 aws s3 cp --no-progress" - if upload and Path(item).is_dir(): - cmd += " --recursive" - if not upload and not is_file(args.bucket, prefix + "/" + item): - cmd += " --recursive" - - if upload: - cmd += f" {item} {destination}" + if args.items is None: + if args.action == "upload": + logging.error(f"Cannot upload without --items") + exit(1) else: - cmd += f" {destination} {item}" - sh.run(cmd) - - if not upload: - to_chmod = [] - print(item) - if Path(item).is_dir(): - to_chmod = [f for f in Path(item).glob("**/*") if not f.is_dir()] - else: - to_chmod = [item] - - # Add execute bit for downloads - to_chmod = [str(f) for f in to_chmod] - logging.info(f"Adding execute bit for files: {to_chmod}") - if len(to_chmod) > 0: - sh.run(f"chmod +x {' '.join(to_chmod)}") - - if not upload: - # Show md5 after downloading + # Download the whole prefix + items = ["."] + + else: + items = args.items + + for item in items: + if action == Action.DOWNLOAD: + stdout = s3(source=s3_path, destination=item, recursive=True) + files = parse_output_files(stdout) + chmod(files) + for file in files: + # Show md5 after downloading + show_md5(file) + elif action == Action.UPLOAD: show_md5(item) + s3(item, s3_path + "/" + item, recursive=Path(item).is_dir()) diff --git a/tests/scripts/task_cpp_unittest.sh b/tests/scripts/task_cpp_unittest.sh index 0df2656a1ea0..bc152dfba34f 100755 --- a/tests/scripts/task_cpp_unittest.sh +++ b/tests/scripts/task_cpp_unittest.sh @@ -38,5 +38,6 @@ export TVM_BIND_THREADS=0 export OMP_NUM_THREADS=1 pushd "${BUILD_DIR}" -ctest --gtest_death_test_style=threadsafe +# run cpp test executable +./cpptest popd diff --git a/tests/scripts/task_microtvm_cpp_tests.sh b/tests/scripts/task_microtvm_cpp_tests.sh index 4e6297d39eec..cc36963afa5b 100755 --- a/tests/scripts/task_microtvm_cpp_tests.sh +++ b/tests/scripts/task_microtvm_cpp_tests.sh @@ -33,9 +33,7 @@ export TVM_BIND_THREADS=0 export OMP_NUM_THREADS=1 # crttest requries USE_MICRO to be enabled. -pushd "${BUILD_DIR}" -ninja crttest -popd +./build/crttest # Test MISRA-C runtime. It requires USE_MICRO to be enabled. pushd apps/bundle_deploy