Skip to content

ARM64: Enable bfloat16 kernels by default #5396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/apple_m.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ jobs:
echo "max_size = 300M" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s

- name: Add gfortran runtime to link path
if: matrix.build == 'make' && runner.os == 'macOS'
run: |
GFORTRAN_LIBDIR=$(gfortran -print-file-name=libgfortran.dylib | xargs dirname)
echo "Using gfortran runtime in $GFORTRAN_LIBDIR"
echo "LDFLAGS=-L/opt/homebrew/opt/llvm/lib -L$GFORTRAN_LIBDIR" >> $GITHUB_ENV

- name: Build OpenBLAS
run: |
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export CC="/opt/homebrew/opt/llvm/bin/clang"
case "${{ matrix.build }}" in
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/dynamic_arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ jobs:
echo "max_size = 300M" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s

- name: Add gfortran runtime to link path
if: matrix.build == 'make' && runner.os == 'macOS'
run: |
GFORTRAN_LIBDIR=$(gfortran -print-file-name=libgfortran.dylib | xargs dirname)
echo "Using gfortran runtime in $GFORTRAN_LIBDIR"
# Preserve whatever LDFLAGS may already contain
echo "LDFLAGS=${LDFLAGS:+$LDFLAGS }-L$GFORTRAN_LIBDIR" >> "$GITHUB_ENV"

- name: Build OpenBLAS
run: |
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ In chronological order:

* Abhishek Kumar <https://github.com/abhishek-iitmadras>
* [2025-04-22] Optimise dot kernel for NEOVERSE V1
* [2025-07-23] ARM64-Enable bfloat16 kernels by default

* Sharif Inamdar <[email protected]>
* [2025-06-05] Optimize gemv_n_sve_v1x3 kernel
Expand Down
3 changes: 1 addition & 2 deletions Makefile.system
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ SMALL_MATRIX_OPT = 1
BUILD_BFLOAT16 = 1
else ifeq ($(ARCH), arm64)
SMALL_MATRIX_OPT = 1
BUILD_BFLOAT16 = 1
endif
ifeq ($(ARCH), loongarch64)
SMALL_MATRIX_OPT = 1
Expand Down Expand Up @@ -425,10 +426,8 @@ ifeq ($(OSNAME), Darwin)
ifndef MACOSX_DEPLOYMENT_TARGET
ifeq ($(ARCH), arm64)
export MACOSX_DEPLOYMENT_TARGET=11.0
ifeq ($(C_COMPILER), GCC)
export NO_SVE = 1
export NO_SME = 1
endif
else
export MACOSX_DEPLOYMENT_TARGET=10.8
endif
Expand Down
1 change: 1 addition & 0 deletions kernel/arm64/bgemm_kernel_4x4_neoversev1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* *****************************************************************************/

#include <arm_sve.h>
#include <arm_neon.h>

#include "common.h"

Expand Down
1 change: 1 addition & 0 deletions kernel/arm64/bgemm_kernel_4x4_neoversev1_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* *****************************************************************************/

#include <arm_sve.h>
#include <arm_neon.h>

#include "common.h"

Expand Down
1 change: 1 addition & 0 deletions kernel/arm64/bgemv_n_sve_v3x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common.h"

#include <arm_sve.h>
#include <arm_neon.h>

#define UPDATE_PTRSx2 \
a_ptr1 = a_ptr0 + lda;
Expand Down
Loading