A repo tour for contributors, learners, and anyone curious how a GPU BLAS
library is built. Each section mirrors a major folder or system in the
repository and explains the reasoning behind it — not just what the code
does, but why it is shaped the way it is.
What is BLAS?
BLAS (Basic Linear Algebra Subprograms) is a standard API for vector and
matrix operations — dot products, norms, scalar multiplies, matrix-vector
products. It is the computational backbone of numerical computing, machine
learning frameworks, and scientific software. The reference spec lives at
netlib.org/blas.
GPUs are well-suited for BLAS: operations like saxpy (y = αx + y) are
embarrassingly parallel — each element is independent — so thousands of GPU
threads can work simultaneously. NVIDIA's
cuBLAS is the canonical example;
this library applies the same idea to the browser via WebGPU.
What is WebGPU?
WebGPU is the modern browser GPU API, shipping in Chrome 113+ and Firefox
nightly. It lets JavaScript programs upload data to the GPU, run compute
programs on it, and read results back — without plugins or native code.
Note: WGSL does not support f64 natively, so this library currently
implements single-precision (f32) routines only.
What is a compute shader?
Each routine runs a compute shader written in WGSL (a GPU program that
runs thousands of instances in parallel, each processing one element). WebGPU
has vertex and fragment shaders for graphics too — compute shaders are
specifically for general computation. This library only uses compute shaders,
so we call them simply "shaders" throughout.
New to GPU programming?
Read these two chapters from the CUDA Programming Guide — the mental models
transfer directly to WebGPU; only the terminology changes. Then come back here.
Introduction —
why GPUs exist, GPU vs CPU design philosophy
A repo tour for contributors, learners, and anyone curious how a GPU BLAS library is built. Each section mirrors a major folder or system in the repository and explains the reasoning behind it — not just what the code does, but why it is shaped the way it is.
What is BLAS?
BLAS (Basic Linear Algebra Subprograms) is a standard API for vector and matrix operations — dot products, norms, scalar multiplies, matrix-vector products. It is the computational backbone of numerical computing, machine learning frameworks, and scientific software. The reference spec lives at netlib.org/blas.
GPUs are well-suited for BLAS: operations like saxpy (y = αx + y) are embarrassingly parallel — each element is independent — so thousands of GPU threads can work simultaneously. NVIDIA's cuBLAS is the canonical example; this library applies the same idea to the browser via WebGPU.
What is WebGPU?
WebGPU is the modern browser GPU API, shipping in Chrome 113+ and Firefox nightly. It lets JavaScript programs upload data to the GPU, run compute programs on it, and read results back — without plugins or native code.
What is a compute shader?
Each routine runs a compute shader written in WGSL (a GPU program that runs thousands of instances in parallel, each processing one element). WebGPU has vertex and fragment shaders for graphics too — compute shaders are specifically for general computation. This library only uses compute shaders, so we call them simply "shaders" throughout.
New to GPU programming?
Read these two chapters from the CUDA Programming Guide — the mental models transfer directly to WebGPU; only the terminology changes. Then come back here.
CUDA → WebGPU terminology
__global__function@computeshaderthreadIdx.xlocal_invocation_idblockIdx.xworkgroup_idblockDim.x@workgroup_size(N)var<workgroup>cudaMemcpyhost→devicedevice.queue.writeBuffercudaMemcpydevice→hostmapAsync+getMappedRangeWebGPU resources
Further reading