Sofia Casadei commited on
Commit
abd4f63
·
1 Parent(s): 61d7ab7

install flash attention

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -3
Dockerfile CHANGED
@@ -4,12 +4,16 @@ FROM ghcr.io/astral-sh/uv:0.2.12 as uv
4
  # Stage 2: Main application image
5
  FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
6
 
 
 
7
  # Copy uv from first stage
8
  COPY --from=uv /uv /uv
9
 
10
  # Install Python, pip, venv, and system dependencies
11
  RUN apt-get update && \
12
- apt-get install -y python3.11 python3.11-venv python3-pip ffmpeg && \
 
 
13
  apt-get clean && \
14
  rm -rf /var/lib/apt/lists/*
15
 
@@ -45,9 +49,10 @@ COPY --chown=user requirements.txt .
45
  RUN --mount=type=cache,target=$UV_CACHE_DIR,uid=1000,gid=1000 \
46
  /uv pip install -r requirements.txt
47
 
48
- # Install flash-attn from pre-built wheel
49
  RUN --mount=type=cache,target=$UV_CACHE_DIR,uid=1000,gid=1000 \
50
- /uv pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp311-cp311-linux_x86_64.whl
 
51
 
52
  # Copy application code
53
  COPY --chown=user . .
 
4
  # Stage 2: Main application image
5
  FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
6
 
7
+ ENV DEBIAN_FRONTEND=noninteractive
8
+
9
  # Copy uv from first stage
10
  COPY --from=uv /uv /uv
11
 
12
  # Install Python, pip, venv, and system dependencies
13
  RUN apt-get update && \
14
+ apt-get upgrade -y && \
15
+ apt-get install -y --no-install-recommends \
16
+ python3.11 python3.11-venv python3-pip ffmpeg && \
17
  apt-get clean && \
18
  rm -rf /var/lib/apt/lists/*
19
 
 
49
  RUN --mount=type=cache,target=$UV_CACHE_DIR,uid=1000,gid=1000 \
50
  /uv pip install -r requirements.txt
51
 
52
+ # Install flash-attn
53
  RUN --mount=type=cache,target=$UV_CACHE_DIR,uid=1000,gid=1000 \
54
+ /uv pip install flash-attn --no-build-isolation
55
+ #/uv pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp311-cp311-linux_x86_64.whl
56
 
57
  # Copy application code
58
  COPY --chown=user . .