Skip to content

test_extensions/test_sgemmt.c fails with SME on Apple M4 #5414

@al3xtjames

Description

@al3xtjames

Building commit d23680b with make -j DYNAMIC_ARCH=1 TARGET=VORTEX results in test failures on Apple M4:

TEST 1135/1522 sgemmt:c_api_rowmajor_upper_M_50_K_50_a_notrans_b_notrans [FAIL]
  ERR: test_extensions/test_sgemmt.c:797  expected 0.000e+00, got 2.741e-01 (diff -2.741e-01, tol 1.000e-04)
TEST 1139/1522 sgemmt:c_api_rowmajor_upper_alpha_zero [FAIL]
  ERR: test_extensions/test_sgemmt.c:888  expected 0.000e+00, got 8.187e-03 (diff -8.187e-03, tol 1.000e-04)
TEST 1140/1522 sgemmt:c_api_rowmajor_upper_beta_one [FAIL]
  ERR: test_extensions/test_sgemmt.c:910  expected 0.000e+00, got 3.662e-01 (diff -3.662e-01, tol 1.000e-04)
TEST 1141/1522 sgemmt:c_api_rowmajor_lower_M_50_K_50_a_notrans_b_notrans [FAIL]
  ERR: test_extensions/test_sgemmt.c:933  expected 0.000e+00, got 2.784e-01 (diff -2.784e-01, tol 1.000e-04)
TEST 1145/1522 sgemmt:c_api_rowmajor_lower_alpha_zero [FAIL]
  ERR: test_extensions/test_sgemmt.c:1024  expected 0.000e+00, got 8.250e-03 (diff -8.250e-03, tol 1.000e-04)
TEST 1146/1522 sgemmt:c_api_rowmajor_lower_beta_one [FAIL]
  ERR: test_extensions/test_sgemmt.c:1046  expected 0.000e+00, got 3.539e-01 (diff -3.539e-01, tol 1.000e-04)

These failures only occur with the SME SGEMM direct kernel. I no longer see the test failures if I disable SME support with the following patch:

diff --git a/interface/gemm.c b/interface/gemm.c
index 54e5604fd..cde3038e6 100644
--- a/interface/gemm.c
+++ b/interface/gemm.c
@@ -429,7 +429,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);

This was initially reported on the numpy bug tracker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions