Dedicated toml files for CPU/XPU (#10734)

This commit is contained in:
Zaili Wang
2025-10-10 15:44:55 +08:00
committed by GitHub
parent 8df4945559
commit f19613e6c3
5 changed files with 262 additions and 9 deletions

View File

@@ -1,7 +1,9 @@
FROM ubuntu:24.04
SHELL ["/bin/bash", "-c"]
ARG SGLANG_REPO=https://github.com/sgl-project/sglang.git
ARG VER_SGLANG=main
ARG VER_TORCH=2.7.1
ARG VER_TORCHVISION=0.22.1
ARG VER_TRITON=3.3.1
@@ -20,7 +22,7 @@ RUN apt-get update && \
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 && \
RUN curl -fsSL -o miniforge.sh -O https://github.com/conda-forge/miniforge/releases/download/25.3.1-0/Miniforge3-25.3.1-0-Linux-x86_64.sh && \
bash miniforge.sh -b -p ./miniforge3 && \
rm -f miniforge.sh && \
. miniforge3/bin/activate && \
@@ -33,13 +35,14 @@ ENV CONDA_PREFIX=/sgl-workspace/miniforge3
RUN pip config set global.index-url https://download.pytorch.org/whl/cpu && \
pip config set global.extra-index-url https://pypi.org/simple
RUN git clone https://github.com/sgl-project/sglang.git && \
RUN git clone ${SGLANG_REPO} && \
cd sglang && \
rm -rf python/pyproject.toml && mv python/pyproject_other.toml python/pyproject.toml && \
git checkout ${VER_SGLANG} && \
pip install -e "python[all_cpu]" && \
cd python && \
cp pyproject_cpu.toml pyproject.toml && \
pip install . && \
pip install torch==${VER_TORCH} torchvision==${VER_TORCHVISION} triton==${VER_TRITON} --force-reinstall && \
cd sgl-kernel && \
cd ../sgl-kernel && \
cp pyproject_cpu.toml pyproject.toml && \
pip install .