Skip to content
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
26 changes: 0 additions & 26 deletions onnxruntime-gcc13.patch

This file was deleted.

47 changes: 47 additions & 0 deletions onnxruntime/cms-changes.patch
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <thread>
#include <mutex>

@@ -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<int64_t> 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
17 changes: 5 additions & 12 deletions onnxruntime.spec → onnxruntime/spec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand All @@ -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,
Expand Down