Skip to content

Commit 8749fa3

Browse files
authored
Update absl (microsoft#21300)
### Description Our macOS pipeline are failing because of a build error in absl. However, the bug fix we need is not available in the latest ABSL release. Here is the issue: abseil/abseil-cpp#1536 And here is the fix: abseil/abseil-cpp@779a356 GTests uses ABSL. But this ABSL target also depends on GTest. So, it is a circular dependency. We should be able to avoid that by avoid building tests for ABSL. However, the version we are using has a problem with that: it has cmake target that still depends on GTest even when testing is disabled. It's strange that we suddenly hit this problem and it only happens on macOS.
1 parent 5753f8d commit 8749fa3

File tree

6 files changed

+63
-22
lines changed

6 files changed

+63
-22
lines changed

cgmanifests/generated/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"component": {
3737
"type": "git",
3838
"git": {
39-
"commitHash": "4a2c63365eff8823a5221db86ef490e828306f9d",
39+
"commitHash": "f46495ea96f68fc3f6c394f099b2992743f6ff7f",
4040
"repositoryUrl": "https://github.com/abseil/abseil-cpp.git"
4141
},
4242
"comments": "abseil_cpp"

cmake/CMakeLists.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ else()
665665
check_cxx_compiler_flag(-Wuseless-cast HAS_USELESS_CAST)
666666
check_cxx_compiler_flag(-Wstringop-overflow HAS_STRINGOP_OVERFLOW)
667667
if(onnxruntime_ENABLE_TRAINING_APIS)
668-
check_cxx_compiler_flag(-Wdangling-reference HAS_DANGLING_REFERENCE)
669-
if(HAS_DANGLING_REFERENCE)
670-
list(APPEND ORT_WARNING_FLAGS -Wno-dangling-reference)
671-
endif()
668+
check_cxx_compiler_flag(-Wdangling-reference HAS_DANGLING_REFERENCE)
669+
if(HAS_DANGLING_REFERENCE)
670+
list(APPEND ORT_WARNING_FLAGS -Wno-dangling-reference)
671+
endif()
672672
endif()
673673
check_function_exists(reallocarray HAS_REALLOCARRAY)
674674
if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND onnxruntime_target_platform STREQUAL "aarch64")
@@ -845,8 +845,8 @@ if (onnxruntime_USE_QNN)
845845
file(GLOB QNN_LIB_FILES LIST_DIRECTORIES false "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/libQnn*.so" "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/Qnn*.dll")
846846
if (${QNN_ARCH_ABI} STREQUAL "aarch64-windows-msvc" OR ${QNN_ARCH_ABI} STREQUAL "arm64x-windows-msvc")
847847
file(GLOB EXTRA_HTP_LIB LIST_DIRECTORIES false "${onnxruntime_QNN_HOME}/lib/hexagon-v68/unsigned/libQnnHtpV68Skel.so"
848-
"${onnxruntime_QNN_HOME}/lib/hexagon-v73/unsigned/libQnnHtpV73Skel.so"
849-
"${onnxruntime_QNN_HOME}/lib/hexagon-v73/unsigned/libqnnhtpv73.cat")
848+
"${onnxruntime_QNN_HOME}/lib/hexagon-v73/unsigned/libQnnHtpV73Skel.so"
849+
"${onnxruntime_QNN_HOME}/lib/hexagon-v73/unsigned/libqnnhtpv73.cat")
850850
list(APPEND QNN_LIB_FILES ${EXTRA_HTP_LIB})
851851
endif()
852852
message(STATUS "QNN lib files: " ${QNN_LIB_FILES})
@@ -1057,6 +1057,9 @@ function(onnxruntime_set_compile_flags target_name)
10571057
foreach(FLAG ${ORT_WARNING_FLAGS})
10581058
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${FLAG}>")
10591059
endforeach()
1060+
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 13 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
1061+
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-Wno-maybe-uninitialized>")
1062+
endif()
10601063
if (onnxruntime_USE_CUDA)
10611064
foreach(FLAG ${ORT_WARNING_FLAGS})
10621065
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options ${FLAG}>")
@@ -1198,11 +1201,11 @@ if (onnxruntime_USE_ACL OR onnxruntime_USE_ACL_1902 OR onnxruntime_USE_ACL_1905
11981201
if (onnxruntime_USE_ACL_2002)
11991202
add_definitions(-DACL_2002=1)
12001203
else()
1201-
if (onnxruntime_USE_ACL_2308)
1202-
add_definitions(-DACL_2308=1)
1203-
else()
1204+
if (onnxruntime_USE_ACL_2308)
1205+
add_definitions(-DACL_2308=1)
1206+
else()
12041207
add_definitions(-DACL_1905=1)
1205-
endif()
1208+
endif()
12061209
endif()
12071210
endif()
12081211
endif()

cmake/deps.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# NOTE: You must run deps_update_and_upload.py and generate_cgmanifest.py when ready to test your changes in a CI.
1313
# See https://microsoft.sharepoint.com/teams/ONNX2/_layouts/OneNote.aspx?id=%2Fteams%2FONNX2%2FShared%20Documents%2FNotebooks%2FONNX%20Ecosystem%20Team%20Notebook&wd=target%28Development.one%7C63D3AB47-51D1-4A62-9965-66882234BD44%2FAdd%20or%20update%20a%20dependency%20in%20deps.txt%7C0E9ED71D-89D5-40FA-B05F-C0123289C591%2F%29
1414
#
15-
abseil_cpp;https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.0.zip;bc2cec6baaad67fcb6c0c38972b687d4797927e9
15+
abseil_cpp;https://github.com/abseil/abseil-cpp/archive/f46495ea96f68fc3f6c394f099b2992743f6ff7f.zip;0e2b6d1dc7f0a808d1e23f7dd985f7bc18d52cbc
1616
coremltools;https://github.com/apple/coremltools/archive/refs/tags/7.1.zip;f1bab0f30966f2e217d8e01207d518f230a1641a
1717
cxxopts;https://github.com/jarro2783/cxxopts/archive/3c73d91c0b04e2b59462f0a741be8c07024c1bc0.zip;6c6ca7f8480b26c8d00476e0e24b7184717fe4f0
1818
date;https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.zip;2dac0c81dc54ebdd8f8d073a75c053b04b56e159

cmake/patches/abseil/absl_windows.patch

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,69 @@
1+
diff --git a/absl/base/attributes.h b/absl/base/attributes.h
2+
index 5ea5ee3e..f4949898 100644
3+
--- a/absl/base/attributes.h
4+
+++ b/absl/base/attributes.h
5+
@@ -559,7 +559,7 @@
6+
#undef ABSL_ATTRIBUTE_UNUSED
7+
#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__))
8+
#else
9+
-#define ABSL_ATTRIBUTE_UNUSED
10+
+#define ABSL_ATTRIBUTE_UNUSED [[maybe_unused]]
11+
#endif
12+
13+
// ABSL_ATTRIBUTE_INITIAL_EXEC
14+
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
15+
index d4fe8f5c..27418d13 100644
16+
--- a/absl/container/internal/raw_hash_set.h
17+
+++ b/absl/container/internal/raw_hash_set.h
18+
@@ -1924,7 +1924,7 @@ HashtablezInfoHandle SampleHashtablezInfo(size_t sizeof_slot, size_t sizeof_key,
19+
// In SOO, we sample on the first insertion so if this is an empty SOO case
20+
// (e.g. when reserve is called), then we still need to sample.
21+
if (kSooEnabled && was_soo && c.size() == 0) {
22+
- return Sample(sizeof_slot, sizeof_key, sizeof_value, SooCapacity());
23+
+ return Sample(sizeof_slot, sizeof_key, sizeof_value, (int16_t)SooCapacity());
24+
}
25+
// For non-SOO cases, we sample whenever the capacity is increasing from zero
26+
// to non-zero.
27+
@@ -3525,7 +3525,7 @@ class raw_hash_set {
28+
assert(is_soo());
29+
if (!ShouldSampleHashtablezInfo<CharAlloc>()) return HashtablezInfoHandle{};
30+
return Sample(sizeof(slot_type), sizeof(key_type), sizeof(value_type),
31+
- SooCapacity());
32+
+ (int16_t)SooCapacity());
33+
}
34+
35+
inline void destroy_slots() {
136
diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
2-
index a4ab1aa2..dfd13fd7 100644
37+
index da2282fe..4c7fc26f 100644
338
--- a/absl/copts/GENERATED_AbseilCopts.cmake
439
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
5-
@@ -129,8 +129,6 @@ list(APPEND ABSL_MSVC_FLAGS
40+
@@ -181,8 +181,6 @@ list(APPEND ABSL_MSVC_FLAGS
641
"/wd4005"
742
"/wd4068"
843
"/wd4180"
944
- "/wd4244"
1045
- "/wd4267"
1146
"/wd4503"
1247
"/wd4800"
13-
)
48+
"/DNOMINMAX"
1449
diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
15-
index a6efc98e..8c4de8e7 100644
50+
index b9e0071e..dd8410ec 100644
1651
--- a/absl/copts/GENERATED_copts.bzl
1752
+++ b/absl/copts/GENERATED_copts.bzl
18-
@@ -130,8 +130,6 @@ ABSL_MSVC_FLAGS = [
53+
@@ -182,8 +182,6 @@ ABSL_MSVC_FLAGS = [
1954
"/wd4005",
2055
"/wd4068",
2156
"/wd4180",
2257
- "/wd4244",
2358
- "/wd4267",
2459
"/wd4503",
2560
"/wd4800",
26-
]
61+
"/DNOMINMAX",
2762
diff --git a/absl/copts/copts.py b/absl/copts/copts.py
28-
index e6e11949..0aa7d868 100644
63+
index 2d85ac74..4875d668 100644
2964
--- a/absl/copts/copts.py
3065
+++ b/absl/copts/copts.py
31-
@@ -115,10 +115,6 @@ MSVC_WARNING_FLAGS = [
66+
@@ -118,10 +118,6 @@ MSVC_WARNING_FLAGS = [
3267
"/wd4068", # unknown pragma
3368
# qualifier applied to function type has no meaning; ignored
3469
"/wd4180",

onnxruntime/core/providers/qnn/builder/qnn_utils.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ std::ostream& operator<<(std::ostream& out, const Qnn_Tensor_t& tensor) {
333333
}
334334
out << ")";
335335
out << " memType=" << GetQnnTensorMemType(tensor);
336+
// TODO: the code below has compilation errors with the latest ABSL
337+
#if 0
336338
if (GetQnnTensorMemType(tensor) == QNN_TENSORMEMTYPE_RAW) {
337339
if (GetQnnTensorDataType(tensor) == QNN_DATATYPE_FLOAT_32) {
338340
operator<< <float>(out, GetQnnTensorClientBuf(tensor));
@@ -355,6 +357,7 @@ std::ostream& operator<<(std::ostream& out, const Qnn_Tensor_t& tensor) {
355357
operator<< <int8_t>(out, GetQnnTensorClientBuf(tensor));
356358
}
357359
}
360+
#endif
358361
out << " quantizeParams:" << GetQnnTensorQParams(tensor);
359362
return out;
360363
}

tools/ci_build/github/azure-pipelines/templates/download-deps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
packageType: upack
1212
feed: '/7424c8e4-5c62-490e-95c4-79446f31017c'
1313
definition: '517c4f6f-5437-4392-a70d-4f15ec5be2f0'
14-
version: 1.0.163
14+
version: 1.0.165
1515
downloadPath: $(Build.BinariesDirectory)/deps
1616

1717
# The private ADO project
@@ -22,7 +22,7 @@ steps:
2222
packageType: upack
2323
feed: '/4c7631f5-24c0-4307-8822-1aa8f180c325'
2424
definition: 'fd9dd5ad-b73e-4678-890e-edcf680dbc1a'
25-
version: 1.0.163
25+
version: 1.0.165
2626
downloadPath: $(Build.BinariesDirectory)/deps
2727

2828
# You can add more ADO accounts at here.

0 commit comments

Comments
 (0)