Makefile-flash-att-v2 1003 Bytes
Newer Older
1
flash_att_v2_commit_cuda := v2.5.9.post1
fxmarty's avatar
fxmarty committed
2
flash_att_v2_commit_rocm := 2554f490101742ccdc56620a938f847f61754be6
3

4
5
6
build-flash-attention-v2-cuda:
	pip install -U packaging wheel
	pip install flash-attn==$(flash_att_v2_commit_cuda)
fxmarty's avatar
fxmarty committed
7

8
9
10
install-flash-attention-v2-cuda:
	pip install -U packaging wheel
	pip install flash-attn==$(flash_att_v2_commit_cuda)
11

12
13
14
15
16
17
18
build-flash-attention-v2-rocm:
	if [ ! -d 'flash-attention-v2' ]; then \
		pip install -U packaging ninja  --no-cache-dir && \
		git clone https://github.com/ROCm/flash-attention.git flash-attention-v2 && \
		cd flash-attention-v2 && git fetch && git checkout $(flash_att_v2_commit_rocm) && \
		git submodule update --init --recursive && GPU_ARCHS="gfx90a;gfx942" PYTORCH_ROCM_ARCH="gfx90a;gfx942" python setup.py build; \
	fi
19

20
install-flash-attention-v2-rocm: build-flash-attention-v2-rocm
21
22
23
24
	if [ ! -d 'flash-attention-v2' ]; then \
		cd flash-attention-v2 &&  \
		GPU_ARCHS="gfx90a;gfx942" PYTORCH_ROCM_ARCH="gfx90a;gfx942" python setup.py install; \
	fi