Add thread throttling profile for DGEMV on NEOVERSEV1#5175
Merged
martin-frbg merged 3 commits intoOpenMathLib:developfrom Mar 25, 2025
Merged
Add thread throttling profile for DGEMV on NEOVERSEV1#5175martin-frbg merged 3 commits intoOpenMathLib:developfrom
martin-frbg merged 3 commits intoOpenMathLib:developfrom
Conversation
Author
|
Please help with review |
e311258 to
d7a2b6b
Compare
annop-w
suggested changes
Mar 13, 2025
|
|
||
| //thread throttling for dgemv | ||
| #if defined(DYNAMIC_ARCH) || defined(NEOVERSEV1) | ||
| static inline int get_dgemv_optimal_nthreads_neoversev1(BLASLONG MN, int ncpu) { |
Contributor
There was a problem hiding this comment.
Instead of defining a new function, I think it is cleaner to just use get_gemv_optimal_nthreads_<uarch>.
Inside get_gemv_optimal_nthreads_<uarch>, we can #ifdef DOUBLE.
Collaborator
There was a problem hiding this comment.
Yes, please keep this inside the existing function.
| @@ -98,6 +116,8 @@ static inline int get_gemv_optimal_nthreads(BLASLONG MN) { | |||
| #endif | |||
| #if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) | |||
Contributor
There was a problem hiding this comment.
Suggested change
| #if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) | |
| #if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(BFLOAT16) |
| #if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) | ||
| return get_gemv_optimal_nthreads_neoversev1(MN, ncpu); | ||
| #elif defined(NEOVERSEV1) && !defined(COMPLEX) && defined(DOUBLE) && !defined(BFLOAT16) | ||
| return get_dgemv_optimal_nthreads_neoversev1(MN, ncpu); |
| return get_dgemv_optimal_nthreads_neoversev1(MN, ncpu); | ||
| #elif defined(NEOVERSEV2) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) | ||
| return get_gemv_optimal_nthreads_neoversev2(MN, ncpu); | ||
| #elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) |
Contributor
There was a problem hiding this comment.
Suggested change
| #elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) | |
| #elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(BFLOAT16) |
| if (strcmp(gotoblas_corename(), "neoversev1") == 0) { | ||
| return get_dgemv_optimal_nthreads_neoversev1(MN, ncpu); | ||
| } | ||
|
|
| : MN < 435600L ? MIN(ncpu, 24) | ||
| : MN < 810000L ? MIN(ncpu, 32) | ||
| : MN < 1050625 ? MIN(ncpu, 40) | ||
| : ncpu; |
Contributor
There was a problem hiding this comment.
Could we please move this inside get_gemv_optimal_nthreads_neoversev1 and use #ifdef DOUBLE ?
d7a2b6b to
8e289ec
Compare
Contributor
|
@shubhamsvc Thank you for the changes. LGTM. |
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.
This PR introduces thread throttling for DGEMV on Neoverse V1.
Benchmarking results for matrix sizes [2,1024]:
Machine: AWS Graviton3 Processor
- dgemv_n: Geometric mean speedup of 2.2x

- dgemv_t: Geometric mean speedup of 2.7x
