Add a 4x4 WASM SIMD128 GEMM microkernel - #5983
Open
jjerphan wants to merge 2 commits into
Open
Conversation
Keep production STRSM/DTRSM free of always-on increments; enable the counters only when counting invocations. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Switch WASM128_GENERIC to unroll 4 with matching ncopy/tcopy and TRMM 4x4 so packing width stays consistent. Use relaxed SIMD madd in the inner loop when compiled with -mrelaxed-simd. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
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 #5680 / #4023: replace the 2x2 shuffle GEMM for
WASM128_GENERICwith a 4x4 outer-product kernel sof32x4/f64x2loads match packing width.gemmkernel_4x4_wasm128.cwith matchinggemm_{n,t}copy_4and generic TRMM 4x4.KERNELTRMM defaults are wrapped inifndefsoKERNEL.WASM128_GENERICpacking width is not overwritten.-mrelaxed-simdplusrelaxed_maddin the GEMM inner loop only; DOT/AXPY stay IEEE mul+add inintrin_wasm.h.OPENBLAS_WASM_TRSM_PROFILE.Benchmarks
Node / Emscripten,
TARGET=WASM128_GENERIC,USE_THREAD=0,COMMON_OPT=-O2. Same machine, 5 warmup + 10 timed samples (median). Speedup > 1 means this branch is faster thandevelop.Geomean vs
develop: SGEMM 1.44x, DGEMM 1.82x, SSYRK 1.46x, DSYRK 1.73x, STRSM 1.33x, DTRSM 1.39x. Level-1/2 kernels are unchanged within noise.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