|
| 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