Skip to content

Instantly share code, notes, and snippets.

View xu-song's full-sized avatar
🎯
Focusing

Xu Song xu-song

🎯
Focusing
View GitHub Profile
@xiabingquan
xiabingquan / flash_attention_in_numpy.py
Last active July 20, 2024 07:54
An toy example of flash attention implemented in Numpy.
# A minimal exmaple of flash attention implemented in Numpy
# Contact: bingquanxia AT qq.com
import unittest
from typing import List
import numpy as np
import torch