openblas: add patch to disable buggy SME SGEMM kernel (#441795)

This commit is contained in:
Emily
2025-09-10 16:57:19 +01:00
committed by GitHub
2 changed files with 22 additions and 0 deletions
@@ -194,6 +194,12 @@ stdenv.mkDerivation rec {
hash = "sha256-foP2OXUL6ttgYvCxLsxUiVdkPoTvGiHomdNudbSUmSE=";
};
patches = [
# Remove this once https://github.com/OpenMathLib/OpenBLAS/issues/5414 is
# resolved.
./disable-sme-sgemm-kernel.patch
];
postPatch = ''
# cc1: error: invalid feature modifier 'sve2' in '-march=armv8.5-a+sve+sve2+bf16'
substituteInPlace Makefile.arm64 --replace "+sve2+bf16" ""
@@ -275,6 +281,9 @@ stdenv.mkDerivation rec {
})
);
# The default "all" target unconditionally builds the "tests" target.
buildFlags = lib.optionals (!doCheck) [ "shared" ];
doCheck = true;
checkTarget = "tests";
@@ -0,0 +1,13 @@
diff --git a/interface/gemm.c b/interface/gemm.c
index c5182c266..7056422e1 100644
--- a/interface/gemm.c
+++ b/interface/gemm.c
@@ -436,7 +436,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
#endif
#if defined(ARCH_ARM64) && (defined(USE_SGEMM_KERNEL_DIRECT)||defined(DYNAMIC_ARCH))
#if defined(DYNAMIC_ARCH)
- if (support_sme1())
+ if (false)
#endif
if (beta == 0 && alpha == 1.0 && order == CblasRowMajor && TransA == CblasNoTrans && TransB == CblasNoTrans) {
SGEMM_DIRECT(m, n, k, a, lda, b, ldb, c, ldc);