2024-04-10 09:20:25 -06:00
|
|
|
flash_att_v2_commit_cuda := 23e8fa5a263d1c7122bc46a86ef32030ee7130f9
|
2023-11-28 08:28:40 -07:00
|
|
|
flash_att_v2_commit_rocm := 8736558c287ff2ef28b24878e42828c595ac3e69
|
2023-07-18 08:21:18 -06:00
|
|
|
|
2023-11-27 06:08:12 -07:00
|
|
|
|
2023-11-28 08:28:40 -07:00
|
|
|
flash-attention-v2-cuda:
|
|
|
|
# Clone flash attention
|
|
|
|
pip install -U packaging ninja --no-cache-dir
|
|
|
|
git clone https://github.com/HazyResearch/flash-attention.git flash-attention-v2
|
|
|
|
|
|
|
|
build-flash-attention-v2-cuda: flash-attention-v2-cuda
|
|
|
|
cd flash-attention-v2 && git fetch && git checkout $(flash_att_v2_commit_cuda)
|
|
|
|
cd flash-attention-v2 && git submodule update --init --recursive
|
|
|
|
cd flash-attention-v2 && python setup.py build
|
|
|
|
|
|
|
|
install-flash-attention-v2-cuda: build-flash-attention-v2-cuda
|
|
|
|
cd flash-attention-v2 && git submodule update --init --recursive && python setup.py install
|
2023-11-27 06:08:12 -07:00
|
|
|
|
2023-11-28 08:28:40 -07:00
|
|
|
flash-attention-v2-rocm:
|
2023-11-27 06:08:12 -07:00
|
|
|
# Clone flash attention
|
|
|
|
pip install -U packaging ninja --no-cache-dir
|
2023-11-28 08:28:40 -07:00
|
|
|
git clone https://github.com/fxmarty/flash-attention-rocm flash-attention-v2
|
2023-07-18 08:21:18 -06:00
|
|
|
|
2023-11-28 08:28:40 -07:00
|
|
|
build-flash-attention-v2-rocm: flash-attention-v2-rocm
|
|
|
|
cd flash-attention-v2 && git fetch && git checkout $(flash_att_v2_commit_rocm)
|
2023-11-27 06:08:12 -07:00
|
|
|
cd flash-attention-v2 && git submodule update --init --recursive
|
2023-11-28 08:28:40 -07:00
|
|
|
cd flash-attention-v2 && PYTORCH_ROCM_ARCH=gfx90a python setup.py build
|
2023-07-18 08:21:18 -06:00
|
|
|
|
2023-11-28 08:28:40 -07:00
|
|
|
install-flash-attention-v2-rocm: build-flash-attention-v2-rocm
|
|
|
|
cd flash-attention-v2 && git submodule update --init --recursive && python setup.py install
|