diff --git a/onnxruntime-gcc13.patch b/onnxruntime-gcc13.patch deleted file mode 100644 index 63e086a24be..00000000000 --- a/onnxruntime-gcc13.patch +++ /dev/null @@ -1,26 +0,0 @@ -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)); - } - diff --git a/onnxruntime/cms-changes.patch b/onnxruntime/cms-changes.patch new file mode 100644 index 00000000000..1f1009a6b46 --- /dev/null +++ b/onnxruntime/cms-changes.patch @@ -0,0 +1,47 @@ +diff --git a/onnxruntime/core/mlas/lib/platform.cpp b/onnxruntime/core/mlas/lib/platform.cpp +index eccde79848e61..4a107f173da07 100644 +--- a/onnxruntime/core/mlas/lib/platform.cpp ++++ b/onnxruntime/core/mlas/lib/platform.cpp +@@ -23,6 +23,7 @@ Module Name: + #include "kleidiai/mlasi_kleidiai.h" + #endif + ++#include + #include + #include + +@@ -355,8 +356,11 @@ Return Value: + // + + uint64_t xcr0 = MlasReadExtendedControlRegister(_XCR_XFEATURE_ENABLED_MASK); ++ const char *cpu_opt = std::getenv("MLAS_DYNAMIC_CPU_ARCH"); ++ if (cpu_opt == nullptr) cpu_opt = "99"; ++ auto opt = std::stoi(cpu_opt); + +- if ((xcr0 & 0x6) == 0x6) { ++ if ((opt > 0) && (xcr0 & 0x6) == 0x6) { + + this->GemmFloatKernel = MlasGemmFloatKernelAvx; + +@@ -390,7 +394,7 @@ Return Value: + __cpuid_count(7, 0, Cpuid7[0], Cpuid7[1], Cpuid7[2], Cpuid7[3]); + #endif + +- if (((Cpuid1[2] & 0x1000) != 0) && ((Cpuid7[1] & 0x20) != 0)) { ++ if ((opt > 1) && ((Cpuid1[2] & 0x1000) != 0) && ((Cpuid7[1] & 0x20) != 0)) { + + this->Avx2Supported_ = true; + +diff --git a/onnxruntime/core/providers/cpu/tensor/scatter.cc b/onnxruntime/core/providers/cpu/tensor/scatter.cc +index c7a2005924836..c938ca9bf073d 100644 +--- a/onnxruntime/core/providers/cpu/tensor/scatter.cc ++++ b/onnxruntime/core/providers/cpu/tensor/scatter.cc +@@ -326,7 +326,7 @@ Status ScatterData( + // and so on + std::vector dim_block_size(num_dims); + +- dim_block_size.back() = 1; ++ dim_block_size[num_dims-1] = 1; + if (num_dims > 1) { + // We start at num_dims - 2 because we already pre-populated + // the last element above diff --git a/onnxruntime.spec b/onnxruntime/spec similarity index 84% rename from onnxruntime.spec rename to onnxruntime/spec index e59b1ddcb8a..80ba97847b8 100644 --- a/onnxruntime.spec +++ b/onnxruntime/spec @@ -1,11 +1,11 @@ -### RPM external onnxruntime 1.20.1 +### RPM external onnxruntime 1.25.1 ## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} ## INCLUDE cuda-flags -%define github_user cms-externals -%define branch cms/v%{realversion} -%define tag efe7f6a3859bedbad40a2991480be4e7584b1582 +%define github_user microsoft +%define branch main +%define tag v%{realversion} Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz -Patch0: onnxruntime-gcc13 +Patch0: onnxruntime/cms-changes BuildRequires: cmake ninja Requires: protobuf py3-numpy py3-onnx zlib libpng py3-pybind11 re2 eigen @@ -26,7 +26,6 @@ fi cmake ../%{n}-%{realversion}/cmake \ -G Ninja \ -Wno-dev \ - -DPYTHON_EXECUTABLE=${PYTHON3_ROOT}/bin/python3 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="%{i}" \ -DCMAKE_INSTALL_LIBDIR=lib \ @@ -43,19 +42,13 @@ cmake ../%{n}-%{realversion}/cmake \ -DCMAKE_TRY_COMPILE_PLATFORM_VARIABLES="CMAKE_CUDA_RUNTIME_LIBRARY" \ %endif -Donnxruntime_BUILD_CSHARP=OFF \ - -Donnxruntime_USE_OPENMP=OFF \ - -Donnxruntime_USE_TVM=OFF \ - -Donnxruntime_USE_LLVM=OFF \ -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF \ - -Donnxruntime_USE_NUPHAR=OFF \ -Donnxruntime_USE_TENSORRT=OFF \ -Donnxruntime_CROSS_COMPILING=OFF \ -Donnxruntime_USE_FULL_PROTOBUF=ON \ -Donnxruntime_DISABLE_CONTRIB_OPS=OFF \ - -Donnxruntime_PREFER_SYSTEM_LIB=ON \ -Donnxruntime_BUILD_UNIT_TESTS=OFF \ -DCMAKE_PREFIX_PATH="${ZLIB_ROOT};${LIBPNG_ROOT};${PROTOBUF_ROOT};${PY3_PYBIND11_ROOT};${RE2_ROOT};${EIGEN_ROOT}" \ - -DRE2_INCLUDE_DIR="${RE2_ROOT}/include" \ -DCMAKE_CXX_FLAGS="-Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=overloaded-virtual" # -Wno-error=stringop-overflow is needed to work around a false positive string overflow,