Skip to content

Commit bb33fda

Browse files
authored
install flash attention in 2.9.0 base images (#3224)
1 parent 4dc0189 commit bb33fda

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docker/Dockerfile-base

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ RUN git lfs install --skip-repo && \
4747
pip3 install -U --no-cache-dir pydantic==1.10.10 && \
4848
pip3 cache purge
4949

50-
RUN if [ "$PYTORCH_VERSION" = "2.6.0" ] && [ "$CUDA" = "124" ] ; then \
51-
FLASH_ATTENTION_FORCE_BUILD="TRUE" pip3 install --no-build-isolation flash-attn==2.8.0.post2; \
50+
RUN if [ "$PYTORCH_VERSION" = "2.9.0" ] && [ "$CUDA" = "128" ] ; then \
51+
wget https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.4.17/flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
52+
pip3 install --no-cache-dir flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
53+
rm flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
5254
fi

docker/Dockerfile-uv-base

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ RUN uv pip install packaging setuptools wheel psutil \
3434
&& uv pip install --no-build-isolation "causal_conv1d @ git+https://github.com/Dao-AILab/causal-conv1d.git@main" \
3535
&& uv pip install "mamba_ssm @ git+https://github.com/state-spaces/mamba.git@main" \
3636
&& uv pip install awscli pydantic
37+
38+
RUN if [ "$PYTORCH_VERSION" = "2.9.0" ] && [ "$CUDA" = "128" ] ; then \
39+
wget https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.4.17/flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
40+
uv pip install --no-cache-dir flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
41+
rm flash_attn-2.8.3+cu128torch2.9-cp311-cp311-linux_x86_64.whl; \
42+
fi

0 commit comments

Comments
 (0)