Official code for Accelerating Attention with Basis Decomposition (https://arxiv.org/abs/2510.01718).
Ensure you have the necessary dependencies installed:
pip install -r requirements.txtDownload DeepSeek-V2-Lite model (https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite) .
Run BD Attention in deepseek
python bd_end_to_end_error_deepseek.py --model <path_to_model> --mode qkvo
Relative speedup for the
python bd_attention_linear_kernel.py
