This document summarizes the FFPA-Attn benchmark results which can be viewed in ffpa-attn/tests/tmp/.
- Speedup increases as D drops from 1024 → 576, peaking around ≈2.2×.
- FFPA’s L1 design benefits most when:
- Tensor Core tile alignment is optimal
- Shared memory footprint fits SM capacity
- Warp scheduling reaches high occupancy
- For very small D (e.g., 320) arithmetic intensity drops and SDPA becomes more competitive.
- FP32 accumulation reduces peak throughput (vs F16), but still delivers ≈1.6–2.2× speedups.
- Best region: D ≈ 448–576 where tiling and register usage are well balanced.
- Slow-downs at the extremes:
- Very large D → register pressure, lower occupancy
- Very small D → low compute/bandwidth ratio
- SDPA EA baseline sits around 90–110 TFLOPS.
- FFPA+ACC+F16 reaches ≈180–215 TFLOPS — the overall highest throughput.
- FFPA+ACC+F32 reaches ≈150–205 TFLOPS — slightly lower due to FP32 accumulator overhead.
- A clear jump at D ≈ 576:
- Tensor Core tiles align nicely with head dimension
- SMEM layout matches GH200 banking patterns
- Warp occupancy reaches close to the practical maximum
-
Tensor Core MMA Shape Alignment
Performance peaks whenDaligns with natural tile sizes (multiples of 64, 128, 256). MisalignedDoften wastes compute or increases padding. -
Shared Memory Bank Swizzling
FFPA uses SMEM heavily. Good swizzling/padding minimizes bank conflicts, but someDvalues still induce mild conflicts and small dips. -
Register Pressure & Warp Occupancy
LargerDincreases per-thread register usage, which reduces the number of resident warps per SM → lower effective TFLOPS. -
Arithmetic Intensity
WhenDis small, each byte of data participates in fewer FLOPs, so attention becomes more memory-bound and SDPA closes the gap. -
F16 vs F32 Accumulation
F32 accumulation improves numerical robustness but uses more registers and bandwidth → FFPA+ACC+F32 is slightly slower than FFPA+ACC+F16.
ssh ubuntu@<INSTANCE_IP>Check GPU:
nvidia-smiFrom Mac → Cloud:
rsync -avz --progress <PATH OF FILE> ubuntu@<INSTANCE_IP>:~/ffpa-attn/From Cloud → Mac (to bring results back):
rsync -avz --progress ubuntu@<INSTANCE_IP>:~/ffpa-attn/ <PATH OF FILE>cd ~/ffpa-attn
python3 -m venv .venv
source .venv/bin/activateVerify you are inside the venv:
which python
which pipExpected:
/home/ubuntu/ffpa-attn/.venv/bin/python
/home/ubuntu/ffpa-attn/.venv/bin/pip
pip install --upgrade pip
pip install pybind11 packaging ninja numpypip install torch --index-url https://download.pytorch.org/whl/cu124Validate:
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"You should see something like:
2.5.1 True
export CUDA_HOME=/usr/local/cuda
export PATH="$CUDA_HOME/bin:$PATH"
which nvcc
nvcc --versionExpected output mentions CUDA 12.8.
From the project root:
cd ~/ffpa-attn
python setup.py bdist_wheelA wheel should be generated under:
dist/ffpa_attn-0.0.2.1-cp310-cp310-linux_aarch64.whl
pip install dist/ffpa_attn-*.whlVerify:
pip show ffpa-attnYou should see something like:
Name: ffpa-attn
Version: 0.0.2.1
Location: /home/ubuntu/ffpa-attn/.venv/lib/python3.10/site-packages
From the ffpa-attn directory:
cd tests && pip install matplotlib && python3 test_ffpa_attn.py --gen-bench --show-all --plotThis will:
- Run SDPA EA baseline
- Run FFPA L1 variants (F16/F32 accum)
- Print TFLOPS, timings, and speedups
- Optionally save plots under
tests/tmpif--plotand--gen-benchare used.
pip install pybind11Rebuild:
python setup.py bdist_wheel
pip install dist/ffpa_attn-*.whl- Usually means the kernel was compiled for the wrong SM version.
- GH200/H100 is sm_90 — ensure
setup.py/ NVCC flags include:
-gencode arch=compute_90,code=sm_90
Then clean and rebuild:
rm -rf build dist *.egg-info
python setup.py bdist_wheel
pip install dist/ffpa_attn-*.whlFrom your Mac:
rsync -avz --progress ubuntu@<INSTANCE_IP>:~/ffpa-attn/tests/tmp/ <PATH OF FILE>This pulls the generated plots and benchmark tables back locally.
- FFPA L1 significantly outperforms SDPA EA on GH200, with ≈2× speedups in the best regions of
D. - FFPA+ACC+F16 is the fastest path; FFPA+ACC+F32 offers a good trade-off between numerical stability and throughput.
- The installation and benchmarking flow on Lambda.ai is now fully scripted and reproducible via this README.
[1] FFPA-Attn Repository
https://github.com/wkun-upenn/ffpa-attn
[2] FFPA Technical Article (Zhihu)
https://zhuanlan.zhihu.com/p/13975660308
[3] NVIDIA CUTLASS (GitHub Source, pinned revision)
https://github.com/NVIDIA/cutlass/tree/b78588d1630aa6643bf021613717bafb705df4ef
[4] NVIDIA CUTLASS Official Documentation
https://docs.nvidia.com/cutlass/latest/


