Onnxruntime: update to 1.26.0#13
Draft
koenkooi wants to merge 3 commits into
Draft
Conversation
Linking the label_image example fails with the newer GCC 16 toolchain
for both the 2.16.1 and 2.20.0 recipes:
undefined reference to 'tflite::profiling::ProfileBuffer::EndEvent(
unsigned int, long const*, long const*)'
collect2: error: ld returned 1 exit status
label_image uses BufferedProfiler, which forwards to
tflite::profiling::ProfileBuffer. ProfileBuffer is defined in
profiling/profile_buffer.cc, which is excluded from
libtensorflow-lite.a, so each tool must compile it - benchmark_model
does, but the label_image example does not. Older compilers inlined
away the out-of-line reference to EndEvent(); GCC 16 keeps it, exposing
the missing source.
Add a patch adding profiling/profile_buffer.cc to the label_image
sources, mirroring the benchmark_model target. No upstream fix exists
yet (tensorflow/tensorflow master still omits it), so carry it locally.
The example's source list is identical across 2.16.x and 2.20.x in the
relevant region, so the patch uses minimal context and is shared from
recipes-ml/tflite/files/tflite/ by both recipes to avoid duplication.
Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
(git-am'ed from qualcomm-linux/meta-qcom-distro#348, dropped 2.16.x portion)
Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
onnxruntime 1.24.1 fails to build with the GCC 16 toolchain. It sets COMPILE_WARNING_AS_ERROR ON (a bare -Werror), which turns two GCC 16 diagnostics into fatal errors: 1. -Wsfinae-incomplete (new and on by default in GCC 16) fires when a class template (onnxruntime::Tensor, Node, GraphViewer, SparseTensor) is used in a SFINAE context through std::reference_wrapper / _Reference_wrapper_base before it is complete, then later defined. libstdc++'s <functional> (pulled in via onnx/defs/schema.h) triggers exactly this pattern. The code is well-formed; the warning is purely informational. 2. -Wmaybe-uninitialized false-positives on a read from an absl::InlinedVector populated through a helper, e.g. concat_slice_elimination.cc:223 (axes[0], filled by GetSliceInfo()). onnxruntime already suppresses this for GCC 12; GCC 16 reintroduced the false positive. Add a patch that detects -Wsfinae-incomplete and appends -Wno-sfinae-incomplete to ORT_WARNING_FLAGS (mirroring the existing -Wno-interference-size handling), and extends the existing -Wno-maybe-uninitialized guard to also cover GCC >= 16. Both changes follow patterns already present in cmake/CMakeLists.txt rather than disabling -Werror wholesale, and are gated so older compilers are unaffected. Verified with a from-scratch build for qemuarm64 using GCC 16.1.0: the recipe now compiles and packages cleanly. Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com> Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.26.0 requires C++20 (cmake aborts otherwise), so set
-DCMAKE_CXX_STANDARD=20.
Carry a dedicated GCC 16 fixup patch with the two suppressions this
build needs, both gated behind check_cxx_compiler_flag:
- extend the existing -Wno-maybe-uninitialized guard to GCC >= 16
(false positive in the optimizer, e.g. matmul_nbits_fusion.cc); and
- add -Wno-free-nonheap-object (GCC 16 false-positives the
std::vector<graph_utils::EdgeEndToMatch> destructor in
skip_layer_norm_fusion.cc).
Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
935253b to
96e4cbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This includes PR #12 and updates onnxruntime to the latest release. I've checked with the IMSDK team and the Qualcomm Execution Provider (in https://github.com/qualcomm-linux/meta-qcom) is compatible with this version.
This release needs a slightly different fix for GCC 16.x, which is planned to get pushed upstream. When that happens the patch header will get updated.