← vincentzed.com

Mixture-of-Experts forward pass

num_tokens (T) = tokens entering the MoE module this forward pass — the M dimension of every GEMM below (tech_blog/blog24). Each token fans out to top-k routed experts, then results are alpha-weighted and scattered back. Drag to orbit · scroll to zoom.
expert idle (me = 0 tokens)
me load: memory-bound → compute-bound
shared expert (dense, all T tokens)
weight plates (W1 gate|up, W2) — static params
hidden activations (appear at FC1, merge at SwiGLU)
slab depth ∝ me · each expert = its own MLP stack