Hand-written PTX flash attention kernel reaching 218 TFLOPS FP16 on an RTX 5080: faster than vLLM 0.34's FlashAttention-2 on all 34 benchmarked shapes, without WGMMA, TMA, or datacenter hardware.
// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
// how to help
// readme
faster than vLLM 0.34โs FlashAttention-2 on all 34 benchmarked shapes ยท runs a real LLM end-to-end ahead of vLLM ยท no WGMMA, no TMA, no shortcuts
What is this?
A from-scratch flash attention implementation in raw CUDA/PTX targeting consumer NVIDIA GPUs like RTX 5080 or 5090. No libraries, no CUTLASS attention wrappers, no cuDNN โ just hand-written kernels optimized step by step from 2.7 TFLOPS to 218 TFLOPS, to the point of beating vLLMโs FlashAttention-2 on every measured shape.
The kernel uses PTX inline assembly for mma.sync.aligned.m16n8k16 tensor core operations with ldmatrix for optimal shared memory โ register transfers, and performs the full softmax in registers using warp shuffle intrinsics, eliminating the largest shared memory bottleneck in standard flash attention implementations.
Consumer Blackwell (sm_120) lacks the datacenter features that make H100/B200 attention kernels fast: no WGMMA (warp group MMA), no TMA (tensor memory accelerator), no warp specialization barriers. This kernel achieves competitive utilization using only the tools available on consumer silicon.