mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
**Description**: Support new feature of TVM Virtual Machine (method `set_outputs`) on TVM Execution Provider side. It allows to avoid excess copying from TVM EP output tensor to ONNX Runtime one **Motivation and Context** Tests with multiple output topologies and big output tensors shows that there is overheads spent on copying from TVM EP to ONNX Runtime. Returning output(s) on preallocated memory for VirtualMachine was implemented on TVM side. **Details** `set_output_zero_copy` provider option for TVM EP switches on/off this feature. It is true by default. The feature works for both GraphExecutor and VirtualMachine from TVM. --------- Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
24 lines
654 B
CMake
24 lines
654 B
CMake
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 2379917985919ed3918dc12cad47f469f245be7a
|
|
)
|
|
|
|
FetchContent_GetProperties(tvm)
|
|
if(NOT tvm_POPULATED)
|
|
FetchContent_Populate(tvm)
|
|
if (WIN32)
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} -E create_symlink ${tvm_BINARY_DIR}/${CMAKE_BUILD_TYPE} ${tvm_SOURCE_DIR}/build
|
|
)
|
|
else()
|
|
file(CREATE_LINK ${tvm_BINARY_DIR} ${tvm_SOURCE_DIR}/build SYMBOLIC)
|
|
endif()
|
|
endif()
|
|
|
|
set(tvm_INCLUDE_DIRS ${tvm_SOURCE_DIR}/include)
|
|
|
|
endif()
|