Skip to content

Implementing SVE in [SD]AXPY Kernels for A64FX and Graviton3E #5426

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hideaki-motoki
Copy link
Contributor

Resolves #5417.
This change improves the performance of [SD]AXPY on both A64FX and Graviton3E.
The graphs below show the single thread performance improvement of [D]AXPY on A64FX and Graviton3E, respectively.
level1 daxpy
level1 daxpy_

The performance improved by 2.57 times on the A64FX and 1.13 times on the Graviton3E.
I have confirmed that this optimization also yields performance benefits for Level 2 BLAS kernels that utilize [SD]AXPY, such as [SD]SPMV and [SD]GER.

@martin-frbg martin-frbg added this to the 0.3.31 milestone Aug 21, 2025
@@ -32,6 +32,10 @@ SGEMVNKERNEL = gemv_n_sve_v1x3.c
DGEMVNKERNEL = gemv_n_sve_v1x3.c
SGEMVTKERNEL = gemv_t_sve_v1x3.c
DGEMVTKERNEL = gemv_t_sve_v1x3.c

SAXPYKERNEL = axpy_sve.c
DAXPYKERNEL = axpy_sve.c
Copy link
Contributor

@snadampal snadampal Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you have used the SVL for the implementation instead of hardcoding the vector width, the kernel should work on NEOVERSEV2 as well. Please check this on Graviton4 and add it to KERNEL.NEOVERSEV2 as well.

BLASLONG sve_size = SV_COUNT();

if (n < 0) return (0);
if (da == 0.0) return (0);
Copy link
Contributor

@snadampal snadampal Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't these two checks be combined into one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comments.
There was another way you mentioned, but I followed kernel/arm/axpy.c#L45-L46.

@snadampal
Copy link
Contributor

Hi @hideaki-motoki , thanks for the PR! I have added few comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing SVE in AXPY Kernels for A64FX and Graviton3E
3 participants