WebAssembly AI Runtime & Micrograd Sandbox
Execute genuine AI engineering algorithms entirely client-side inside the Pyodide WebAssembly runtime. Trace forward activations and backpropagate exact gradients across an interactive scalar autograd DAG, verify FlashAttention-3 online softmax stability under extreme logits ($\\pm 1000.0$) with online rescaling $\\alpha$, and translate PagedAttention logical-to-physical block table memory offsets with zero server overhead.
Browser WebAssembly AI Runtime & Micrograd Sandbox
Micrograd Scalar Autograd: Computational Graph & Backpropagation
o.data ≈ 0.70710678 (forward pass tanh neuron)
o.grad == 1.0 (seed gradient dz/do)
n.grad ≈ 0.5000 (dz/dn = 1 - tanh²(n))
b.grad ≈ 0.5000 (dz/db = dz/dn × 1)
x1.grad ≈ -1.5000 (dz/dx1 = w1 × dz/dn)
w1.grad ≈ 1.0000 (dz/dw1 = x1 × dz/dn)
x2.grad ≈ 0.5000 (dz/dx2 = w2 × dz/dn)
w2.grad ≈ 0.0000 (dz/dw2 = x2 × dz/dn)
Micrograd Topological Autograd
Construct artificial neuron $z = \\tanh(w_1 x_1 + w_2 x_2 + b)$. Notice how reverse topological traversal recursively triggers _backward(), propagating gradient dz/dw1 = 1.0 and dz/dx1 = -1.5 directly to input weights.
Extreme Logits Rescaling (±1000.0)
Standard softmax overflows at +709.7, producing Infinity or NaN. FlashAttention updates running maximum m_curr and applies rescaling factor alpha = exp(m_prev - m_curr) ≤ 1.0 to ensure zero precision loss.
PagedAttention Memory Translation
Eliminate memory fragmentation by mapping token indices to non-contiguous GPU physical blocks. Translate virtual offset t to block slot phys_block × B_s + (t mod B_s) and enforce runtime page fault handling upon out-of-bounds tokens.