Elmanjhg opened a new pull request, #2553: URL: https://github.com/apache/systemds/pull/2553
This PR completes the missing Vector API (SIMD) implementations for sparse matrix combinations, extending the work done in previous dense/sparse vectorization PR https://github.com/apache/systemds/pull/2423. ## Modifications Replaced the scalar inner loops with the vectorized "vectMultiplyAddScatter" using the JDK 17 Vector API in the following three Sparse-Sparse matrix multiplication kernels within "LibMatrixMult.java": 1. matrixMultSparseSparseMM 2. matrixMultSparseSparseMMSmallRHS 3. matrixMultSparseSparseSparseMM ## Testing & Validation * Component tests (MatrixMultiplyTest) executed successfully (5000 tests passed, 0 failures). # BENCHMARK ### Hardware Environment (Linux) * **OS:** Ubuntu Linux * **CPU Model:** AMD Ryzen 5 PRO 7530U (x86_64) * **Cores/Threads:** 6 Cores / 12 Threads (Turbo: 4.54 GHz) * **Vector Capability:** 256-bit (AVX2) * **Cache:** L1: 384 KiB / L2: 3 MiB / L3: 16 MiB * **Memory:** 16 GB The benchmark uses like the PR Request before the Java Microbenchmark Harness (JMH) framework to measure the performance of the rewritten kernels. The result is the average execution time in microseconds. Each benchmark run consists of 5 warmup iterations followed by 10 measurement iterations (1 second each), executed in a single forked JVM. ### Sparse-Sparse Benchmark Result Summary * The vectorized implementations yield solid performance gains (up to **1.35x**) on larger matrices (e.g., 8192x8192). * Minor performance regressions (dropping to **~0.87x**) occur when the right hand sparsity is precisely around `0.01`, likely where the overhead of vector preparation and scatter operations slightly outweighs the raw SIMD throughput. ### Benchmark Parameters * **m:** 1024, 2048, 4096, 8192 * **cd:** 1 * **n:** 1024, 2048, 4096, 8192 * **Sparsity Left:** 0.5, 0.75, 1.0 * **Sparsity Right:** 0.001, 0.01, 0.1, 0.2 * **Total Configs:** 192 ### Top Performance Gains (Speedup > 1.0) | m | n | sparsityLeft | sparsityRight | Speedup | |---|---|--------------|---------------|---------| | 8192 | 4096 | 1.0 | 0.001 | **1.35x** | | 8192 | 8192 | 0.5 | 0.001 | **1.35x** | | 8192 | 8192 | 0.75 | 0.001 | **1.33x** | | 8192 | 8192 | 1.0 | 0.001 | **1.32x** | | 8192 | 4096 | 1.0 | 0.010 | **1.22x** | ### Top Performance Losses (Speedup < 1.0) | m | n | sparsityLeft | sparsityRight | Speedup | |---|---|--------------|---------------|---------| | 8192 | 2048 | 1.0 | 0.010 | **0.87x** | | 1024 | 2048 | 0.75 | 0.010 | **0.88x** | | 4096 | 8192 | 0.75 | 0.010 | **0.90x** | | 8192 | 2048 | 0.5 | 0.010 | **0.91x** | | 2048 | 4096 | 1.0 | 0.010 | **0.92x** | ### Baseline vs Vectorized Performance plots <img width="1600" height="1200" alt="performanceComparisonsSYSTEMDS" src="https://github.com/user-attachments/assets/239f5fe1-4d64-41d4-8c7f-ae6337727b4c" /> ### Raw Data [runtimeComparisonSYSTEMDSProject.csv](https://github.com/user-attachments/files/30123047/runtimeComparisonSYSTEMDSProject.csv) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
