Update our absl cmake files (#10762)

This commit is contained in:
Changming Sun 2022-03-04 09:28:04 -08:00 committed by GitHub
parent 4c88fa5971
commit 283d0c47b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 35 deletions

View file

@ -4,7 +4,7 @@
"component": {
"type": "git",
"git": {
"commitHash": "9336be04a242237cd41a525bedfcf3be1bb55377",
"commitHash": "215105818dfde3174fe799600bb0f3cae233d0bf",
"repositoryUrl": "https://github.com/abseil/abseil-cpp.git"
}
}

View file

@ -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(

View file

@ -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)

View file

@ -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")

View file

@ -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")

View file

@ -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<T, N, A>::Swap(Storage* other_storage_ptr) -> void {
@@ -904,7 +904,7 @@ auto Storage<T, N, A>::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<A>{
+ allocated_storage_view.data, allocated_storage_view.capacity});
+ allocated_ptr->SetAllocation(Allocation<A>
{allocated_storage_view.data, allocated_storage_view.capacity});
ABSL_INTERNAL_RETHROW;
}
@@ -934,8 +934,8 @@ auto Storage<T, N, A>::Swap(Storage* other_storage_ptr) -> void {
inlined_ptr->GetInlinedData(),
inlined_ptr->GetSize());
@@ -912,7 +912,7 @@ auto Storage<T, N, A>::Swap(Storage* other_storage_ptr) -> void {
DestroyElements<A>(inlined_ptr->GetAllocator(),
inlined_ptr->GetInlinedData(), inlined_ptr->GetSize());
- inlined_ptr->SetAllocation(
- {allocated_storage_view.data, allocated_storage_view.capacity});
+ inlined_ptr->SetAllocation(Allocation<A>{allocated_storage_view.data,
+ allocated_storage_view.capacity});
+ inlined_ptr->SetAllocation(Allocation<A>
{allocated_storage_view.data, allocated_storage_view.capacity});
}
swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated());

View file

@ -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<Tensor>();
if (!input_tensor.IsContiguous() && std::find(may_strided_inputs.begin(), may_strided_inputs.end(),
static_cast<int>(i)) == may_strided_inputs.end())