Skip to content

Commit

Permalink
[microTVM] enable building microTVM components by default (apache#13073)
Browse files Browse the repository at this point in the history
* enable micro by default

* apply patch for ranlib fix

* exclude windows build from including cctools

* remove check for USE_MICRO to build crttest

* disable USE_MICRO for hexagon builds

* remove USE_MICRO conditional from TVM python package init

* remove USE_MICRO restrictions for hexagon build

* remove USE_MICRO conditional for MISRA-C test

* set USE_MICRO to ON in tvm_option, set USE_MICRO to OFF for now in CPU minimal build

Co-authored-by: Mehrdad Hessar <mhessar@octoml.ai>
  • Loading branch information
alanmacd and mehrdadh authored Nov 22, 2022
1 parent f38dbbb commit e662970
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 14 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tvm_option(USE_OPENMP "Build with OpenMP thread pool implementation" OFF)
tvm_option(USE_RELAY_DEBUG "Building Relay in debug mode..." OFF)
tvm_option(USE_RTTI "Build with RTTI" ON)
tvm_option(USE_MSVC_MT "Build with MT" OFF)
tvm_option(USE_MICRO "Build with Micro TVM support" OFF)
tvm_option(USE_MICRO "Build with Micro TVM support" ON)
tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)
tvm_option(HIDE_PRIVATE_SYMBOLS "Compile with -fvisibility=hidden." OFF)
tvm_option(USE_TF_TVMDSOOP "Build with TensorFlow TVMDSOOp" OFF)
Expand Down Expand Up @@ -118,6 +118,11 @@ tvm_option(USE_CLML "Build with CLML Codegen support" OFF)
tvm_option(USE_CLML_GRAPH_EXECUTOR "Build with CLML graph runtime" OFF)
tvm_option(USE_UMA "Build with UMA support" OFF)

# disable microTVM for iOS and hexagon builds
if(${CMAKE_SYSTEM_NAME} MATCHES "iOS" OR USE_HEXAGON)
set(USE_MICRO OFF)
endif()

# include directories
include_directories(${CMAKE_INCLUDE_PATH})
include_directories("include")
Expand Down
3 changes: 0 additions & 3 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ set(USE_SPIRV_KHR_INTEGER_DOT_PRODUCT OFF)
# Whether enable OpenGL runtime
set(USE_OPENGL OFF)

# Whether enable MicroTVM runtime
set(USE_MICRO OFF)

# Whether enable RPC runtime
set(USE_RPC ON)

Expand Down
3 changes: 3 additions & 0 deletions conda/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ rm -rf build || true
mkdir -p build
cd build

export PREFIX="${PREFIX}/"
cp -f ${PREFIX}/bin/ranlib $PREFIX

cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_RPC=ON \
Expand Down
3 changes: 3 additions & 0 deletions conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ requirements:
host:
- zlib
- llvmdev >=11
- cctools # [not win]

outputs:
- name: {{ pkg_name }}-libs
Expand All @@ -62,10 +63,12 @@ outputs:
- llvmdev >=11
- {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda]
- cudnn >=7.6.0 # [cuda]
- cctools # [not win]
run:
- llvmdev >=11
- {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda]
- cudnn >=7.6.0 # [cuda]
- cctools # [not win]

- name: {{ pkg_name }}
script: install_tvm_python.sh # [not win]
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_LLVM llvm-config-8\) >> config.cmake
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_cortexm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cd "$BUILD_DIR"
cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
echo set\(USE_ETHOSU ON\) >> config.cmake
echo set\(USE_UMA ON\) >> config.cmake
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cd "$BUILD_DIR"
cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_DNNL ON\) >> config.cmake
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ echo set\(USE_CUDA ON\) >> config.cmake
echo set\(USE_VULKAN ON\) >> config.cmake
echo set\(USE_OPENGL ON\) >> config.cmake
echo set\(USE_OPENCL ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_LLVM \"/usr/bin/llvm-config-9 --link-static\"\) >> config.cmake
echo set\(USE_NNPACK ON\) >> config.cmake
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_gpu_other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ cp ../cmake/config.cmake .

echo set\(USE_OPENCL ON\) >> config.cmake
echo set\(USE_ROCM ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_LIBBACKTRACE OFF\) >> config.cmake
echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
Expand Down
2 changes: 0 additions & 2 deletions tests/scripts/task_config_build_hexagon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_LLVM "${CLANG_LLVM_HOME}/bin/llvm-config"\) >> config.cmake

if [[ ${CI:-false} == "true" ]]; then
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_i386.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_LLVM llvm-config-4.0\) >> config.cmake
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/task_config_build_minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
echo set\(USE_LIBBACKTRACE ON\) >> config.cmake
echo set\(USE_CCACHE OFF\) >> config.cmake
echo set\(SUMMARIZE ON\) >> config.cmake
echo set\(USE_MICRO OFF\) >> config.cmake
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_riscv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cd "$BUILD_DIR"
cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
echo set\(USE_UMA ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cd "$BUILD_DIR"
cp ../cmake/config.cmake .

echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_PROFILER ON\) >> config.cmake
echo set\(USE_LLVM llvm-config-11\) >> config.cmake
Expand Down

0 comments on commit e662970

Please sign in to comment.