Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCC13] Update to latest changes from gcc 13 branch #9634

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions gcc.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### RPM external gcc 13.2.0
### RPM external gcc 13.3.1
## USE_COMPILER_VERSION
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64
# Use the git repository for fetching the sources. This gives us more control while developing
# a new platform so that we can compile yet to be released versions of the compiler.
# See: https://gcc.gnu.org/viewcvs/gcc/branches/gcc-8-branch/?view=log
%define gccTag c891d8dc23e1a46ad9f3e757d09e57b500d40044
%define gccTag 2d6e33407c3d94e3aee6de235dc13373184a506f
%define gccBranch releases/gcc-13

%define moduleName %{n}-%{realversion}
Expand All @@ -24,9 +24,6 @@ Source3: https://ftp.gnu.org/gnu/mpc/mpc-%{mpcVersion}.tar.gz
Source4: https://libisl.sourceforge.io/isl-%{islVersion}.tar.bz2
Source12: http://zlib.net/zlib-%{zlibVersion}.tar.gz
Source13: https://github.com/facebook/zstd/releases/download/v%{zstdVersion}/zstd-%{zstdVersion}.tar.gz
#Avoid C++20 build errors
#FIXME: This should be dropped when we are ready to move to newer GCC 13 supported by cuda
Source14: https://github.com/gcc-mirror/gcc/commit/96482ffe60d9bdec802fcad705c69641b2a3e040.patch

%ifos linux
%define bisonVersion 3.8.2
Expand All @@ -47,7 +44,6 @@ Patch1: gcc-flex-disable-doc
%prep

%setup -T -b 0 -n %{moduleName}
patch -p1 <%{_sourcedir}/96482ffe60d9bdec802fcad705c69641b2a3e040.patch

# Filter out private stuff from RPM requires headers.
cat << \EOF > %{name}-req
Expand Down
26 changes: 26 additions & 0 deletions onnxruntime-gcc13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
index b68cbaf..b1d6c51 100644
--- a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
+++ b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
@@ -147,7 +147,7 @@ static Status MatchAndProcess(
RuntimeOptimizationRecord::ProducedOpIdVector produced_op_ids{};
produced_op_ids.reserve(action_saved_state.produced_node_op_schemas.size());

- for (const auto op_schema : action_saved_state.produced_node_op_schemas) {
+ for (const auto& op_schema : action_saved_state.produced_node_op_schemas) {
produced_op_ids.push_back(utils::MakeOpId(*op_schema));
if (save_context->record_produced_node_op_schema) {
status = save_context->record_produced_node_op_schema(*op_schema);
diff --git a/onnxruntime/core/session/inference_session.cc b/onnxruntime/core/session/inference_session.cc
index 023cbcb..8fc17f0 100644
--- a/onnxruntime/core/session/inference_session.cc
+++ b/onnxruntime/core/session/inference_session.cc
@@ -907,7 +907,7 @@ common::Status InferenceSession::SaveToOrtFormat(const std::filesystem::path& fi
ORT_RETURN_IF_ERROR(kernel_type_str_resolver.RegisterGraphNodeOpSchemas(model_->MainGraph()));
ORT_RETURN_IF_ERROR(standalone::RegisterCustomOpNodeSchemas(kernel_type_str_resolver, model_->MainGraph()));

- for (const auto op_schema : saved_runtime_optimization_produced_node_op_schemas_) {
+ for (const auto& op_schema : saved_runtime_optimization_produced_node_op_schemas_) {
ORT_RETURN_IF_ERROR(kernel_type_str_resolver.RegisterOpSchema(*op_schema));
}

2 changes: 2 additions & 0 deletions onnxruntime.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
%define branch cms/v%{realversion}
%define tag efe7f6a3859bedbad40a2991480be4e7584b1582
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Patch0: onnxruntime-gcc13

BuildRequires: cmake ninja
Requires: protobuf py3-numpy py3-wheel py3-onnx zlib libpng py3-pybind11 re2
%{!?without_cuda:Requires: cuda cudnn}

%prep
%setup -q -n %{n}-%{realversion}
%patch0 -p1

%build
rm -rf ../build; mkdir ../build; cd ../build
Expand Down