Dockerfile.xeon 1.59 KB
Newer Older
1
2
3
4
FROM ubuntu:24.04
SHELL ["/bin/bash", "-c"]

ARG VER_SGLANG=main
5
6
7
ARG VER_TORCH=2.7.1
ARG VER_TORCHVISION=0.22.1
ARG VER_TRITON=3.3.1
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

RUN apt-get update && \
    apt-get full-upgrade -y && \
    DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
    ca-certificates \
    git \
    curl \
    wget \
    vim \
    gcc \
    g++ \
    make

WORKDIR /sgl-workspace

RUN curl -fsSL -v -o miniforge.sh -O https://github.com/conda-forge/miniforge/releases/download/24.11.3-2/Miniforge3-24.11.3-2-Linux-x86_64.sh && \
    bash miniforge.sh -b -p ./miniforge3 && \
    rm -f miniforge.sh && \
    . miniforge3/bin/activate && \
    conda install -y libsqlite==3.48.0 gperftools tbb libnuma numactl

ENV PATH=/sgl-workspace/miniforge3/bin:/sgl-workspace/miniforge3/condabin:${PATH}
ENV PIP_ROOT_USER_ACTION=ignore
31
ENV CONDA_PREFIX=/sgl-workspace/miniforge3
32

33
34
35
RUN pip config set global.index-url https://download.pytorch.org/whl/cpu && \
    pip config set global.extra-index-url https://pypi.org/simple && \
    pip install intel-openmp
36
37
38
39
40

RUN git clone https://github.com/sgl-project/sglang.git && \
    cd sglang && \
    git checkout ${VER_SGLANG} && \
    pip install -e "python[all_cpu]" && \
41
    pip install torch==${VER_TORCH} torchvision==${VER_TORCHVISION} triton==${VER_TRITON} --force-reinstall && \
42
43
44
45
    cd sgl-kernel && \
    cp pyproject_cpu.toml pyproject.toml && \
    pip install -v .

46
ENV SGLANG_USE_CPU_ENGINE=1
47
48
49
ENV LD_PRELOAD=/sgl-workspace/miniforge3/lib/libiomp5.so:/sgl-workspace/miniforge3/lib/libtcmalloc.so:/sgl-workspace/miniforge3/lib/libtbbmalloc.so.2

WORKDIR /sgl-workspace/sglang