[SYSTEMDS-3168] Add optimized transposed dense-sparse and sparse-dense matrix multiplication kernels.#2544
Open
willy-rabe wants to merge 2 commits into
Conversation
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.
[SYSTEMDS-3168] Add optimized transposed dense-sparse and sparse-dense matrix multiplication kernels.
Summary
This PR adds specialized matrix multiplication kernels in
LibMatrixMult.javafor transposed multiplication cases involving dense-sparse and sparse-dense inputs:The new implementations avoid materializing transposed intermediates where possible and use format-aware execution paths to improve performance and reduce memory overhead.
Testing
New correctness and performance tests added to:
src/test/java/org/apache/sysds/test/component/matrixmult/MatrixMultTransposedTest.javasrc/test/java/org/apache/sysds/test/component/matrixmult/MatrixMultTransposedPerformanceTest.javaThese validate correctness and measure performance improvements for the newly implemented kernels.
Performance Evaluation
The following benchmarks evaluate the execution time of the optimized transposed kernels compared to the baseline
(explicit transposition followed by standard matrix multiplication).
1. Sparse-Dense Transposed Kernels (A is Sparse, B is Dense)
t(A) %*% Bt(A) %*% BA %*% t(B)A %*% t(B)t(A) %*% t(B)t(A) %*% t(B)t(A) %*% Bt(A) %*% BA %*% t(B)A %*% t(B)t(A) %*% t(B)t(A) %*% t(B)2. Dense-Sparse Transposed Kernels (A is Dense, B is Sparse)
t(A) %*% Bt(A) %*% BA %*% t(B)A %*% t(B)t(A) %*% t(B)t(A) %*% t(B)t(A) %*% Bt(A) %*% BA %*% t(B)A %*% t(B)t(A) %*% t(B)t(A) %*% t(B)