Add a new GEMV kernel to BRGEMM and enable it in MatMul#5077
Merged
densamoilov merged 12 commits intomainfrom Apr 30, 2026
Merged
Add a new GEMV kernel to BRGEMM and enable it in MatMul#5077densamoilov merged 12 commits intomainfrom
densamoilov merged 12 commits intomainfrom
Conversation
Contributor
Author
|
make test |
ankalinin
approved these changes
Apr 24, 2026
georgen117
reviewed
Apr 25, 2026
8d09d25 to
4b4f4ff
Compare
Contributor
Author
|
make test |
4b4f4ff to
c3970f3
Compare
Contributor
Author
|
make test |
c3970f3 to
4793a28
Compare
inteldimitrius
approved these changes
Apr 28, 2026
Contributor
Author
|
make test |
This kernel will enable matmul for the following cases: - A is a matrix, B is a vector, and A is transposed - A is a vector, B is a matrix, and B is not transposed
Redirect GEMV cases to GEMV code path when fpmath is not default because it's expected to be faster than the GEMM path.
brgemm_matmul now has broad support for GEMV cases. The only exception is cases with unusual input/output layouts. However, the GEMV code path in auto-generated GEMM is also not expected to support them. Therefore, the decision is to always use brgemm_matmul, whether for the GEMV path or the regular GEMM path for those exceptions and avoid falling back to auto-generated GEMM.
4793a28 to
182a729
Compare
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 adds a new GEMV kernel to BRGEMM to support the remaining cases and complete GEMV coverage.
The existing and the new GEMV kernels enable all four GEMV cases required for full support across layout and parameter combinations.
GEMV coverage in MatMul
transAparametertreat_y_as_rowparametery = A * xyᵀ = xᵀ * Aᵀyᵀy = Aᵀ * xyᵀ = xᵀ * AyᵀNote
transA: selects whether the BRGEMV usesAorAᵀtreat_y_as_row: for M=1, interpretsyas a row vectorAt the matmul level, these GEMV configurations are represented via
gemv_strategy_t.At the BRGEMM level, they are implemented using
transAandtreat_y_as_row.Performance


Performance was evaluated on ADL and SRF showing parity with auto-generated GEMM kernels.
As a result, GEMM implementations are no longer used in performance validation and have been fully replaced by BRGEMM matmul.