2026 · APR · 18 → 20 · 3 DAYS · T4 → L4
T4 에서 230 GB/s. 그러나 진짜 병목은 커널이 아니라 PCIe 위의 복사였다.
D2H 가 12.7 배 느려지는 하나의 이유. 그리고 end-to-end 5.6배 차이.
shared memory, warp shuffle, 그리고 __syncthreads 하나가 만든 29%.
0.4 → 7.9 TFLOPS. 20배의 로프라인 여정을 네 층으로.
커널을 3개에서 1개로 합치면 정확히 2배 빨라진다. online softmax 의 탄생.
N=4096 에서 4.79× 빠르고 65× 적은 HBM 트래픽. 그리고 그 경계선.
torch.ops.mylib.flash_attention. 이 순간부터 vLLM 코드가 읽힌다.
L4 로 점프. 4개 커널을 Triton 으로. cuBLAS 를 근소하게 이긴 구간 발견.
4-D shape + causal + torch.compile(fullgraph=True). cuDNN FA-2 의 80-90%.
50줄이 5000줄을 대체할 수 있는가. 네 개 커널의 답.
IS_CAUSAL: tl.constexpr, loop-skip, custom_op. 세 가지 트릭의 합.
샘 × 젠슨 (가상). 7주의 경로를 역순으로 재생하면 Flash Attention 이 필연이었다는 게 보인다.
파일 일곱 개를 펼쳐놓고 한 줄씩. CUDA 가 Triton 으로 접힐 때 무엇이 사라지고 무엇이 남나.
2026 · APR · 18 → 20 · 3 DAYS · T4 → L4
230 GB/s on T4. But the real bottleneck wasn't the kernel — it was the copy across PCIe.
One reason D2H is 12.7× slower. And the 5.6× end-to-end gap.
Shared memory, warp shuffle, and the 29% a single __syncthreads bought.
0.4 → 7.9 TFLOPS. A 20× roofline journey, in four layers.
Fuse three kernels into one and get exactly 2× speedup. The birth of online softmax.
4.79× faster at N=4096, 65× less HBM traffic. And the line we hit.
torch.ops.mylib.flash_attention. From this moment on, vLLM source becomes readable.
Jump to L4. Four kernels into Triton. Found a zone where we narrowly beat cuBLAS.
4-D shape + causal + torch.compile(fullgraph=True). 80–90% of cuDNN FA-2.
Can 50 lines replace 5000? The answer from four kernels.
IS_CAUSAL: tl.constexpr, loop-skip, custom_op. Three tricks combined.
Sam × Jensen (fictional). Replay the 7-week path in reverse and Flash Attention looks inevitable.
Seven files side by side, line by line. When CUDA folds into Triton, what vanishes and what remains.