Skip to content

Add wasm32 SIMD128 kernel for sgemm#99

Merged
bluss merged 2 commits into
bluss:masterfrom
byeongjee:wasm-simd
Jun 26, 2026
Merged

Add wasm32 SIMD128 kernel for sgemm#99
bluss merged 2 commits into
bluss:masterfrom
byeongjee:wasm-simd

Conversation

@byeongjee

Copy link
Copy Markdown
Contributor

8×8 microkernel (ported from the AArch64 NEON path).

Gated on cfg(all(target_arch="wasm32", target_feature="simd128")).
Since wasm has no standardized runtime feature detection for SIMD,
dispatch is compile-time only and the scalar fallback stays in place
otherwise.

In wasmtime 36 on Apple M2 Pro, sgemm runs 3.86×–4.11× faster than the scalar fallback across 64x64x64–512x512x512.

@byeongjee

byeongjee commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@bluss Could you take a look? This helps my personal wasm use case.

@bluss

bluss commented May 8, 2026

Copy link
Copy Markdown
Owner

The PR i missing tests, nothing in CI is running tests (from tests/) directory for your new code.

byeongjee added 2 commits May 8, 2026 14:36
8x8 microkernel ported from the AArch64 NEON path. Gated on
target_arch="wasm32" + target_feature="simd128"; falls through to the
scalar kernel otherwise.
Run tests/ and lib unit tests on wasm32-wasip1 via wasmtime, with
matrix entries for both the new simd128 kernel and the scalar
fallback path.
@byeongjee

Copy link
Copy Markdown
Contributor Author

@bluss Thanks for the comment. I added CI for wasm using wasmtime

@bluss bluss changed the title Add wasm32 SIMD128 kernel Add wasm32 SIMD128 kernel for sgemm Jun 25, 2026
@bluss

bluss commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Thanks, that's accepted. wasm simd support for sgemm (f32) only in this case, which is I assume the most used kernel.

@bluss bluss merged commit c8e8192 into bluss:master Jun 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants