Skip to content

Commit cd3859d

Browse files
fzyzcjylifuhuang
authored andcommitted
Add dev-deepep docker image (sgl-project#6198)
1 parent 712b913 commit cd3859d

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Dev-DeepEP Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
8+
jobs:
9+
build-dev:
10+
if: ${{ github.repository == 'sgl-project/sglang' }}
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Free disk space
17+
uses: jlumbroso/free-disk-space@main
18+
with:
19+
tool-cache: false
20+
docker-images: false
21+
android: true
22+
dotnet: true
23+
haskell: true
24+
large-packages: true
25+
swap-storage: false
26+
27+
- name: Login to Docker Hub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Build and Push DeepEP Image
34+
run: |
35+
docker build . -f docker/Dockerfile.dev-deepep -t lmsysorg/sglang:dev-deepep --no-cache
36+
docker push lmsysorg/sglang:dev-deepep

docker/Dockerfile.dev-deepep

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
FROM lmsysorg/sglang:dev
2+
3+
# CMake
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends \
6+
build-essential \
7+
wget \
8+
libssl-dev \
9+
&& wget https://github.com/Kitware/CMake/releases/download/v3.27.4/cmake-3.27.4-linux-x86_64.sh \
10+
&& chmod +x cmake-3.27.4-linux-x86_64.sh \
11+
&& ./cmake-3.27.4-linux-x86_64.sh --skip-license --prefix=/usr/local \
12+
&& rm cmake-3.27.4-linux-x86_64.sh
13+
14+
# Python
15+
RUN apt-get update \
16+
&& apt-get install -y --no-install-recommends \
17+
python3 \
18+
python3-pip \
19+
&& ln -s /usr/bin/python3 /usr/bin/python
20+
21+
# GDRCopy
22+
WORKDIR /tmp
23+
RUN git clone https://github.com/NVIDIA/gdrcopy.git
24+
WORKDIR /tmp/gdrcopy
25+
RUN git checkout v2.4.4
26+
27+
RUN apt update
28+
RUN apt install -y nvidia-dkms-535
29+
RUN apt install -y build-essential devscripts debhelper fakeroot pkg-config dkms
30+
RUN apt install -y check libsubunit0 libsubunit-dev
31+
32+
WORKDIR /tmp/gdrcopy/packages
33+
RUN CUDA=/usr/local/cuda ./build-deb-packages.sh
34+
RUN dpkg -i gdrdrv-dkms_*.deb
35+
RUN dpkg -i libgdrapi_*.deb
36+
RUN dpkg -i gdrcopy-tests_*.deb
37+
RUN dpkg -i gdrcopy_*.deb
38+
39+
ENV GDRCOPY_HOME=/usr/src/gdrdrv-2.4.4/
40+
41+
# IBGDA dependency
42+
RUN ln -s /usr/lib/x86_64-linux-gnu/libmlx5.so.1 /usr/lib/x86_64-linux-gnu/libmlx5.so
43+
RUN apt-get install -y libfabric-dev
44+
45+
# DeepEP
46+
WORKDIR /sgl-workspace
47+
RUN git clone https://github.com/deepseek-ai/DeepEP.git
48+
49+
# NVSHMEM
50+
WORKDIR /sgl-workspace
51+
RUN wget https://developer.download.nvidia.com/compute/redist/nvshmem/3.2.5/source/nvshmem_src_3.2.5-1.txz
52+
RUN tar -xf nvshmem_src_3.2.5-1.txz \
53+
&& mv nvshmem_src nvshmem
54+
55+
WORKDIR /sgl-workspace/nvshmem
56+
RUN git apply /sgl-workspace/DeepEP/third-party/nvshmem.patch
57+
58+
WORKDIR /sgl-workspace/nvshmem
59+
ENV CUDA_HOME=/usr/local/cuda
60+
RUN NVSHMEM_SHMEM_SUPPORT=0 \
61+
NVSHMEM_UCX_SUPPORT=0 \
62+
NVSHMEM_USE_NCCL=0 \
63+
NVSHMEM_MPI_SUPPORT=0 \
64+
NVSHMEM_IBGDA_SUPPORT=1 \
65+
NVSHMEM_PMIX_SUPPORT=0 \
66+
NVSHMEM_TIMEOUT_DEVICE_POLLING=0 \
67+
NVSHMEM_USE_GDRCOPY=1 \
68+
cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX=/sgl-workspace/nvshmem/install -DCMAKE_CUDA_ARCHITECTURES=90 \
69+
&& cd build \
70+
&& make install -j
71+
72+
WORKDIR /sgl-workspace/DeepEP
73+
ENV NVSHMEM_DIR=/sgl-workspace/nvshmem/install
74+
RUN NVSHMEM_DIR=/sgl-workspace/nvshmem/install pip install .
75+
76+
RUN set -euxo ; \
77+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
78+
79+
# Set workspace
80+
WORKDIR /sgl-workspace

0 commit comments

Comments
 (0)