WebGPU-BLAS Example

This example computes matrix-matrix multiplication (sgemm) using WebGPU, future web standard.

Supported browsers (as of January 2024): Chrome (Windows, MacOS)

WebGPU of this browser:

Created by @milhidaka Github

weblas benchmark

Small example

Computes

[1,2
 3,4]
×
[5,6
 7,8]

  

Test

Compares computation result of WebGPU and pure JavaScript implementation.


  

Benchmark

Note: when m % 32 === 0 && n % 64 === 0 && k % 4 === 0, efficient kernel is used.

M,N,K tuples: