Skip to content

Fix GCC 14 build failure in graph topological sort - #34068

Merged
Tianlei Wu (tianleiwu) merged 1 commit into
mainfrom
copilot/fix-build-linux-x64-minsize-rel
Nov 10, 2026
Merged

Tianlei Wu (tianleiwu) merged 1 commit into
mainfrom
copilot/fix-build-linux-x64-minsize-rel

Conversation

Copilot AI commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Use std::vector as the priority queue’s backing container in KahnsTopologicalSort, avoiding the GCC 14 -Werror=uninitialized warning triggered by moving an InlinedVector.
  • Retain the heap-based traversal and the session-creation optimizations from PR Speed up session creation #33939.

Motivation and Context

The Linux MinSizeRel build with exceptions disabled failed while compiling graph.cc: GCC 14 treated an Abseil InlinedVector move-constructor warning as an error. This change avoids that move while preserving the priority queue’s ordering.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job for Build Linux x64 MinSizeRel Fix GCC 14 build failure in graph topological sort Nov 10, 2026
@tianleiwu
Tianlei Wu (tianleiwu) marked this pull request as ready for review November 10, 2026 04:42
Copilot AI balanced review requested due to automatic review settings November 10, 2026 04:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the GCC 14 build fix and related session-creation optimizations.

No open issues 🎉

What changed in this PR

Addresses the GCC 14 build failure in graph topological sorting while retaining the session-creation optimizations from PR #33939.

Changes:

  • Uses a std::vector-backed priority queue to avoid the InlinedVector move warning while preserving heap-based traversal and ordering.
  • Removes redundant consumer lookups during constant sharing.
  • Retrieves tensor element types directly from node type metadata in the allocation planner.
File Description
onnxruntime/​core/​optimizer/​constant_sharing.cc Relies on consumer-set deduplication instead of copying and searching consumers.
onnxruntime/​core/​graph/​graph.cc Uses a vector-backed binary heap for efficient topological traversal.
onnxruntime/​core/​framework/​allocation_planner.cc Avoids indirect type conversion when retrieving tensor element types.

Review effort: Balanced

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
@tianleiwu
Tianlei Wu (tianleiwu) force-pushed the copilot/fix-build-linux-x64-minsize-rel branch from 13c89d0 to 8ec4c94 Compare November 10, 2026 08:03
@tianleiwu
Tianlei Wu (tianleiwu) enabled auto-merge (squash) November 10, 2026 08:04
@tianleiwu
Tianlei Wu (tianleiwu) merged commit 5393483 into main Nov 10, 2026
98 of 99 checks passed
@tianleiwu
Tianlei Wu (tianleiwu) deleted the copilot/fix-build-linux-x64-minsize-rel branch November 10, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants