Skip to content

Commit 68661b2

Browse files
authored
feat: add dockerfiles for multi level cache (#1139)
1 parent 54e2315 commit 68661b2

File tree

5 files changed

+138
-13
lines changed

5 files changed

+138
-13
lines changed

docker/cuda_version_12.8.0/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ RUN case ${TARGETPLATFORM} in \
3333

3434
WORKDIR /root
3535

36+
RUN pip install --no-cache-dir vllm==0.11.0 --pre --extra-index-url https://wheels.vllm.ai/nightly
37+
3638
COPY ./requirements.txt /lightllm/requirements.txt
3739
RUN pip install -U pip
38-
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --ignore-installed --extra-index-url https://download.pytorch.org/whl/cu128
39-
40-
RUN pip install --no-cache-dir vllm --pre --extra-index-url https://wheels.vllm.ai/nightly
40+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
4141

4242
# TODO: offline compile
4343
# RUN git clone https://github.com/ModelTC/LightKernel.git && cd LightKernel && pip install --no-deps -v .

docker/cuda_version_12.8.0/Dockerfile.deepep

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ RUN case ${TARGETPLATFORM} in \
3333

3434
WORKDIR /root
3535

36+
RUN pip install --no-cache-dir vllm==0.11.0 --pre --extra-index-url https://wheels.vllm.ai/nightly
37+
3638
COPY ./requirements.txt /lightllm/requirements.txt
3739
RUN pip install -U pip
38-
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --ignore-installed --extra-index-url https://download.pytorch.org/whl/cu128
39-
40-
RUN pip install --no-cache-dir vllm --pre --extra-index-url https://wheels.vllm.ai/nightly
41-
40+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
4241
# TODO: offline compile
4342
# RUN git clone https://github.com/ModelTC/LightKernel.git && cd LightKernel && pip install --no-deps -v .
4443

docker/cuda_version_12.8.0/Dockerfile.nixl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ RUN case ${TARGETPLATFORM} in \
3333

3434
WORKDIR /root
3535

36+
RUN --mount=type=cache,target=/root/.cache/pip pip install vllm==0.11.0 --pre --extra-index-url https://wheels.vllm.ai/nightly
37+
3638
COPY ./requirements.txt /lightllm/requirements.txt
37-
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --ignore-installed --extra-index-url https://download.pytorch.org/whl/cu128
39+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
3840

39-
RUN --mount=type=cache,target=/root/.cache/pip pip install vllm --pre --extra-index-url https://wheels.vllm.ai/nightly
40-
RUN --mount=type=cache,target=/root/.cache/pip git clone https://github.com/ModelTC/LightKernel.git && cd LightKernel && pip install --no-deps -v .
41+
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-deps -v 'git+https://github.com/ModelTC/LightKernel.git@07f2f62af5deb41f10a22660f9f42dba9273361e#egg=lightllm_kernel'
4142

4243
RUN apt-get update && apt-get install -y libnuma-dev wget devscripts debhelper dh-make build-essential dkms
4344
RUN apt-get install -y ibverbs-providers infiniband-diags perftest rdma-core libibverbs-dev librdmacm-dev

docker/cuda_version_12.8.0/Dockerfile.nixl.deepep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ RUN case ${TARGETPLATFORM} in \
3535

3636
WORKDIR /root
3737

38+
RUN --mount=type=cache,target=/root/.cache/pip pip install vllm==0.11.0 --pre --extra-index-url https://wheels.vllm.ai/nightly
39+
3840
COPY ./requirements.txt /lightllm/requirements.txt
39-
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --ignore-installed --extra-index-url https://download.pytorch.org/whl/cu128
41+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
4042

41-
RUN --mount=type=cache,target=/root/.cache/pip pip install vllm --pre --extra-index-url https://wheels.vllm.ai/nightly
42-
RUN --mount=type=cache,target=/root/.cache/pip git clone https://github.com/ModelTC/LightKernel.git && cd LightKernel && pip install --no-deps -v .
43+
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-deps -v 'git+https://github.com/ModelTC/LightKernel.git@07f2f62af5deb41f10a22660f9f42dba9273361e#egg=lightllm_kernel'
4344

4445
RUN apt-get update && apt-get install -y libnuma-dev wget devscripts debhelper dh-make build-essential dkms
4546
RUN apt-get install -y ibverbs-providers infiniband-diags perftest rdma-core libibverbs-dev librdmacm-dev
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
ARG CUDA_VERSION=12.8.0
2+
FROM nvidia/cuda:${CUDA_VERSION}-cudnn-devel-ubuntu22.04
3+
4+
ARG PYTHON_VERSION=3.10
5+
ARG MAMBA_VERSION=24.7.1-0
6+
ARG TARGETPLATFORM
7+
8+
ENV PATH=/opt/conda/bin:$PATH \
9+
CONDA_PREFIX=/opt/conda
10+
11+
RUN chmod 777 -R /tmp && apt-get update --allow-insecure-repositories && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12+
ca-certificates \
13+
libssl-dev \
14+
curl \
15+
g++ \
16+
make \
17+
git && \
18+
rm -rf /var/lib/apt/lists/*
19+
20+
RUN case ${TARGETPLATFORM} in \
21+
"linux/arm64") MAMBA_ARCH=aarch64 ;; \
22+
*) MAMBA_ARCH=x86_64 ;; \
23+
esac && \
24+
curl -fsSL -o ~/mambaforge.sh -v "https://github.com/conda-forge/miniforge/releases/download/${MAMBA_VERSION}/Mambaforge-${MAMBA_VERSION}-Linux-${MAMBA_ARCH}.sh" && \
25+
bash ~/mambaforge.sh -b -p /opt/conda && \
26+
rm ~/mambaforge.sh
27+
28+
RUN case ${TARGETPLATFORM} in \
29+
"linux/arm64") exit 1 ;; \
30+
*) /opt/conda/bin/conda update -y conda && \
31+
/opt/conda/bin/conda install -y "python=${PYTHON_VERSION}" && \
32+
/opt/conda/bin/conda install -y boost ;; \
33+
esac && \
34+
/opt/conda/bin/conda clean -ya
35+
36+
37+
WORKDIR /root
38+
39+
RUN --mount=type=cache,target=/root/.cache/pip pip install vllm==0.11.0 --pre --extra-index-url https://wheels.vllm.ai/nightly
40+
41+
COPY ./requirements.txt /lightllm/requirements.txt
42+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r /lightllm/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
43+
44+
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-deps -v 'git+https://github.com/ModelTC/LightKernel.git@07f2f62af5deb41f10a22660f9f42dba9273361e#egg=lightllm_kernel'
45+
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-deps -v 'git+https://github.com/ModelTC/LightMem.git@5900baf92d85ef4dbda6124093506b0af906011a#egg=light_mem'
46+
47+
RUN apt-get update && apt-get install -y libnuma-dev wget devscripts debhelper dh-make build-essential dkms
48+
RUN apt-get install -y ibverbs-providers infiniband-diags perftest rdma-core libibverbs-dev librdmacm-dev
49+
50+
ENV CUDA_HOME=/usr/local/cuda \
51+
GDRCOPY_HOME=/usr/src/gdrdrv-2.4.4/
52+
53+
RUN mkdir -p /tmp/gdrcopy && cd /tmp \
54+
&& git clone https://github.com/NVIDIA/gdrcopy.git -b v2.4.4 \
55+
&& cd gdrcopy/packages \
56+
&& CUDA=/usr/local/cuda ./build-deb-packages.sh \
57+
&& dpkg -i gdrdrv-dkms_*.deb libgdrapi_*.deb gdrcopy-tests_*.deb gdrcopy_*.deb \
58+
&& cd / && rm -rf /tmp/gdrcopy
59+
60+
# Fix DeepEP IBGDA symlink
61+
RUN ln -sf /usr/lib/x86_64-linux-gnu/libmlx5.so.1 /usr/lib/x86_64-linux-gnu/libmlx5.so
62+
63+
RUN wget https://developer.download.nvidia.com/compute/redist/nvshmem/3.3.9/source/nvshmem_src_cuda12-all-all-3.3.9.tar.gz \
64+
&& tar -xf nvshmem_src_cuda12-all-all-3.3.9.tar.gz && mv nvshmem_src nvshmem \
65+
&& cd nvshmem \
66+
&& rm -f /root/nvshmem_src_cuda12-all-all-3.3.9.tar.gz \
67+
&& NVSHMEM_SHMEM_SUPPORT=0 \
68+
NVSHMEM_UCX_SUPPORT=0 \
69+
NVSHMEM_USE_NCCL=0 \
70+
NVSHMEM_MPI_SUPPORT=0 \
71+
NVSHMEM_IBGDA_SUPPORT=1 \
72+
NVSHMEM_PMIX_SUPPORT=0 \
73+
NVSHMEM_TIMEOUT_DEVICE_POLLING=0 \
74+
NVSHMEM_USE_GDRCOPY=1 \
75+
cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX=/root/nvshmem/install -DCMAKE_CUDA_ARCHITECTURES=90 \
76+
&& cmake --build build --target install -j64
77+
78+
ARG DEEPEP_COMMIT=b6ce310bb0b75079682d09bc2ebc063a074fbd58
79+
RUN git clone https://github.com/deepseek-ai/DeepEP.git && cd DeepEP && git checkout ${DEEPEP_COMMIT} && cd ..
80+
81+
WORKDIR /root/DeepEP
82+
ENV NVSHMEM_DIR=/root/nvshmem/install
83+
RUN NVSHMEM_DIR=/root/nvshmem/install python setup.py install
84+
85+
RUN apt-get update && apt-get install -y cmake automake autotools-dev libtool libz-dev && \
86+
DEBIAN_FRONTEND=noninteractive apt-get -y install --reinstall libibverbs-dev rdma-core ibverbs-utils libibumad-dev; \
87+
rm -rf /usr/lib/ucx && \
88+
rm -rf /opt/hpcx/ucx && \
89+
cd /usr/local/src && \
90+
git clone https://github.com/openucx/ucx.git && \
91+
cd ucx && \
92+
git checkout v1.19.x && \
93+
./autogen.sh && ./configure \
94+
--enable-shared \
95+
--disable-static \
96+
--disable-doxygen-doc \
97+
--enable-optimizations \
98+
--enable-cma \
99+
--enable-devel-headers \
100+
--with-cuda=/usr/local/cuda \
101+
--with-verbs=yes \
102+
--with-dm \
103+
--with-gdrcopy=/usr/local \
104+
--with-efa \
105+
--enable-mt && \
106+
make -j && \
107+
make -j install-strip && \
108+
ldconfig;
109+
110+
RUN apt-get update && apt-get install -y pkg-config tmux net-tools libaio-dev ; \
111+
cd /usr/local/src; \
112+
pip install --upgrade meson pybind11 patchelf; \
113+
git clone https://github.com/ai-dynamo/nixl.git -b main && \
114+
cd nixl && \
115+
rm -rf build && \
116+
mkdir build && \
117+
meson setup build/ --prefix=/usr/local/nixl --buildtype=release && \
118+
cd build && \
119+
ninja && \
120+
ninja install && \
121+
cd .. && pip install . --no-deps;
122+
123+
COPY . /lightllm
124+
RUN pip install -e /lightllm --no-cache-dir

0 commit comments

Comments
 (0)