Faster NumPy in the Browser
3 days ago
- NumPy in the browser now links OpenBLAS in WebAssembly, achieving up to 30.92x speedup for float32 matrix multiplication at n=1024.
- Emscripten-forge is a language-agnostic WebAssembly distribution that rebuilds the conda ecosystem, enabling shared libraries like OpenBLAS.
- A Fortran compiler (Flang) was essential for OpenBLAS and LAPACK on WebAssembly, requiring multi-person patches and integration.
- OpenBLAS 0.3.35 (SIMD128) adds further improvements (1.79x on float32 matmul vs 0.3.34), with an optional Relaxed SIMD build for additional gains on supported engines.
- The packaging model allows upgrading OpenBLAS without rebuilding NumPy, benefiting the entire scientific Python ecosystem.
- Benchmarks show significant speedups across np.matmul, np.linalg.*, and matrix-vector operations compared to the previous no-BLAS baseline.