forked from InternLM/lmdeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_dev
More file actions
41 lines (34 loc) · 1.66 KB
/
Dockerfile_dev
File metadata and controls
41 lines (34 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 AS cu12.8
# environment variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Etc/UTC \
PATH=/opt/py3/bin:/root/.local/bin:${PATH} \
TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas
# Install dependencies and create python virtual environment
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/root/.cache \
sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list && \
apt-get update -y && \
apt-get install -y --no-install-recommends \
tzdata wget curl openssh-server ssh sudo git-core \
libibverbs1 ibverbs-providers ibverbs-utils librdmacm1 \
libibverbs-dev rdma-core libmlx5-1 libssl-dev pkg-config \
vim rapidjson-dev libgoogle-glog-dev gdb cmake build-essential \
python3-dev ninja-build htop tree jq unzip && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
# install UV
wget -qO- https://astral.sh/uv/install.sh | sh && \
# create Python virtual environment
uv venv -p python3.12 --seed /opt/py3
# Should be in the lmdeploy root directory when building docker image
COPY . /opt/lmdeploy
WORKDIR /opt/lmdeploy
# install lmdeploy and its dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install -r requirements_cuda.txt --extra-index-url https://download.pytorch.org/whl/cu128 && \
uv pip install -e .
# install flash_attn
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.8cxx11abiTRUE-cp312-cp312-linux_x86_64.whl
RUN uv cache clean