Skip to content

Commit

Permalink
Write TVM build options to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin-Gabriel Blanaru authored and gigiblender committed Aug 8, 2022
1 parent 97b07ca commit db5d34d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 112 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,5 @@ find_and_set_linker(${USE_ALTERNATIVE_LINKER})
if(${SUMMARIZE})
print_summary()
endif()

dump_options_to_file("${TVM_ALL_OPTIONS}")
17 changes: 1 addition & 16 deletions Jenkinsfile

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

9 changes: 0 additions & 9 deletions ci/jenkins/Build.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ 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 %}
sh(
Expand Down Expand Up @@ -160,7 +152,6 @@ 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
6 changes: 0 additions & 6 deletions ci/jenkins/Test.groovy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
{% 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 @@ -70,7 +68,6 @@
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 @@ -95,7 +92,6 @@
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 @@ -164,7 +160,6 @@
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 @@ -254,7 +249,6 @@ 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 Down
7 changes: 7 additions & 0 deletions cmake/utils/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ macro(print_summary)
message(STATUS ${OUT} " : " ${OPTION_VALUE})
endforeach()
endmacro()

function(dump_options_to_file tvm_options)
file(REMOVE ${CMAKE_BINARY_DIR}/TVMBuildOptions.txt)
foreach(option ${tvm_options})
file(APPEND ${CMAKE_BINARY_DIR}/TVMBuildOptions.txt "${option} ${${option}} \n")
endforeach()
endfunction()
12 changes: 0 additions & 12 deletions tests/python/unittest/test_meta_schedule_task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,6 @@ def test_meta_schedule_task_scheduler_override_next_task_id_only(): # pylint: d
)


def should_skip_oob_test():
flags = libinfo()
# TODO(gigiblender) This combination of flags should be enabled only in the ci_minimal CI configuration.
# Remove this once the OOB test is fixed.
return (
flags["USE_RELAY_DEBUG"] == "ON"
and flags["USE_LLVM"] == "llvm-config"
and flags["USE_MICRO"] != "ON"
)


@pytest.mark.skipif(should_skip_oob_test(), reason="Does array access OOB. Remove once fixed.")
def test_meta_schedule_task_scheduler_multiple_gradient_based():
num_trials_per_iter = 6
max_trials_per_task = 101
Expand Down
11 changes: 0 additions & 11 deletions tests/scripts/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,18 +556,13 @@ def add_subparser(


CPP_UNITTEST = ("run c++ unitests", ["./tests/scripts/task_cpp_unittest.sh {build_dir}"])
CPP_MICRO_UNITTEST = (
"run micro c++ unitests",
["./tests/scripts/task_cpp_unittest_micro.sh {build_dir}"],
)

generated = [
generate_command(
name="gpu",
help="Run GPU build and test(s)",
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"topi": ("run topi tests", ["./tests/scripts/task_python_topi.sh"]),
"unittest": (
"run unit tests",
Expand All @@ -585,7 +580,6 @@ def add_subparser(
help="Run CPU build and test(s)",
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"integration": (
"run integration tests",
["./tests/scripts/task_python_integration.sh"],
Expand Down Expand Up @@ -619,7 +613,6 @@ def add_subparser(
help="Run i386 build and test(s)",
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"integration": (
"run integration tests",
[
Expand All @@ -634,7 +627,6 @@ def add_subparser(
help="Run WASM build and test(s)",
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"test": ("run WASM tests", ["./tests/scripts/task_web_wasm.sh"]),
},
),
Expand All @@ -643,7 +635,6 @@ def add_subparser(
help="Run Cortex-M build and test(s)",
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"test": (
"run microTVM tests",
[
Expand All @@ -659,7 +650,6 @@ def add_subparser(
post_build=["./tests/scripts/task_build_hexagon_api.sh --output build-hexagon"],
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"test": (
"run Hexagon API/Python tests",
[
Expand All @@ -674,7 +664,6 @@ def add_subparser(
precheck=check_arm_qemu,
options={
"cpp": CPP_UNITTEST,
"micro_cpp": CPP_MICRO_UNITTEST,
"python": (
"run full Python tests",
[
Expand Down
15 changes: 15 additions & 0 deletions tests/scripts/task_cpp_unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,22 @@ python3 tests/scripts/task_build.py \
--cmake-target cpptest \
--build-dir "${BUILD_DIR}"

# crttest requries USE_MICRO to be enabled.
if grep -Fq "USE_MICRO ON" ${BUILD_DIR}/TVMBuildOptions.txt; then
pushd "${BUILD_DIR}"
ninja crttest
popd
fi

pushd "${BUILD_DIR}"
ctest --gtest_death_test_style=threadsafe
popd

# Test MISRA-C runtime. It requires USE_MICRO to be enabled.
if grep -Fq "USE_MICRO ON" ${BUILD_DIR}/TVMBuildOptions.txt; then
pushd apps/bundle_deploy
rm -rf build
make test_dynamic test_static
popd
fi

58 changes: 0 additions & 58 deletions tests/scripts/task_cpp_unittest_micro.sh

This file was deleted.

0 comments on commit db5d34d

Please sign in to comment.