diff --git a/cgmanifests/cgmanifest.json b/cgmanifests/cgmanifest.json index 401756fe4f..e043e07ea1 100644 --- a/cgmanifests/cgmanifest.json +++ b/cgmanifests/cgmanifest.json @@ -4,7 +4,7 @@ "component": { "type": "git", "git": { - "commitHash": "9336be04a242237cd41a525bedfcf3be1bb55377", + "commitHash": "215105818dfde3174fe799600bb0f3cae233d0bf", "repositoryUrl": "https://github.com/abseil/abseil-cpp.git" } } diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index f7324cee09..1bf36930e8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -934,8 +934,9 @@ include(eigen) #onnxruntime_EXTERNAL_LIBRARIES could contain onnx, onnx_proto,libprotobuf, cuda/cudnn, # dnnl/mklml, onnxruntime_codegen_tvm, tvm and pthread # pthread is always at the last -set(onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto ${PROTOBUF_LIB} re2::re2) - +set(onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto ${PROTOBUF_LIB} re2::re2 absl::inlined_vector absl::flat_hash_set + absl::flat_hash_map absl::node_hash_set absl::node_hash_map absl::base absl::throw_delegate absl::raw_hash_set + absl::hash absl::city absl::low_level_hash absl::raw_logging_internal) set(onnxruntime_LINK_DIRS ) if (onnxruntime_USE_CUDA) @@ -1203,7 +1204,7 @@ function(onnxruntime_configure_target target_name) #if(WIN32 AND onnxruntime_ENABLE_STATIC_ANALYSIS) # set_target_properties(${target_name} PROPERTIES VS_USER_PROPS ${PROJECT_SOURCE_DIR}/EnableVisualStudioCodeAnalysis.props) #endif() - target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT}) + target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT} ${abseil_cpp_SOURCE_DIR}) if (onnxruntime_ENABLE_LTO) set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) @@ -1397,7 +1398,6 @@ if (onnxruntime_USE_NUPHAR_TVM) endif() endif() - include(onnxruntime_codegen.cmake) endif(onnxruntime_USE_NUPHAR_TVM) # TVM EP @@ -1873,8 +1873,11 @@ if (onnxruntime_ENABLE_TRAINING) list(APPEND onnxruntime_EXTERNAL_LIBRARIES tensorboard) endif() -#names in this var must match the directory names under onnxruntime/core/providers + set(ONNXRUNTIME_TARGETS onnxruntime_common onnxruntime_graph onnxruntime_framework onnxruntime_util onnxruntime_providers onnxruntime_optimizer onnxruntime_session onnxruntime_mlas onnxruntime_flatbuffers) +if (onnxruntime_USE_NUPHAR_TVM) + list(APPEND ONNXRUNTIME_TARGETS onnxruntime_codegen_tvm) +endif() if (onnxruntime_ENABLE_EAGER_MODE) if (NOT onnxruntime_ENABLE_TRAINING OR NOT onnxruntime_ENABLE_PYTHON) message( diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index fa138e2851..f142aaa2a3 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -3,9 +3,6 @@ include(FetchContent) -set(abseil_URL https://github.com/abseil/abseil-cpp.git) -set(abseil_TAG 9336be04a242237cd41a525bedfcf3be1bb55377) - # Pass to build set(ABSL_PROPAGATE_CXX_STD 1) set(BUILD_TESTING 0) @@ -14,21 +11,13 @@ FetchContent_Declare( abseil_cpp PREFIX "${CMAKE_CURRENT_BINARY_DIR}/abseil-cpp" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/abseil-cpp" - GIT_REPOSITORY ${abseil_URL} - GIT_TAG ${abseil_TAG} + URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.zip + PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/patches/abseil/Fix_Nvidia_Build_Break.patch ) FetchContent_MakeAvailable(abseil_cpp) FetchContent_GetProperties(abseil_cpp SOURCE_DIR) -# Patching separately because repeated builds would fail the whole FetchContent_* command -# instead of just patching -execute_process(COMMAND git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/patches/abseil/Fix_Nvidia_Build_Break.patch - WORKING_DIRECTORY "${abseil_cpp_SOURCE_DIR}" - ) -include_directories("${abseil_cpp_SOURCE_DIR}") -list(APPEND onnxruntime_EXTERNAL_LIBRARIES absl::inlined_vector absl::flat_hash_set absl::flat_hash_map absl::node_hash_set absl::node_hash_map absl::base absl::throw_delegate absl::raw_hash_set absl::hash absl::city absl::low_level_hash absl::raw_logging_internal) -list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES absl::inlined_vector absl::flat_hash_set absl::flat_hash_map absl::node_hash_set absl::node_hash_map absl::base absl::throw_delegate absl::raw_hash_set absl::hash absl::city absl::low_level_hash absl::raw_logging_internal) diff --git a/cmake/onnxruntime_codegen.cmake b/cmake/onnxruntime_codegen_tvm.cmake similarity index 100% rename from cmake/onnxruntime_codegen.cmake rename to cmake/onnxruntime_codegen_tvm.cmake diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake index a6e62802f0..9590050dfe 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -117,7 +117,7 @@ target_include_directories(onnxruntime_common PUBLIC ${OPTIONAL_LITE_INCLUDE_DIR}) -target_link_libraries(onnxruntime_common safeint_interface Boost::mp11 absl::throw_delegate) +target_link_libraries(onnxruntime_common safeint_interface Boost::mp11) if(NOT WIN32) target_include_directories(onnxruntime_common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public") diff --git a/cmake/onnxruntime_eager.cmake b/cmake/onnxruntime_eager.cmake index 88d05a2f14..d8a1e83227 100644 --- a/cmake/onnxruntime_eager.cmake +++ b/cmake/onnxruntime_eager.cmake @@ -8,7 +8,7 @@ file(GLOB onnxruntime_eager_srcs CONFIGURE_DEPENDS source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_eager_srcs}) -add_library(onnxruntime_eager ${onnxruntime_eager_srcs}) +onnxruntime_add_static_library(onnxruntime_eager ${onnxruntime_eager_srcs}) if(MSVC AND onnxruntime_ENABLE_EAGER_MODE) set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_aten.cpp" PROPERTIES COMPILE_FLAGS "/wd4100 /wd4458") set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_customops.g.cpp" PROPERTIES COMPILE_FLAGS "/wd4100") diff --git a/cmake/patches/abseil/Fix_Nvidia_Build_Break.patch b/cmake/patches/abseil/Fix_Nvidia_Build_Break.patch index 1ab35ca454..d481a14a55 100644 --- a/cmake/patches/abseil/Fix_Nvidia_Build_Break.patch +++ b/cmake/patches/abseil/Fix_Nvidia_Build_Break.patch @@ -1,26 +1,22 @@ diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h -index 98c26af..b4f1c4a 100644 +index 1d7d6cd..f6a7a78 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h -@@ -925,8 +925,8 @@ auto Storage::Swap(Storage* other_storage_ptr) -> void { +@@ -904,7 +904,7 @@ auto Storage::Swap(Storage* other_storage_ptr) -> void { inlined_ptr->GetSize()); } ABSL_INTERNAL_CATCH_ANY { - allocated_ptr->SetAllocation( -- {allocated_storage_view.data, allocated_storage_view.capacity}); -+ allocated_ptr->SetAllocation(Allocation{ -+ allocated_storage_view.data, allocated_storage_view.capacity}); ++ allocated_ptr->SetAllocation(Allocation + {allocated_storage_view.data, allocated_storage_view.capacity}); ABSL_INTERNAL_RETHROW; } - -@@ -934,8 +934,8 @@ auto Storage::Swap(Storage* other_storage_ptr) -> void { - inlined_ptr->GetInlinedData(), - inlined_ptr->GetSize()); +@@ -912,7 +912,7 @@ auto Storage::Swap(Storage* other_storage_ptr) -> void { + DestroyElements(inlined_ptr->GetAllocator(), + inlined_ptr->GetInlinedData(), inlined_ptr->GetSize()); - inlined_ptr->SetAllocation( -- {allocated_storage_view.data, allocated_storage_view.capacity}); -+ inlined_ptr->SetAllocation(Allocation{allocated_storage_view.data, -+ allocated_storage_view.capacity}); ++ inlined_ptr->SetAllocation(Allocation + {allocated_storage_view.data, allocated_storage_view.capacity}); } - swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated()); diff --git a/onnxruntime/core/eager/ort_kernel_invoker.cc b/onnxruntime/core/eager/ort_kernel_invoker.cc index 009cd85b6e..f299fee597 100644 --- a/onnxruntime/core/eager/ort_kernel_invoker.cc +++ b/onnxruntime/core/eager/ort_kernel_invoker.cc @@ -71,7 +71,7 @@ common::Status ORTInvoker::Invoke(const std::string& op_name, } // check whether the inputs are contiguous tensor const auto& may_strided_inputs = kernel_create_info->kernel_def->MayStridedInput(); - for (auto i = 0; i < inputs.size(); ++i) { + for (i = 0; i < inputs.size(); ++i) { const Tensor& input_tensor = inputs[i].Get(); if (!input_tensor.IsContiguous() && std::find(may_strided_inputs.begin(), may_strided_inputs.end(), static_cast(i)) == may_strided_inputs.end())