Dockerfile 1.95 KB
Newer Older
1
ARG CUDA_VERSION=12.4.1
2

3
FROM nvcr.io/nvidia/tritonserver:24.12-py3-min
4

Yineng Zhang's avatar
Yineng Zhang committed
5
ARG BUILD_TYPE=all
Ying Sheng's avatar
Ying Sheng committed
6
7
8
9
ENV DEBIAN_FRONTEND=noninteractive

RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
    && echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
Yineng Zhang's avatar
Yineng Zhang committed
10
11
    && apt update -y \
    && apt install software-properties-common -y \
12
    && apt install python3 python3-pip -y \
13
    && apt install curl git sudo libibverbs-dev -y \
14
    && apt install rdma-core infiniband-diags openssh-server perftest -y \
Ying Sheng's avatar
Ying Sheng committed
15
    && python3 --version \
Liangsheng Yin's avatar
Liangsheng Yin committed
16
17
    && python3 -m pip --version \
    && rm -rf /var/lib/apt/lists/* \
Yineng Zhang's avatar
Yineng Zhang committed
18
    && apt clean
Ying Sheng's avatar
Ying Sheng committed
19

20
21
22
# For openbmb/MiniCPM models
RUN pip3 install datamodel_code_generator

Ying Sheng's avatar
Ying Sheng committed
23
24
WORKDIR /sgl-workspace

25
ARG CUDA_VERSION
Yineng Zhang's avatar
Yineng Zhang committed
26
RUN python3 -m pip install --upgrade pip setuptools wheel html5lib six \
27
    && git clone --depth=1 https://github.com/sgl-project/sglang.git \
Yineng Zhang's avatar
Yineng Zhang committed
28
    && if [ "$CUDA_VERSION" = "12.1.1" ]; then \
29
         export CUINDEX=121; \
Yineng Zhang's avatar
Yineng Zhang committed
30
       elif [ "$CUDA_VERSION" = "12.4.1" ]; then \
31
         export CUINDEX=124; \
32
       elif [ "$CUDA_VERSION" = "12.8.1" ]; then \
33
         export CUINDEX=124; \
Yineng Zhang's avatar
Yineng Zhang committed
34
       elif [ "$CUDA_VERSION" = "11.8.0" ]; then \
35
36
         export CUINDEX=118; \
         python3 -m pip install --no-cache-dir sgl-kernel -i https://docs.sglang.ai/whl/cu118; \
Yineng Zhang's avatar
Yineng Zhang committed
37
38
39
       else \
         echo "Unsupported CUDA version: $CUDA_VERSION" && exit 1; \
       fi \
Yineng Zhang's avatar
Yineng Zhang committed
40
41
42
43
44
    && if [ "$CUDA_VERSION" = "12.4.1" ]; then \
         python3 -m pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cu126; \
       else \
         python3 -m pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cu${CUINDEX}; \
       fi \
45
    && cd sglang \
Yineng Zhang's avatar
Yineng Zhang committed
46
    && python3 -m pip --no-cache-dir install -e "python[${BUILD_TYPE}]" \
47
48
49
    && if [ "$CUDA_VERSION" = "12.8.1" ]; then \
         python3 -m pip install nvidia-nccl-cu12==2.26.2.post1 --force-reinstall --no-deps; \
       fi
Yineng Zhang's avatar
Yineng Zhang committed
50

Ying Sheng's avatar
Ying Sheng committed
51
ENV DEBIAN_FRONTEND=interactive