Commit Graph

107 Commits

Author SHA1 Message Date
Martin Kroeker 5c89e4c770
remove the stricted build flags 2025-10-10 11:09:56 +02:00
Chris Sidebottom 37fc3bbca0 Add Infrastructure for SHGEMV
This adds all the relevant bits and pieces to add a `shgemv` path as
well as a future `hgemm`/`hgemv` path in a similar model to `sb` and `b`
interfaces.

I've also fixed a few bits and pieces around `shgemm` which didn't build
in a few situations.
2025-10-07 15:03:24 +00:00
Chris Sidebottom 578e7dae85 Fix bf16->f32 conversion for NEOVERSEV1 and NEOVERSEN2 targets
This fixes an issue originally introduced with the BGEMM kernel.

I've updated the tests to run with `beta=1.0` so as to test loading and
updating from C.

Alongside this, the tests now return sensible return values to reduce
the risk of them being ignored.

Also fixed a bug in `generic/gemv_t.c` resulting in weird outputs for
`bgemv`.
2025-10-06 18:05:58 +00:00
Martin Kroeker b66a01f909
Fix building of bgemm tests on GEMM3M-capable (x86) targets 2025-07-28 22:43:28 +02:00
Chris Sidebottom ea2faf0c9a Add optimized BGEMM for NEOVERSEN2 target
This re-uses the existing NEOVERSEN2 8x4 `sbgemm` kernel to implement `bgemm`.
2025-07-24 10:59:28 +00:00
Chris Sidebottom 2c3cdaf74e Optimized BGEMV for NEOVERSEV1 target
- Adds bgemv T based off of sbgemv T kernel
- Adds bgemv N which is slightly alterated to not use Y as an
accumulator due to the output being bf16 which results in loss of
precision
- Enables BGEMM_GEMV_FORWARD to proxy BGEMM to BGEMV with new kernels
2025-07-23 10:51:41 +01:00
Martin Kroeker 38e6999295
format cleanup 2025-07-18 23:45:08 +02:00
Martin Kroeker 3df503cafd
portability fix and cleanup 2025-07-18 23:41:57 +02:00
Chris Sidebottom e105411460 Add infrastructure for bgemv/bscal
- Sets up all the various entrypoints for `bgemv`
- Adds `bscal` for use in the `bgemv` interface
- Adds test cases for comparing `sgemv` and `bgemv`
- Adds generic kernels for `bgemv_n` and `bgemv_t` which are accurate
enough to pass above tests
2025-07-15 14:48:57 +01:00
Chris Sidebottom 09a016fdf6 Split sbgemv test from sbgemm test 2025-07-13 13:39:44 +00:00
Chris Sidebottom 3f110c8272 Improve bgemm and sbgemm testing
- Fixes wrong return type for `is_close`
- Adds stricter compiler flags for test files so we don't see the above
issue again
- Re-uses test helper functions between compare_sgemm_sbgemm/bgemm.c
2025-07-13 12:48:09 +00:00
Martin Kroeker aad97c7763
Fix return type declaration 2025-07-11 15:32:41 +02:00
Chris Sidebottom 740efd71c4 Add optimized BGEMM kernel for NEOVERSEV1 target
This also improves the testing and generic kernel by re-using the BF16
conversion functions.

Built on top of https://github.com/OpenMathLib/OpenBLAS/pull/5357 and derived from https://github.com/OpenMathLib/OpenBLAS/pull/5287

Co-authored-by: Ye Tao <ye.tao@arm.com>
2025-07-10 23:23:27 +00:00
Martin Kroeker 9a272fece6
Re-enable the BGEMM tests 2025-07-10 15:02:59 +02:00
Martin Kroeker b54aec804e
remove spurious include 2025-07-10 15:00:30 +02:00
Chris Sidebottom 8cd4be8d47 Temporarily disable test_bgemm 2025-07-09 08:27:18 +01:00
Chris Sidebottom f95e7b0e32 Add infrastructure for BGEMM
Setting up all the infrastructure for BGEMM support in OpenBLAS, hopefully I found all the right places.

Derived mostly from the previous work done in https://github.com/OpenMathLib/OpenBLAS/pull/5287

