Skip to content

Instantly share code, notes, and snippets.

View Peterande's full-sized avatar
🤒
Out sick

Yansong Peng Peterande

🤒
Out sick
View GitHub Profile
@Birch-san
Birch-san / _06_fused_attention_blockptr_jvp.py
Last active August 11, 2025 08:35
Triton fused attention tutorial, updated with JVP support. Albeit with atol=1e-3 accuracy on JVP.
from __future__ import annotations
"""
Fused Attention
===============
This is a Triton implementation of the Flash Attention v2 algorithm from Tri Dao (https://tridao.me/publications/flash2/flash2.pdf)
Credits: OpenAI kernel team
Extra Credits: