Makefile-flash-att-v2 1.3 KB
Newer Older
1
flash_att_v2_commit_cuda := v2.5.8
fxmarty's avatar
fxmarty committed
2
flash_att_v2_commit_rocm := 2554f490101742ccdc56620a938f847f61754be6
3

fxmarty's avatar
fxmarty committed
4

5
6
7
flash-attention-v2-cuda:
  # Clone flash attention
	pip install -U packaging ninja  --no-cache-dir
8
	git clone https://github.com/Dao-AILab/flash-attention.git flash-attention-v2
9
10
11
12
13
14
15
16

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
fxmarty's avatar
fxmarty committed
17

18
flash-attention-v2-rocm:
fxmarty's avatar
fxmarty committed
19
20
  # Clone flash attention
	pip install -U packaging ninja  --no-cache-dir
fxmarty's avatar
fxmarty committed
21
	git clone https://github.com/ROCm/flash-attention.git flash-attention-v2
22

23
24
build-flash-attention-v2-rocm: flash-attention-v2-rocm
	cd flash-attention-v2 && git fetch && git checkout $(flash_att_v2_commit_rocm)
fxmarty's avatar
fxmarty committed
25
	cd flash-attention-v2 && git submodule update --init --recursive
fxmarty's avatar
fxmarty committed
26
	cd flash-attention-v2 && GPU_ARCHS="gfx90a;gfx942" PYTORCH_ROCM_ARCH="gfx90a;gfx942" python setup.py build
27

28
29
install-flash-attention-v2-rocm: build-flash-attention-v2-rocm
	cd flash-attention-v2 && git submodule update --init --recursive && python setup.py install