Add Inkling model support (#31681)
Co-authored-by: Chunan Zeng <zcnrex@gmail.com> Co-authored-by: Ke Bao <ispobaoke@gmail.com> Co-authored-by: Yanbin Jiang <jybsuper@gmail.com> Co-authored-by: Yuhao Yang <47235274+yhyang201@users.noreply.github.com> Co-authored-by: Qiaolin Yu <qiaolin.yu@radixark.ai> Co-authored-by: Zhichen Zeng <zczeng@uw.edu> Co-authored-by: Aurick Qiao <aurick@thinkingmachines.ai> Co-authored-by: Joseph <jk@thinkingmachines.ai>
This commit is contained in:
co-authored by
Chunan Zeng
Ke Bao
Yanbin Jiang
Yuhao Yang
Qiaolin Yu
Zhichen Zeng
Aurick Qiao
Joseph
parent
829e9ce9d5
commit
02236fa38c
+33
-12
@@ -69,6 +69,11 @@ ENV BUILD_AITER_ALL="1"
|
||||
ENV BUILD_MOONCAKE="1"
|
||||
ENV AITER_COMMIT_DEFAULT="9127c94a18e4398e1eba91f6639e910f0994ad02"
|
||||
|
||||
# Local source stage: with BRANCH_TYPE=local the build context is copied here and
|
||||
# used instead of git clone (mirrors docker/Dockerfile's local_src stage).
|
||||
FROM scratch AS local_src
|
||||
COPY . /src
|
||||
|
||||
# ===============================
|
||||
# Chosen arch and args
|
||||
FROM ${GPU_ARCH}
|
||||
@@ -81,6 +86,7 @@ ENV PYTORCH_ROCM_ARCH=gfx942;gfx950
|
||||
ARG SGL_REPO="https://github.com/sgl-project/sglang.git"
|
||||
ARG SGL_DEFAULT="main"
|
||||
ARG SGL_BRANCH=${SGL_DEFAULT}
|
||||
ARG BRANCH_TYPE=remote
|
||||
|
||||
# Version override for setuptools_scm (used in nightly builds)
|
||||
ARG SETUPTOOLS_SCM_PRETEND_VERSION=""
|
||||
@@ -282,16 +288,35 @@ RUN pip install IPython \
|
||||
&& pip install torchao==0.9.0 \
|
||||
&& pip install pybind11
|
||||
|
||||
# Rust toolchain — needed by setuptools-rust to build the sglang-mm extension
|
||||
# (sglang.srt.multimodal._core) during the sglang pip install below, and later by
|
||||
# sgl-model-gateway. Must precede the sglang install.
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||
&& rustc --version && cargo --version
|
||||
ENV CARGO_BUILD_JOBS=4
|
||||
|
||||
RUN pip uninstall -y sgl_kernel sglang
|
||||
RUN git clone ${SGL_REPO} \
|
||||
&& cd sglang \
|
||||
&& if [ "${SGL_BRANCH}" = ${SGL_DEFAULT} ]; then \
|
||||
echo "Using ${SGL_DEFAULT}, default branch."; \
|
||||
git checkout ${SGL_DEFAULT}; \
|
||||
|
||||
# Obtain sglang source: copied from the build context (BRANCH_TYPE=local) or git clone.
|
||||
COPY --from=local_src /src /tmp/local_src
|
||||
RUN if [ "$BRANCH_TYPE" = "local" ]; then \
|
||||
echo "Using local source (BRANCH_TYPE=local)."; \
|
||||
cp -r /tmp/local_src sglang; \
|
||||
else \
|
||||
echo "Using ${SGL_BRANCH} branch."; \
|
||||
git checkout ${SGL_BRANCH}; \
|
||||
git clone ${SGL_REPO} sglang \
|
||||
&& cd sglang \
|
||||
&& if [ "${SGL_BRANCH}" = ${SGL_DEFAULT} ]; then \
|
||||
echo "Using ${SGL_DEFAULT}, default branch."; \
|
||||
git checkout ${SGL_DEFAULT}; \
|
||||
else \
|
||||
echo "Using ${SGL_BRANCH} branch."; \
|
||||
git checkout ${SGL_BRANCH}; \
|
||||
fi \
|
||||
&& cd ..; \
|
||||
fi \
|
||||
&& rm -rf /tmp/local_src \
|
||||
&& cd sglang \
|
||||
&& cd sgl-kernel \
|
||||
&& rm -f pyproject.toml \
|
||||
&& mv pyproject_rocm.toml pyproject.toml \
|
||||
@@ -311,11 +336,7 @@ RUN find /sgl-workspace/sglang/python/sglang/srt/layers/quantization/configs/ \
|
||||
/sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/configs/ \
|
||||
-type f -name '*MI300X*' | xargs -I {} sh -c 'vf_config=$(echo "$1" | sed "s/MI300X/MI300X_VF/"); cp "$1" "$vf_config"' -- {}
|
||||
|
||||
# Install Rust toolchain for sgl-model-gateway
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||
&& rustc --version && cargo --version
|
||||
ENV CARGO_BUILD_JOBS=4
|
||||
# Rust toolchain already installed above (before the sglang install).
|
||||
|
||||
# Build and install sgl-model-gateway
|
||||
RUN python3 -m pip install --no-cache-dir "maturin<1.14" \
|
||||
|
||||
Reference in New Issue
Block a user