Co-authored-by: Ye Tao <ye.tao@arm.com>
2025-07-08 16:22:41 +01:00
Martin Kroeker 70865a894e
Merge pull request #5180 from ywwry66/openmp_use_cmake
CMake: Pass `OpenMP` compiler and linker flags through CMake targets
2025-04-08 13:16:07 -07:00
Martin Kroeker 1c5d0d5539
move libomp to extralib 2025-04-08 10:44:36 +02:00
Ruiyang Wu 1b0c0f00e9 CMake: Avoid mixed OpenMP linkage 2025-03-26 23:52:13 -04:00
Ye Tao 4346b91559 add beta and alpha testcase for sbgemv 2025-02-28 16:48:47 +00:00
Chip Kerchner 36bd3eeddf Vectorize BF16 GEMV (VSX & MMA). Use GEMM_GEMV_FORWARD_BF16 (for Power). 2024-10-13 13:46:11 -05:00
Rohit Goswami 722e4ae07a
MAINT: Explicitly replace instead of unknown 2024-10-05 16:23:02 +00:00
Rohit Goswami a6b7751881
BUG: Allow tests to be run multiple times
Without failures due to existing files
2024-10-05 16:22:56 +00:00
Chip Kerchner 89702e1f4a Fix zero element GEMV test. 2024-08-16 11:37:39 -05:00
Chip Kerchner 77f85c7c00 GEMV tests don't like zero elements. 2024-08-16 11:15:32 -05:00
Chip Kerchner 868aa857bc Change malloc zero to return one byte and update the SBGEMM test to again use sizes of zero. 2024-08-16 10:28:10 -05:00
Chip Kerchner b1802f4dc8 Fix unit test to start at 1 instead of 0 - since malloc zero bytes fails on some systems. 2024-08-16 09:51:37 -05:00
Chip Kerchner c23897f585 Add GEMV testing to SBGEMx vs SGEMx testing. 2024-08-14 15:55:23 -05:00
Martin Kroeker 6452f7b46d
Merge pull request #4873 from ChipKerchner/fixSBGEMMDefaults
[POWER] Problem with multi-threaded SBGEMM
2024-08-14 19:22:03 +02:00
Chip Kerchner 31226740d6 Cleanup of SBGEMM unit test. 2024-08-14 08:10:25 -05:00
Henry Chen 20bdb65882 Fix recursive variable expansion in Makefiles for LOONGSON3A 2024-08-14 15:08:32 +08:00
Chip Kerchner b1737698db Fix DEFAULTS in SBGEMM for POWER10. Also comparisons for SBGEMM unit test can be exactly due to epilison differences. 2024-08-13 07:01:21 -05:00
Martin Kroeker 76db713e79
fix invocation of GEMM3M tests 2024-08-07 21:37:20 +02:00
Vladimir Nikolić 56e1782ffb
Add another missing parenthesis 2024-07-15 15:15:23 -07:00
Chip Kerchner f708944fea Add all 4 variations of the SBGEMM to compare_sgemm_sbgemm 2024-07-10 13:07:48 -05:00
Martin Kroeker edacf9b397
Work around spurious BLAS3 test errors on LOONGSON3R3/4 (#4667)
Force compilation with gfortran to use O0 on older Loongson hardware to avoid spurious test failures
2024-04-30 08:50:47 +02:00
Martin Kroeker 28f151808e
Avoid overriding the global USE_GEMM3M 2024-02-26 21:01:46 +01:00
Martin Kroeker ba201c1939
Enable GEMM3M tests on supported platforms 2024-02-25 23:39:24 +01:00
Martin Kroeker 4adfe4d531
Avoid linking both libgomp and libomp in mixed clang/gfortran builds 2024-02-22 22:16:01 +01:00
Martin Kroeker e9f480111e
fix sbgemm bfloat16 conversion errors introduced in PR 4488 2024-02-07 19:57:18 +01:00
Martin Kroeker fb99fc2e6e
fix type conversion warnings 2024-02-07 13:42:08 +01:00
Chip Kerchner 61c8e19f95 Fix Makefile to support OpenMP on AIX for xlc (clang) with xlf. 2024-01-31 15:27:50 -06:00
Isuru Fernando 6b2651ece3 Fix building test_sbgemm 2023-11-19 02:57:13 -06:00
Chip-Kerchner d46eba06a7 Pack structure only on AIX. 2023-10-12 09:41:33 -05:00
Chip-Kerchner e98e3c4783 Fix float32_bits union so that it always the sizeof float. 2023-10-11 18:05:55 -05:00
Chip-Kerchner 97a61d0577 Fix bfloat16_bits union so that it always the sizeof unsigned short. 2023-10-11 17:36:43 -05:00
Martin Kroeker 2a9981a244
Add -lgomp when IBM xlf is combined with gcc in OPENMP builds 2023-09-24 10:19:11 +02:00
Martin Kroeker 44e6e5479b
Use the C compiler for the C SBGEMM test source 2023-09-21 23:01:21 +02:00
Aiden Grossman b209915121 Fix build with clang
There are two instances when building the tests where OpenBLAS fails to
build with OpenMP and clang due to library paths getting reset as flags
are set rather than appended. This seems to only affect certain
clang/libomp installations, but if it's already grabbing the correct
library paths we might as well use them.
2023-07-28 12:59:44 -07:00