Skip to content

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried performance evaluations on a Grace equipped with Neoverse V2, as I did not have access to a Graviton4 for testing. The results showed that AXPY with SVE did not show significant performance improvement compared to the original version.
level1 daxpy
This graph shows the single thread performance of DAXPY on Grace. For this pull request, there is little advantage to implementing SVE on Neoverse V2.

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.

@martin-frbg martin-frbg merged commit 06c09de into OpenMathLib:develop Aug 26, 2025
98 of 103 checks passed
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