Add a WASM SIMD128 8x4 SGEMM microkernel - #6023
Draft
jjerphan wants to merge 1 commit into
Draft
Conversation
Wire single-precision 8x4 tile and packers; leave double on the existing 4x4 path.
Contributor
Author
|
Local Node / Emscripten correctness gate on this branch (
|
jjerphan
commented
Sep 9, 2026
| ZGEMVTKERNEL = ../riscv64/zgemv_t.c | ||
|
|
||
| STRMMKERNEL = ../generic/trmmkernel_4x4.c | ||
| STRMMKERNEL = ../generic/trmmkernel_8x4.c |
Contributor
Author
There was a problem hiding this comment.
I wonder whether this rather be changed in another PR.
Collaborator
There was a problem hiding this comment.
GEMM is usually linked to TRMM (and SYMM) in OpenBLAS, so I'm fine with having it here
jjerphan
marked this pull request as draft
September 9, 2026 13:00
Contributor
Author
|
I have opened #6024 which should be valuable for properly testing all those new kernels for WASM. |
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.
Summary
Follow-up to #5983 / #5986 / #5680 / #4023: replace the 4×4 SGEMM microkernel for
WASM128_GENERICwith an 8×4 tile so adjacentf32x4A loads match the V8WasmRevecReducershape. Double stays on the existing 4×4 path.SGEMM_DEFAULT_UNROLL_M/Nbecome 8/4.SGEMMKERNELuseskernel/wasm/gemmkernel_8x4_wasm128.cwithgemm_{n,t}copy_8for A andgemm_{n,t}copy_4for B.STRMMKERNELswitches to generictrmmkernel_8x4.cso TRMM unroll matches SGEMM.DTRMMKERNELstaystrmmkernel_4x4_wasm128.c; DGEMM packing and unroll stay 4×4.-mrelaxed-simd/WASM_RELAXED_SIMD=1(same as GEMM in Add a 4x4 WASM SIMD128 GEMM microkernel #5983). Remainders keep 4/2/1 scalar (and a 4-wide SIMD panel forbm & 4).Benchmarks
Node / Emscripten,
TARGET=WASM128_GENERIC,USE_THREAD=0,COMMON_OPT=-O2,WASM_RELAXED_SIMD=1. Same machine, pinned to one P-core (taskset -c 0), median of timed samples. Speedup > 1 means this branch is faster thandevelop.Geomean vs
develop(n = 64…4096): SGEMM 1.52x, SSYRK 1.47x, STRMM 1.30x, STRSM 1.22x. DGEMM/DSYRK/DTRMM/DTRSM unchanged within noise (~1.00x).Test plan
utestunder node (106/106)ctestL1/L2/L3 (x{s,d,c,z}cblat{1,2,3}) under node, including SGEMM/DGEMM, STRMM/DTRMM, STRSM/DTRSM, SSYRK/DSYRK