Custom GPU kernels for the slow parts of LLM decoding
Fused RMSNorm, fused SwiGLU, and a 4-bit weight matmul in Triton, plus a CUDA C++ version of the decode matmul. Each one is tested against PyTorch, measured against the GPU's limits, and swapped into Qwen2.5-1.5B.
82%
of L4 peak bandwidth
W4A16 Triton, batch 1, Qwen gate_up 17920x1536
1.99x
decode tokens/s vs fp16
Qwen2.5-1.5B, L4, 118 vs 60 tok/s
3.8x
smaller linear-layer weights
2.62 GB fp16 -> 0.70 GB 4-bit
+1.25
WikiText-2 perplexity
10.65 fp16 -> 11.90 RTN 4-bit
$5.90
total GPU spend (est.)
3.12 GPU-hours on Modal