Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TVM EP] Rename Standalone TVM (STVM) Execution Provider to TVM EP #10260

Merged
merged 35 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b99a5a4
update java API for STVM EP. Issue is from PR#10019
Dec 17, 2021
0d4573b
use_stvm -> use_tvm
Jan 10, 2022
444591d
rename stvm worktree
Jan 10, 2022
810d7e6
STVMAllocator -> TVMAllocator
Jan 11, 2022
d7681b2
StvmExecutionProviderInfo -> TvmExecutionProviderInfo
Jan 11, 2022
f9b1003
stvm -> tvm for cpu_targets. resolve onnxruntime::tvm and origin tvm …
Jan 11, 2022
21146f8
STVMRunner -> TVMRunner
Jan 11, 2022
924870d
StvmExecutionProvider -> TvmExecutionProvider
Jan 11, 2022
da15811
tvm::env_vars
Jan 11, 2022
c2cb0e3
StvmProviderFactory -> TvmProviderFactory
Jan 11, 2022
5764994
rename factory funcs
Jan 11, 2022
d06dc1e
StvmCPUDataTransfer -> TvmCPUDataTransfer
Jan 11, 2022
32cc2ce
small clean
Jan 11, 2022
fbd6682
STVMFuncState -> TVMFuncState
Jan 11, 2022
3c553f5
USE_TVM -> NUPHAR_USE_TVM
Jan 11, 2022
9284378
USE_STVM -> USE_TVM
Jan 11, 2022
7cb9d83
python API: providers.stvm -> providers.tvm. clean TVM_EP.md
Jan 11, 2022
d9358d0
clean build scripts #1
Jan 11, 2022
68c998d
clean build scripts, java frontend and others #2
Jan 12, 2022
b2868b0
once more clean #3
Jan 12, 2022
d60e5df
fix build of nuphar tvm test
Jan 12, 2022
3565b3d
final transfer stvm namespace to onnxruntime::tvm
Jan 12, 2022
44602e7
rename stvm->tvm
KJlaccHoeUM9l Jan 12, 2022
e93032b
NUPHAR_USE_TVM -> USE_NUPHAR_TVM
Jan 14, 2022
61673d6
small fixes for correct CI tests
Jan 20, 2022
dd255dd
clean after rebase. Last renaming stvm to tvm, separate TVM and Nupha…
Feb 1, 2022
5da0db9
update CUDA support for TVM EP
KJlaccHoeUM9l Feb 1, 2022
324c037
roll back CudaNN home check
Feb 2, 2022
39f18e5
ERROR for not positive input shape dimension instead of WARNING
Feb 2, 2022
50b4a47
update documentation for CUDA
KJlaccHoeUM9l Feb 4, 2022
f798af1
small corrections after review
Feb 7, 2022
94b876b
update GPU description
KJlaccHoeUM9l Feb 7, 2022
0ed6ed5
update GPU description
KJlaccHoeUM9l Feb 7, 2022
48e5400
misprints were fixed
Feb 9, 2022
1a2592e
cleaned up error msgs
tmoreau89 Feb 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cgmanifests/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"commitHash": "638d7d2407de27f98f542f61a37a33c90a2e75a9",
"repositoryUrl": "https://github.com/microsoft/onnxruntime-tvm.git"
},
"comments": "needed for nuphar"
"comments": "needed for Nuphar EP"
}
},
{
"component": {
"type": "git",
"git": {
"commitHash": "7b3a22e465dd6aca4729504a19beb4bc23312755",
"commitHash": "36b48a5707321adba8a70e14da443566a9391e5a",
"repositoryUrl": "https://github.com/apache/tvm.git"
},
"comments": "needed for EP STVM"
"comments": "needed for TVM EP"
}
},
{
Expand Down
143 changes: 75 additions & 68 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ option(onnxruntime_BUILD_OBJC "Build Objective-C library" OFF)
option(onnxruntime_USE_PREINSTALLED_EIGEN "Use pre-installed EIGEN. Need to provide eigen_SOURCE_PATH if turn this on." OFF)
option(onnxruntime_BUILD_BENCHMARKS "Build ONNXRuntime micro-benchmarks" OFF)

option(onnxruntime_USE_TVM "Build TVM for code generation." OFF)
option(onnxruntime_USE_NUPHAR_TVM "Build TVM for code generation for NUPHAR EP" OFF)
option(onnxruntime_USE_LLVM "Build TVM with LLVM" OFF)

option(onnxruntime_BUILD_FOR_NATIVE_MACHINE "Enable this option for turning on optimization specific to this machine" OFF)
Expand Down Expand Up @@ -104,7 +104,8 @@ option(onnxruntime_USE_MIMALLOC "Override new/delete and arena allocator with mi
#It's default OFF because it's experimental now.
option(onnxruntime_PREFER_SYSTEM_LIB "Experimental: Build with the preinstalled libraries in your system" OFF)
option(onnxruntime_USE_ROCM "Build with AMD GPU support" OFF)
option(onnxruntime_USE_STVM "Build with standalone TVM support" OFF)
option(onnxruntime_USE_TVM "Build with TVM support" OFF)
option(onnxruntime_TVM_CUDA_RUNTIME "Build TVM with CUDA support" OFF)

# Options related to reducing the binary size produced by the build
option(onnxruntime_DISABLE_CONTRIB_OPS "Disable contrib ops" OFF)
Expand Down Expand Up @@ -818,7 +819,6 @@ if (onnxruntime_USE_CUDA AND "${onnxruntime_CUDNN_HOME}" STREQUAL "")
message(FATAL_ERROR "onnxruntime_CUDNN_HOME required for onnxruntime_USE_CUDA")
endif()


get_filename_component(ONNXRUNTIME_ROOT "${ONNXRUNTIME_ROOT}" ABSOLUTE)
get_filename_component(ORTTRAINING_ROOT "${ORTTRAINING_ROOT}" ABSOLUTE)
get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE)
Expand Down Expand Up @@ -1100,10 +1100,10 @@ if (onnxruntime_USE_NUPHAR)
list(APPEND ORT_PROVIDER_CMAKE_FLAGS -Donnxruntime_USE_NUPHAR=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES nuphar)
endif()
if (onnxruntime_USE_STVM)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_STVM=1)
list(APPEND ORT_PROVIDER_CMAKE_FLAGS -Donnxruntime_USE_STVM=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES stvm)
if (onnxruntime_USE_TVM)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_TVM=1)
list(APPEND ORT_PROVIDER_CMAKE_FLAGS -Donnxruntime_USE_TVM=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES tvm)
endif()
if (onnxruntime_USE_WINML)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_WINML=1)
Expand Down Expand Up @@ -1337,67 +1337,97 @@ if (onnxruntime_USE_DNNL)
include(dnnl)
endif()

