/ concept-collection / matmul-bench
Sign in
concept-collection / matmul-bench
matmul-bench / README.md
2.1 KBPreviewCodeBlameHistoryRaw

matmul-bench#

Compares matrix-matrix multiply (GEMM) performance across implementations running in the browser, plus a native reference measured outside it.

Live: https://concept-collection.github.io/matmul-bench/

Methods:

Develop#

npm install
npm run dev            # local dev server (sends COOP/COEP for threaded methods)
wasm/build-wasm.sh      # rebuild wasm/dist/matmul.* + public/matmul/matmul_mt.*
                        #   (needs emsdk)
blis/build-blis-wasm.sh # rebuild public/matmul/matmul_blis_{st,mt}.* (needs emsdk
                        #   + the prebuilt .a files from a sibling libflame2wasm)
npm run build           # tsc -b && vite build

The libFLAME/BLIS WASM artifacts under public/matmul/ are committed (they link ~30 MB of prebuilt static libraries that live in a separate libflame2wasm checkout), so the GitHub Pages build doesn't rebuild them. The threaded custom module (public/matmul/matmul_mt.*) is built in CI from wasm/matmul.c.

Native reference#

native/build.sh
OPENBLAS_NUM_THREADS=1  native/bench_native 128 256 512 1024 2048
OPENBLAS_NUM_THREADS=12 native/bench_native 128 256 512 1024 2048

Hand-copy the results into src/data/nativeReference.ts.

moveopenescclose