Exact GPU Decode Kernels
Three fused Triton/CUDA and Apple Metal 3.1 kernels for memory-bandwidth-bound LLM decoding: RMSNorm + NeoX RoPE + INT8 KV scatter, Split-KV INT8 GQA decode attention, and W4A16 groupwise INT4 SwiGLU GEMV.
- NVIDIA Tesla T4 (SM75, Triton 3.8): 242.8 GB/s achieved on Llama3-8B W4A16 MLP B=1 (100.3% of 242.1 GB/s empirical STREAM copy; 75.9% of 320.0 GB/s peak; 92.72x vs PyTorch eager).
- Apple M4 Max (40-core GPU, Metal 3.1): 394.8 GB/s achieved on Llama3-70B W4A16 MLP B=1 (102.4% of 385.5 GB/s empirical STREAM copy; 72.3% of 546.0 GB/s peak; 260.63x wall vs PyTorch MPS eager).
- Numerical parity: 24/24 edge-case tensor shapes verified against exact FP64 references on both Metal and Triton with 0 NaN/Inf.
- Cold-cache methodology: 128 MiB L2 (CUDA) and 128 MiB SLC (Metal) cache flush before every timed iteration.