ARM64 SME: fix zero-scalar handling and clean up direct kernels#5889
Merged
Conversation
Avoid loading C when beta is zero; ZA has already been initialized to zero. For alpha == 0 or K == 0, skip A preprocessing and reuse the direct kernel with k = 0 to perform only the beta update.
When alpha is zero, avoid preprocessing the symmetric matrix and reuse the SGEMM alpha/beta direct kernel with k = 0 for the beta-only update.
Avoid loading C when beta is zero, and skip A preprocessing for alpha == 0 or K == 0 by reusing the triangular direct kernel with k = 0.
Avoid loading C when beta is zero, and skip A/B preprocessing for alpha == 0 or K == 0 by reusing the triangular direct kernel with k = 0.
The padded SME dimensions are integer quantities, so compute them with integer arithmetic and drop the now-unused math.h include.
Use const source pointers in the symmetric preprocessing helpers and compile only the LU or LL helper needed by each object variant.
Mark the read-only B input const and limit sve_cntw and ldb definitions to the variants that use them.
Mark read-only transpose inputs const and limit sve_cntw and ldb definitions to the variants that use them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Fix zero alpha/beta semantics
The concrete issues are:
beta == 0.alpha == 0orK == 0, only thebeta*Cupdate is required; A and B should not be read.0 * NaN.2. Use integer round-up for padded SME dimensions
is replaced with integer arithmetic:
3. Clean up
constand unused warningsconst float *restrict.UPPER/LOWERobject variant.Bparameter in SSYRKkernel_2x2()toconst float *.B_TandA_Tparameters in SSYR2Kkernel_2x2()toconst float *.sve_cntw()andldbonly in theTRANSA/!TRANSAvariants that actually use them.