diff --git a/cgmanifests/cgmanifest.json b/cgmanifests/cgmanifest.json index d7d1f380e5..c25bbdb6fc 100644 --- a/cgmanifests/cgmanifest.json +++ b/cgmanifests/cgmanifest.json @@ -8,7 +8,7 @@ "repositoryUrl": "https://github.com/abseil/abseil-cpp.git" } } - }, + }, { "component": { "Type": "maven", @@ -46,7 +46,7 @@ "component": { "type": "git", "git": { - "commitHash": "ffd5f70370642c909222f9a4cae8400023dacbdc", + "commitHash": "bc492acd7677dd7875b14f9ee46beef658955441", "repositoryUrl": "https://github.com/apache/tvm.git" }, "comments": "needed for TVM EP" diff --git a/cmake/external/tvm.cmake b/cmake/external/tvm.cmake index 3f425a0938..8d7602a926 100644 --- a/cmake/external/tvm.cmake +++ b/cmake/external/tvm.cmake @@ -4,7 +4,7 @@ if (onnxruntime_USE_TVM) FetchContent_Declare( tvm GIT_REPOSITORY https://github.com/apache/tvm.git - GIT_TAG ffd5f70370642c909222f9a4cae8400023dacbdc + GIT_TAG bc492acd7677dd7875b14f9ee46beef658955441 ) FetchContent_GetProperties(tvm) @@ -33,4 +33,4 @@ if (onnxruntime_USE_NUPHAR) set(tvm_INCLUDE_DIRS ${tvm_SOURCE_DIR}/include) -endif() \ No newline at end of file +endif() diff --git a/onnxruntime/core/providers/tvm/tvm_allocator.cc b/onnxruntime/core/providers/tvm/tvm_allocator.cc index 56784a88f0..d2975cdb54 100644 --- a/onnxruntime/core/providers/tvm/tvm_allocator.cc +++ b/onnxruntime/core/providers/tvm/tvm_allocator.cc @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#include + #include "tvm_allocator.h" #include "core/framework/allocatormgr.h" #include "core/framework/session_state.h" @@ -14,7 +16,7 @@ void* TVMAllocator::Alloc(size_t size) { void* p = nullptr; if (size > 0) { DLDataType dl_type{kDLInt, 8, 1}; - int err = TVMDeviceAllocDataSpace(ctx, size, 128, dl_type, reinterpret_cast(&p)); + int err = TVMDeviceAllocDataSpace(ctx, size, ::tvm::runtime::kAllocAlignment, dl_type, reinterpret_cast(&p)); CHECK_EQ(err, 0); return p; } diff --git a/onnxruntime/core/providers/tvm/tvm_api.cc b/onnxruntime/core/providers/tvm/tvm_api.cc index 88af169e96..4a96bfce25 100644 --- a/onnxruntime/core/providers/tvm/tvm_api.cc +++ b/onnxruntime/core/providers/tvm/tvm_api.cc @@ -193,10 +193,19 @@ void TVM_VM_SetInputs(TvmModule& mod, std::vector& inds, std::vector& inputs) { - TvmPackedFunc set_input = mod.GetFunction("set_one_input", false); - for (size_t i = 0; i < inds.size(); ++i) { - set_input("main", inds[i], &inputs[i]); + size_t num_total_args = inputs.size() + 1; + std::vector tvm_values(num_total_args); + std::vector tvm_type_codes(num_total_args); + ::tvm::runtime::TVMArgsSetter setter(tvm_values.data(), tvm_type_codes.data()); + const std::string func_name = "main"; + setter(0, func_name.c_str()); + for (size_t k = 0; k < num_total_args - 1; ++k) { + setter(inds[k]+1, &inputs[k]); } + + TvmPackedFunc set_input = mod.GetFunction("set_input", false); + ::tvm::runtime::TVMRetValue rv; + set_input.CallPacked(::tvm::runtime::TVMArgs(tvm_values.data(), tvm_type_codes.data(), num_total_args), &rv); } void TVMGetOutputs(TvmModule& mod, diff --git a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh index 45472d90a6..c644963b05 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh @@ -42,6 +42,7 @@ PACKAGE_LIST="autotools-dev \ libssl1.1 \ libkrb5-3 \ libtinfo-dev \ + libtinfo5 \ libtool \ openssh-server \ aria2 \