The misdetection affects double precision on Jammy, not only sbgemm.

On an Intel Xeon w9-3575X (Sapphire Rapids workstation; avx512f, avx512_bf16,
amx_tile), Ubuntu 22.04.5, libopenblas0-pthread 0.3.20+ds-1, R 4.6.1 linked to
`/usr/lib/x86_64-linux-gnu/openblas-pthread/`:

- `OPENBLAS_VERBOSE=2` reports `Core: Cooperlake`.
- With that kernel, LAPACK results are wrong: `solve()` already for matrices of
  order 12 and 20 (max |A^-1 A - I| of 3.1 and 1.6 on random SPD matrices;
  up to 19 at order 40), `chol()` from order 40 (fails on well-conditioned
  SPD matrices),
  and `eigen()` (reconstruction error about 3e4 at order 200).
- `OPENBLAS_CORETYPE=SkylakeX` or `Haswell` gives errors of about 1e-16 on the
  same matrices; `OPENBLAS_CORETYPE=Cooperlake` reproduces the error.
- `OPENBLAS_NUM_THREADS=1` does not change the result.

Reproduction (R; the matrix is the AR(1) correlation 0.5^|i-j|, condition
number about 9):

```r
A <- 0.5^abs(outer(1:64, 1:64, "-"))
max(abs(crossprod(chol(A)) - A))           # 0.25 (Cooperlake), 1e-16 (SkylakeX)
B <- 0.5^abs(outer(1:20, 1:20, "-"))
max(abs(solve(B) %*% B - diag(20)))        # 0.5 (Cooperlake), 1e-16 (SkylakeX)
```

```sh
OPENBLAS_VERBOSE=2 Rscript -e 'A <- 0.5^abs(outer(1:64,1:64,"-")); 
max(abs(crossprod(chol(A))-A))'
OPENBLAS_VERBOSE=2 OPENBLAS_CORETYPE=SkylakeX Rscript -e 'A <- 
0.5^abs(outer(1:64,1:64,"-")); max(abs(crossprod(chol(A))-A))'
```

The results are wrong without any warning, so any numerical software on Jammy
with this CPU (R, NumPy linked to the system OpenBLAS, ...) can return
incorrect results. Upstream reworked the Cooperlake / Sapphire Rapids runtime
selection in 0.3.22 and 0.3.24 (Changelog: "fixed runtime selection of
COOPERLAKE in DYNAMIC_ARCH builds"; "fixed runtime detection of Cooperlake and
Sapphire Rapids in DYNAMIC_ARCH").

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2040027

Title:
  [SPR][ICX] OpenBLAS: Issues while testing sbgemm for Sapphire Rapids
  (SPR)

To manage notifications about this bug go to:
https://bugs.launchpad.net/intel/+bug/2040027/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to