# TVM
if (onnxruntime_USE_TVM)
# NUPHAR EP
if (onnxruntime_USE_NUPHAR_TVM)
if (NOT TARGET tvm)
message(STATUS "Include TVM(*).")
include(tvm)
endif()
if (onnxruntime_USE_CUDA)
if (onnxruntime_USE_STVM)
set(USE_CUDA ${onnxruntime_CUDA_HOME} CACHE BOOL "Only defined for TVM")
set(USE_MKLDNN ON CACHE BOOL "Only defined for TVM")
set(USE_CUDNN ON CACHE BOOL "Only defined for TVM")
endif()
if (onnxruntime_USE_NUPHAR)
set(USE_CUDA ON CACHE BOOL "Only defined for TVM")
endif()
set(USE_CUDA ON CACHE BOOL "Only defined for TVM")
endif()
if (onnxruntime_USE_LLVM)
set(USE_LLVM ON CACHE BOOL "Only defined for TVM")
add_definitions(-DUSE_TVM_WITH_LLVM)
add_definitions(-DUSE_NUPHAR_TVM_WITH_LLVM)
endif()

if (onnxruntime_USE_STVM)
set(USE_OPENMP gnu CACHE STRING "Only defined for TVM")
set(USE_MICRO OFF CACHE BOOL "Only defined for TVM")
endif()
message(STATUS "TVM BEFORE USE_LLVM=${USE_LLVM} USE_OPENMP=${USE_OPENMP} USE_MICRO=${USE_MICRO} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} USE_CUDA=${USE_CUDA} USE_GTEST=${USE_GTEST} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
message(STATUS "TVM BEFORE USE_LLVM=${USE_LLVM} USE_OPENMP=${USE_OPENMP} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} USE_CUDA=${USE_CUDA} USE_GTEST=${USE_GTEST} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
message(STATUS "tvm_SOURCE_DIR=${tvm_SOURCE_DIR}")
message(STATUS "tvm_BINARY_DIR=${tvm_BINARY_DIR}")
add_subdirectory(${tvm_SOURCE_DIR} ${tvm_BINARY_DIR} EXCLUDE_FROM_ALL)
message(STATUS "TVM AFTER USE_LLVM=${USE_LLVM} USE_OPENMP=${USE_OPENMP} USE_MICRO=${USE_MICRO} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} USE_CUDA=${USE_CUDA} USE_GTEST=${USE_GTEST} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
message(STATUS "TVM AFTER USE_LLVM=${USE_LLVM} USE_OPENMP=${USE_OPENMP} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} USE_CUDA=${USE_CUDA} USE_GTEST=${USE_GTEST} CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")

if (onnxruntime_USE_NUPHAR)
set_target_properties(tvm PROPERTIES FOLDER ${tvm_SOURCE_DIR})
set_target_properties(tvm_topi PROPERTIES FOLDER ${tvm_SOURCE_DIR})
set_target_properties(tvm_runtime PROPERTIES FOLDER ${tvm_SOURCE_DIR})
set_target_properties(tvm PROPERTIES FOLDER ${tvm_SOURCE_DIR})
set_target_properties(tvm_topi PROPERTIES FOLDER ${tvm_SOURCE_DIR})
set_target_properties(tvm_runtime PROPERTIES FOLDER ${tvm_SOURCE_DIR})

set(TVM_INCLUDES ${tvm_SOURCE_DIR}/include
${tvm_SOURCE_DIR}/3rdparty/dmlc-core/include
${tvm_SOURCE_DIR}/3rdparty/dlpack/include
$<TARGET_PROPERTY:tvm,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:tvm_topi,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
set(TVM_INCLUDES ${tvm_SOURCE_DIR}/include
${tvm_SOURCE_DIR}/3rdparty/dmlc-core/include
${tvm_SOURCE_DIR}/3rdparty/dlpack/include
$<TARGET_PROPERTY:tvm,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:tvm_topi,INTERFACE_INCLUDE_DIRECTORIES>)

add_definitions(-DUSE_NUPHAR_TVM)

set(onnxruntime_tvm_libs onnxruntime_codegen_tvm)

if (onnxruntime_USE_STVM)
set_target_properties(tvm PROPERTIES FOLDER ${tvm_SOURCE_DIR})
# needs to link with stdc++fs in Linux
if (UNIX)
if (NOT APPLE)
set(FS_STDLIB stdc++fs)
endif()
endif()
list(APPEND onnxruntime_EXTERNAL_LIBRARIES tvm ${FS_STDLIB})
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES tvm)

set(TVM_INCLUDES ${tvm_SOURCE_DIR}/include
${tvm_SOURCE_DIR}/3rdparty/dmlc-core/include
${tvm_SOURCE_DIR}/3rdparty/dlpack/include
$<TARGET_PROPERTY:tvm,INTERFACE_INCLUDE_DIRECTORIES>)
if (WIN32 AND MSVC)
# wd4100: identifier' : unreferenced formal parameter
# wd4244: conversion from 'int' to 'char', possible loss of data
# wd4251: class X needs to have dll-interface to be used by clients of class Y
# wd4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
# wd4275: non dll-interface class X used as base for dll-interface class Y
# wd4389: signed/unsigned mismatch
# wd4456: declaration of X hides previous local declaration
set(DISABLED_WARNINGS_FOR_TVM "/wd4100" "/wd4244" "/wd4251" "/wd4267" "/wd4275" "/wd4389" "/wd4456")
else()
set(DISABLED_WARNINGS_FOR_TVM "-Wno-error=ignored-qualifiers" "-Wno-unused-parameter" "-Wno-ignored-qualifiers")
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=unused-parameter")
if (HAS_CATCH_VALUE)
#TODO: send a PR to TVM and fix it
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=catch-value")
endif()
endif()

add_definitions(-DUSE_TVM)
include(onnxruntime_codegen.cmake)
endif(onnxruntime_USE_NUPHAR_TVM)

# TVM EP
if (onnxruntime_USE_TVM)
if (NOT TARGET tvm)
message(STATUS "Include TVM(*).")
include(tvm)
endif()

if (onnxruntime_USE_NUPHAR)
set(onnxruntime_tvm_libs onnxruntime_codegen_tvm)
if (onnxruntime_USE_LLVM)
set(USE_LLVM ON CACHE BOOL "Only defined for TVM")
endif()
if (onnxruntime_USE_STVM)
set(onnxruntime_tvm_libs onnxruntime_providers_stvm)

if (onnxruntime_TVM_CUDA_RUNTIME)
set(USE_CUDA ON CACHE BOOL "Only defined for TVM" FORCE)
endif()

set(USE_OPENMP gnu CACHE STRING "Only defined for TVM")
add_subdirectory(${tvm_SOURCE_DIR} ${tvm_BINARY_DIR} EXCLUDE_FROM_ALL)

set_target_properties(tvm PROPERTIES FOLDER ${tvm_SOURCE_DIR})

set(TVM_INCLUDES ${tvm_SOURCE_DIR}/include
${tvm_SOURCE_DIR}/3rdparty/dmlc-core/include
${tvm_SOURCE_DIR}/3rdparty/dlpack/include
$<TARGET_PROPERTY:tvm,INTERFACE_INCLUDE_DIRECTORIES>)

set(onnxruntime_tvm_libs onnxruntime_providers_tvm)

# needs to link with stdc++fs in Linux
if (UNIX)
if (NOT APPLE)
Expand Down Expand Up @@ -1712,29 +1742,6 @@ if (onnxruntime_USE_ROCM)
add_definitions(-DROCM_VERSION=${ROCM_VERSION_DEV_INT})
endif()

if (onnxruntime_USE_TVM)
if (WIN32 AND MSVC)
# wd4100: identifier' : unreferenced formal parameter
# wd4244: conversion from 'int' to 'char', possible loss of data
# wd4251: class X needs to have dll-interface to be used by clients of class Y
# wd4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
# wd4275: non dll-interface class X used as base for dll-interface class Y
# wd4389: signed/unsigned mismatch
# wd4456: declaration of X hides previous local declaration
set(DISABLED_WARNINGS_FOR_TVM "/wd4100" "/wd4244" "/wd4251" "/wd4267" "/wd4275" "/wd4389" "/wd4456")
else()
set(DISABLED_WARNINGS_FOR_TVM "-Wno-error=ignored-qualifiers" "-Wno-unused-parameter" "-Wno-ignored-qualifiers")
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=unused-parameter")
if (HAS_CATCH_VALUE)
#TODO: send a PR to TVM and fix it
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=catch-value")
endif()
endif()
if (onnxruntime_USE_NUPHAR)
include(onnxruntime_codegen.cmake)
endif()
endif()

if (onnxruntime_ENABLE_MICROSOFT_INTERNAL)
add_definitions(-DMICROSOFT_INTERNAL)
endif()
Expand Down
11 changes: 4 additions & 7 deletions cmake/external/tvm.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
if (onnxruntime_USE_STVM)
message(STATUS "onnxruntime_USE_STVM: Fetch tvm for STVM.")
if (onnxruntime_USE_TVM)
message(STATUS "onnxruntime_USE_TVM: Fetch tvm for TVM EP")

FetchContent_Declare(
tvm
GIT_REPOSITORY https://github.com/apache/tvm.git
GIT_TAG v0.8.0
GIT_TAG 36b48a5707321adba8a70e14da443566a9391e5a
)

FetchContent_GetProperties(tvm)
Expand All @@ -13,14 +13,11 @@ if (onnxruntime_USE_STVM)
endif()

set(tvm_INCLUDE_DIRS ${tvm_SOURCE_DIR}/include)
set(onnxruntime_STVM_HOME ${tvm_SOURCE_DIR})
message(STATUS "Define onnxruntime_STVM_HOME.")
message(STATUS ${onnxruntime_STVM_HOME})

endif()

if (onnxruntime_USE_NUPHAR)
message(STATUS "onnxruntime_USE_NUPHAR: Fetch onnxruntime-tvm for NUPHAR.")
message(STATUS "onnxruntime_USE_NUPHAR: Fetch onnxruntime-tvm for NUPHAR EP")

FetchContent_Declare(
tvm
Expand Down
2 changes: 1 addition & 1 deletion cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ set(onnxruntime_INTERNAL_LIBRARIES
${PROVIDERS_DML}
${PROVIDERS_NNAPI}
${PROVIDERS_NUPHAR}
${PROVIDERS_STVM}
${PROVIDERS_TVM}
${PROVIDERS_RKNPU}
${PROVIDERS_ROCM}
${PROVIDERS_VITISAI}
Expand Down
4 changes: 2 additions & 2 deletions cmake/onnxruntime_csharp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ if (onnxruntime_USE_NUPHAR)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NUPHAR;")
endif()

if (onnxruntime_USE_STVM)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_STVM,")
if (onnxruntime_USE_TVM)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TVM,")
endif()

if (onnxruntime_USE_OPENVINO)
Expand Down
52 changes: 23 additions & 29 deletions cmake/onnxruntime_providers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ endif()
if(onnxruntime_USE_ROCM)
set(PROVIDERS_ROCM onnxruntime_providers_rocm)
endif()
if (onnxruntime_USE_STVM)
set(PROVIDERS_STVM onnxruntime_providers_stvm)
if (onnxruntime_USE_TVM)
set(PROVIDERS_TVM onnxruntime_providers_tvm)
endif()


Expand Down Expand Up @@ -482,7 +482,7 @@ if (onnxruntime_USE_CUDA)
)
# disable a warning from the CUDA headers about unreferenced local functions
#target_compile_options(onnxruntime_providers_cuda PRIVATE /wd4505)
if (onnxruntime_USE_TVM)
if (onnxruntime_USE_NUPHAR_TVM)
target_compile_options(onnxruntime_providers_cuda PRIVATE ${DISABLED_WARNINGS_FOR_TVM})
endif()
set(onnxruntime_providers_cuda_static_library_flags
Expand Down Expand Up @@ -656,8 +656,8 @@ endif()
if (onnxruntime_USE_NUPHAR)
add_definitions(-DUSE_NUPHAR=1)

if (NOT onnxruntime_USE_TVM)
message(FATAL_ERROR "onnxruntime_USE_TVM required for onnxruntime_USE_NUPHAR")
if (NOT onnxruntime_USE_NUPHAR_TVM)
message(FATAL_ERROR "onnxruntime_USE_NUPHAR_TVM required for onnxruntime_USE_NUPHAR")
endif()

if (NOT onnxruntime_USE_LLVM)
Expand Down Expand Up @@ -1274,45 +1274,39 @@ if (onnxruntime_USE_ROCM)

endif()

if (onnxruntime_USE_STVM)
if (NOT TARGET tvm)
message(STATUS "Include TVM.")
include(tvm)
endif()
add_definitions(-DUSE_STVM=1)
if (onnxruntime_USE_TVM)
add_definitions(-DUSE_TVM=1)

file (GLOB_RECURSE onnxruntime_providers_stvm_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/stvm/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/stvm/*.cc"
file (GLOB_RECURSE onnxruntime_providers_tvm_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/tvm/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/tvm/*.cc"
)
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_stvm_cc_srcs})
onnxruntime_add_static_library(onnxruntime_providers_stvm ${onnxruntime_providers_stvm_cc_srcs})
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_tvm_cc_srcs})
onnxruntime_add_static_library(onnxruntime_providers_tvm ${onnxruntime_providers_tvm_cc_srcs})

if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(onnxruntime_providers_stvm PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
target_compile_options(onnxruntime_providers_tvm PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
endif()

target_include_directories(onnxruntime_providers_stvm PRIVATE
${onnxruntime_STVM_HOME}/include
${onnxruntime_STVM_HOME}/3rdparty/dlpack/include
${onnxruntime_STVM_HOME}/3rdparty/dmlc-core/include
target_include_directories(onnxruntime_providers_tvm PRIVATE
${TVM_INCLUDES}
${PYTHON_INLCUDE_DIRS})
onnxruntime_add_include_to_target(onnxruntime_providers_stvm onnxruntime_common onnx tvm)
onnxruntime_add_include_to_target(onnxruntime_providers_tvm onnxruntime_common onnx tvm)

add_dependencies(onnxruntime_providers_stvm ${onnxruntime_EXTERNAL_DEPENDENCIES})
add_dependencies(onnxruntime_providers_tvm ${onnxruntime_EXTERNAL_DEPENDENCIES})

target_link_libraries(onnxruntime_providers_stvm PRIVATE
target_link_libraries(onnxruntime_providers_tvm PRIVATE
onnx
tvm
onnxruntime_common
onnxruntime_framework
)

set_target_properties(onnxruntime_providers_stvm PROPERTIES FOLDER "ONNXRuntime")
set_target_properties(onnxruntime_providers_stvm PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_providers_tvm PROPERTIES FOLDER "ONNXRuntime")
set_target_properties(onnxruntime_providers_tvm PROPERTIES LINKER_LANGUAGE CXX)

target_compile_options(onnxruntime_providers_stvm PRIVATE -Wno-error=type-limits)
target_compile_definitions(onnxruntime_providers_stvm PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>)
target_compile_options(onnxruntime_providers_tvm PRIVATE -Wno-error=type-limits)
target_compile_definitions(onnxruntime_providers_tvm PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/stvm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/tvm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers)
endif()
Loading