Dao-AILab/flash-attention ? reverse-engineered prompt

Reverse engineered prompt

I want a Python package for PyTorch that gives me really fast, memory efficient exact attention on GPU, basically a clean implementation of FlashAttention and FlashAttention 2 that I can install and use in training or inference. It should build on Linux, support newer NVIDIA cards with CUDA and also AMD ROCm, expose a simple importable attention function, and include a small example showing causal attention with q, k, v tensors. Please wire up the native kernels, setup and packaging, sensible tests, and a quick benchmark so I can verify speed and correctness against regular attention.

If possible, also keep the Hopper specific path available as a separate beta style install for H100 or H800 with the newer kernels mentioned in the docs. Make the install instructions practical, including notes about common build issues, compile time, memory limits during compilation, and how to run the tests. Look up current docs online if you need to.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab