168 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
Martin Kroeker 3e48730742 Add transpose support for C in GEADD (fixes #4646) (#5913)
* 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

* Add self to CONTRIBUTORS.md
2026-07-15 18:34:43 +02:00
Martin Kroeker dc3aa2cbd9 Fix non-SVE ARM64 potentially using non-zeroed register in SDOT/DDOT accumulation (#5918)
* Zero d0 register as it may not be identical with OUT, amend clobber list

* Add sdot/ddot reproducer from issue 5917 as ARM64-specific utest
2026-07-15 17:30:11 +02: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
mpwaser 48c927bd1f Fix CTest command for openblas_utest_ext 2026-07-09 09:50:42 +02:00
Martin Kroeker 983fca52d5 Merge branch 'develop' into jn/build-exe 2026-03-23 18:59:02 +01:00
Martin Kroeker 2bdfe31986 Free arrays after test 2026-03-17 23:22:20 +01:00
Martin Kroeker 5741aab90b Avoid resolving wild pointers in automatic search for tests 2026-03-17 23:20:51 +01: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 566e315f4f Make test_post_fork_async depend on LAPACK as it uses getrf 2026-01-18 19:59:49 +01:00
Jameson NashandClaude Opus 4.5 7414e363f0 Add $(EXE) suffix to executables in Makefiles
Define EXE variable in Makefile.system (set to .exe on Windows,
empty otherwise) and update all test executables to use it for
Windows compatibility.

- Makefile.system: Add EXE variable definition
- test/Makefile: Update all executables with $(EXE) suffix
- ctest/Makefile: Update all executables with $(EXE) suffix
- utest/Makefile: Update UTESTBIN and UTESTEXTBIN with $(EXE) suffix
- Makefile.install: Update install_tests target with $(EXE) suffix
- .gitignore: Add *.exe pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 14:49:34 -05:00
mayeut 7750d507ff chore: add test case for exec_blas_async after fork
most functions are using exec_blas but dgetrf  uses exec_blas_async directly and the behavior after fork is not the same. It's currently deadlocking.
2025-11-29 22:55:25 +01:00
Martin Kroeker 11ff18bb0f Merge pull request #5081 from XiWeiGu/kernel_generic_fixed_cscal_zscal
kernel/generic: Fixed cscal and zscal
2025-06-12 01:03:00 -07:00
Harmen Stoppels 3d6d026fe1 no-gcse when loongarch64 2025-04-10 15:44:31 +02:00
Harmen Stoppels 51ba70f47b test_potrs.c: remove pragma darwin-aarch64 support
Using GCC 14.2.0 on Darwin, the pragma ultimately causes a linker error
"ld: invalid r_symbolnum=". The current workaround is to use the old
linker, but (a) it's deprecated and (b) it can produce libraries that
are subsequently not linkable with the newer linker in dependents: the
new ld64 does not link to libraries with duplicate rpaths created by the
classic linker.
2025-04-10 15:20:34 +02: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
tingbo.liao 3c8df6358f Further rearranged the rotm kernel for the different architectures.
Signed-off-by: tingbo.liao <tingbo.liao@starfivetech.com>
2025-01-22 11:41:12 +08:00
gxw 6954845d8d utest: Add utest for {c/z}scal and {c/z}gemv 2025-01-21 14:24:03 +08:00
tingbo.liao 14c72d616a Add the test cases of rot to improve unit testing.
Signed-off-by: tingbo.liao <tingbo.liao@starfivetech.com>
2025-01-02 10:05:57 +08: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 64c6c79201 Assume no underline suffixes on symbols when compiling with Intel ifx on Windows 2024-12-23 19:09:34 +01:00
Martin Kroeker 550bc77832 Fix expectation values for CblasRowMajor order 2024-10-10 20:39:29 +02:00
Martin Kroeker dfba3f8841 restore the pragma as it is reportedly still needed on 3C6000/gcc14.2 2024-08-16 11:23:19 +02:00
Martin Kroeker 49080b631e remove optimizer pragma again 2024-08-15 22:15:27 +02:00
Martin Kroeker a090011fbf just use numeric constants in dimensions 2024-07-26 12:56:12 +02:00
Martin Kroeker db5328e85b make array dimensions constant 2024-07-26 12:45:39 +02:00
Martin Kroeker d9ae4609fb remove C99 requirement 2024-07-26 11:15:33 +02:00
Martin Kroeker 15c53dd2e0 Merge pull request #4794 from XiWeiGu/Fixed_Numpy_CI_Test
Try to fixed numpy ci test failures
2024-07-25 23:42:13 +02:00
Martin Kroeker 29f3e759b9 work around a gcc14.1 bug observed on Loongarch 2024-07-23 11:20:48 +02:00
gxw 9b3e80efe2 utest: Add test_gemv 2024-07-15 16:33:09 +08:00
Martin Kroeker a2ee4b1966 Merge branch 'OpenMathLib:develop' into issue4728 2024-06-21 09:35:56 +02:00
Martin Kroeker 33bb4b98a4 Improve error message output from the fork() utest (#4753)
* Add perror to report the reason for a fork failure
* reword the malloc failure message
2024-06-15 14:16:48 +02:00
Martin Kroeker ffc1ab3f6e Test corner cases of all SCAL variants 2024-06-06 23:58:16 +02:00
Martin Kroeker a16f8249ba add tests with the imaginary part of the array infinite 2024-05-31 01:08:17 +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 a6c184d150 forward NO_CFLAGS to the CFLAGS, if set 2024-05-11 13:07:30 +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 9c86838279 use blasint for INTERFACE64 compatibility 2024-04-05 22:48:08 +02:00
Martin Kroeker d3f93c6015 fix arguments of zscal 2024-04-05 07:23:41 +02:00
Martin Kroeker 1f080b9328 Update test_zscal.c 2024-04-05 07:09:34 +02:00
Martin Kroeker ec8e9451f0 make independent of CBLAS 2024-04-05 06:45:59 +02:00