core practice · coding problem

WebGPU buffer upload size

Tensor 1024×1024 float32. Byte size? If maxStorageBufferBindingSize is 128MB, does one buffer hold the tensor?

The mechanism

WebGPU lets JavaScript run compute shaders on the GPU, which can speed up matrix math 10-100x in the browser. The real bottlenecks are moving data to and from the GPU and compiling the shaders — not the math itself. Scope: this card owns one backend — compute shaders, WGSL, and the transfer and compilation costs that dominate matmul in practice. The surrounding browser runtime is `ml-browser-runtime`; running outside the browser is `local-on-device-inference`.

Study WebGPU Compute

Expected evidence

4MB — fits easily; watch alignment and copy queue staging.

Try this drill in the practice workspace →

Hints when you need them
  • 4 bytes per f32.
  • Check device limits for large models.

Check the sources

Browse all practice briefs