27 Commits
Author SHA1 Message Date
Amrita H S 0d6d459161 power/bgemm: add BFloat16-in, BFloat16-out GEMM kernel for POWER10
Add BGEMM (BF16 input → BF16 output) for POWER10 by reusing the
existing SBGEMM kernel infrastructure. A -DBGEMM compile flag switches
only the store path; the xvbf16ger2pp MMA instruction and BF16 packing
routines are shared with SBGEMM unchanged.

Changes
-------
kernel/power/KERNEL.POWER10
  - Register BGEMM kernel and copy-routine targets, reusing the
    sbgemm_ncopy/tcopy sources (packing layout is identical).

kernel/power/sbgemm_kernel_power10.c
  - Under BGEMM: force v4sf_t to float so accumulators stay in
    float32; add STORE4_BF16/STORE2_BF16 macros (read BF16 C, widen,
    apply alpha*acc, convert back via xvcvspbf16, store); add
    f32_to_bf16_scalar() for m&1/n&1 tails; add BGEMM variants of
    all SAVE_ACC macros covering the full m/n tile hierarchy.

param.h
  - Add BGEMM_DEFAULT_UNROLL_M=16, UNROLL_N=8, P/Q/R blocking
    parameters for POWER10, matching the 16x8 kernel tile.

Unit test (utest/test_extensions/test_bgemm.c)
  - Uses SBGEMM as a trusted reference. 21 test cases cover all four
    transpose combinations, all m/n remainder paths, odd-k, alpha=0,
    beta=0/1, and the m>=32 fast path. Tolerance 0.01 to account for
    the one extra BF16 rounding on the BGEMM store.

Performance (POWER10, single-threaded, Transa=N Transb=N)
----------------------------------------------------------
Step=1 (sizes 1–200):
  - Sizes 1–80:   baseline 0.1–128 MFlops (scalar fallback);
                  patch 0.1–39,656 MFlops (up to ~350x faster at M=80).
  - Sizes 81–200: patch 3x–24x faster (avg ~10x) with 16×8 MMA tile
                  engaged.

Step=8 (sizes 8–1024):
  - Baseline peaks at ~2,950 MFlops (avg ~1,746 MFlops).
  - Patch sustains 75,000–1,009,866 MFlops for sizes 384–960,
    exceeding 1 TFlops at large sizes.
  - Median speedup ~99x; average speedup ~140x across all sizes.

Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com>
2026-07-23 02:13:31 -05:00
aadityansha06 2c6bf39e4e Add transpose support for C in GEADD (fixes #4646)
Extends GEADD to support independent transposition of both A and C,
matching the behavior of cuBLAS's geam and Apple's Accelerate geadd.
Previously only A could be transposed.

- Add transc parameter across cblas.h, common_interface.h,
  common_level3.h, common_param.h
- Add transc handling to interface/geadd.c and interface/zgeadd.c
- Extend kernel/generic/geadd.c and kernel/generic/zgeadd.c with
  stride logic for transposed C
- Add transpose test coverage (hand-verified 2x2 cases and randomized
  large-matrix tests) for sgeadd, dgeadd, cgeadd, zgeadd
2026-07-15 17:12:31 +05:30
moluopro ed8f1198b2 utest: bound XERBLA routine name diagnostics 2026-07-10 15:40:02 +08:00
moluopro 29703e52ad utest: cover explicit XERBLA handler registration 2026-07-10 14:59:30 +08:00
Martin Kroeker 7fe8bd8046 build comparison functions for complex cases too 2026-02-18 19:12:35 +01:00
Martin Kroeker 7d7a6c6708 Build the comparison functions as needed to avoid missing references 2026-02-18 11:43:43 +01:00
Martin Kroeker 57208b8bce Disable tests with incx,incy=0 (undefined behavior) 2025-02-09 20:17:29 +01:00
Martin Kroeker 3a4a9b21eb Disable tests with incx,incy=0 (undefined behavior) 2025-02-09 20:16:03 +01:00
Martin Kroeker 05fe49ddaf Rename local copy functions to avoid name clash with the standard BLAS ones 2024-12-23 19:12:17 +01:00
Martin Kroeker 550bc77832 Fix expectation values for CblasRowMajor order 2024-10-10 20:39:29 +02:00
Martin Kroeker b45a78c6e9 fix zdotu argument passing in utest_ext on windows (#4691)
* fix passing of results on windows
2024-05-13 14:50:50 +02:00
Matti Picus 243640c354 use blasint instead of int to quiet warnings 2024-05-12 10:24:16 +03:00
Martin Kroeker d8baf2f2ea Support compilation without CBLAS 2024-05-11 13:10:54 +02:00
Martin Kroeker b1d722fc0c Fix cast to work with INTERFACE64 (especially on big-endian) 2024-04-29 15:37:26 +02:00
Ayappan P f4ee0a423b Fix openblas_utest_ext build in AIX 2024-04-25 07:32:21 -04:00
Martin Kroeker 61214fcef7 Fix utest_ext build on AIX (#4657)
* Add all-in-one version of utest_ext for AIX
2024-04-22 14:24:33 +02:00
Martin Kroeker b883526a34 Fix uninitialized variables in the extensions utest 2024-04-13 12:26:35 +02:00
Martin Kroeker f81c1d4b59 Fix portability problem 2024-02-27 07:19:52 +01:00
Martin Kroeker f7ffab870b fix missing malloc 2024-02-26 23:03:10 +01:00
Martin Kroeker 38283f678e Fix portability problems 2024-02-26 22:22:48 +01:00
kseniyazaytseva 4c554bd527 check abs zero inc 2024-02-10 00:46:52 +03:00
kseniyazaytseva cfabc48190 Update rotg tests 2024-02-08 00:22:15 +03:00
kseniyazaytseva ec5cfe3bc8 Fix invalid tests 2024-02-08 00:21:38 +03:00
kseniyazaytseva ff10e6b6dc Fix zero step tests 2024-02-08 00:19:54 +03:00
kseniyazaytseva f68e9989c4 Remove zero rows/columns matcopy tests 2024-02-02 12:26:23 +03:00
Andrey Sokolov c99e231fc5 Fix rand_generate 2024-01-18 23:56:22 +03:00
kseniyazaytseva bf39c0d8b5 Added new tests for BLAS-like and BLAS API in utest 2024-01-18 23:56:22 +03:00