Dockerfile 2.12 KB
Newer Older
1
2
3
4
ARG CUDA_VERSION=12.5.1

FROM nvcr.io/nvidia/tritonserver:24.04-py3-min

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
12
    && apt update -y \
    && apt install software-properties-common -y \
    && add-apt-repository ppa:deadsnakes/ppa -y && apt update \
13
    && apt install python3.10 python3.10-dev -y \
14
    && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 \
Yineng Zhang's avatar
Yineng Zhang committed
15
    && update-alternatives --set python3 /usr/bin/python3.10 && apt install python3.10-distutils -y \
16
    && apt install curl git sudo libibverbs-dev -y \
17
    && apt install -y rdma-core infiniband-diags openssh-server perftest ibverbs-providers libibumad3 libibverbs1 libnl-3-200 libnl-route-3-200 librdmacm1 \
Yineng Zhang's avatar
Yineng Zhang committed
18
    && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py \
Ying Sheng's avatar
Ying Sheng committed
19
    && python3 --version \
Liangsheng Yin's avatar
Liangsheng Yin committed
20
21
    && python3 -m pip --version \
    && rm -rf /var/lib/apt/lists/* \
Yineng Zhang's avatar
Yineng Zhang committed
22
    && apt clean
Ying Sheng's avatar
Ying Sheng committed
23

24
25
26
# For openbmb/MiniCPM models
RUN pip3 install datamodel_code_generator

Ying Sheng's avatar
Ying Sheng committed
27
28
WORKDIR /sgl-workspace

29
ARG CUDA_VERSION
Yineng Zhang's avatar
Yineng Zhang committed
30
RUN python3 -m pip install --upgrade pip setuptools wheel html5lib six \
31
    && git clone --depth=1 https://github.com/sgl-project/sglang.git \
Yineng Zhang's avatar
Yineng Zhang committed
32
    && if [ "$CUDA_VERSION" = "12.1.1" ]; then \
33
         export CUINDEX=121; \
Yineng Zhang's avatar
Yineng Zhang committed
34
       elif [ "$CUDA_VERSION" = "12.4.1" ]; then \
35
         export CUINDEX=124; \
36
       elif [ "$CUDA_VERSION" = "12.5.1" ]; then \
37
         export CUINDEX=124; \
Yineng Zhang's avatar
Yineng Zhang committed
38
       elif [ "$CUDA_VERSION" = "11.8.0" ]; then \
39
40
         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
41
42
43
       else \
         echo "Unsupported CUDA version: $CUDA_VERSION" && exit 1; \
       fi \
44
    && python3 -m pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cu${CUINDEX} \
45
    && cd sglang \
46
    && python3 -m pip --no-cache-dir install -e "python[${BUILD_TYPE}]" --find-links https://flashinfer.ai/whl/cu${CUINDEX}/torch2.5/flashinfer-python
Yineng Zhang's avatar
Yineng Zhang committed
47

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