This commit is contained in:
parent
ae99d6a643
commit
89e7e9d337
|
|
@ -1,5 +1,5 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Stage 0 ─ builder-torch:编译 PyTorch 2.7.1 (+cu126)
|
# Stage 0 ─ builder-torch:编译 PyTorch 2.8.0 (+cu126)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
ARG CUDA_VERSION=12.6.1
|
ARG CUDA_VERSION=12.6.1
|
||||||
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS builder-torch
|
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS builder-torch
|
||||||
|
|
@ -38,6 +38,7 @@ COPY ./pytorch_2.8.0/ /opt/pytorch
|
||||||
WORKDIR /opt/pytorch
|
WORKDIR /opt/pytorch
|
||||||
ENV MAX_JOBS=${MAX_JOBS}
|
ENV MAX_JOBS=${MAX_JOBS}
|
||||||
RUN echo "Building PyTorch with USE_DISTRIBUTED=$USE_DISTRIBUTED" && \
|
RUN echo "Building PyTorch with USE_DISTRIBUTED=$USE_DISTRIBUTED" && \
|
||||||
|
export PYTORCH_BUILD_VERSION=2.8.0 PYTORCH_BUILD_NUMBER=1 && \
|
||||||
python3 setup.py bdist_wheel
|
python3 setup.py bdist_wheel
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
@ -141,7 +142,7 @@ RUN python3 -m pip install --no-cache-dir "cmake>=3.27,<4.0" scikit-build-core==
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
||||||
# ★ 构建期 constraints:把自编的 torch / sgl-kernel / flashinfer 都锁到本地 wheel
|
# ★ 构constraints:把自编的 torch,sgl-kernel,flashinfer都锁到本地 wheel,用于接下来的sglang 0.5.2打wheel
|
||||||
RUN bash -lc '\
|
RUN bash -lc '\
|
||||||
set -euo pipefail; \
|
set -euo pipefail; \
|
||||||
TWHL=$(ls /tmp/torch_dist/torch-*.whl | head -n1); \
|
TWHL=$(ls /tmp/torch_dist/torch-*.whl | head -n1); \
|
||||||
|
|
@ -156,6 +157,7 @@ RUN bash -lc '\
|
||||||
echo ">>> build-time constraints:"; cat /tmp/local_constraints_build.txt \
|
echo ">>> build-time constraints:"; cat /tmp/local_constraints_build.txt \
|
||||||
'
|
'
|
||||||
|
|
||||||
|
#安装刚构建好的sgl_kernel到当前正在构建的docker image中
|
||||||
RUN python3 -m pip install --no-cache-dir --no-deps /tmp/sgl_kernel_wheels/sgl_kernel-*.whl
|
RUN python3 -m pip install --no-cache-dir --no-deps /tmp/sgl_kernel_wheels/sgl_kernel-*.whl
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -230,7 +232,6 @@ COPY _wheelhouse/ /tmp/wheels/
|
||||||
|
|
||||||
# 安装顺序与 runtime-autobuild 完全一致(优先 torch,再装其它)
|
# 安装顺序与 runtime-autobuild 完全一致(优先 torch,再装其它)
|
||||||
RUN ls -lh /tmp/wheels || true && \
|
RUN ls -lh /tmp/wheels || true && \
|
||||||
# rm -f /tmp/wheels/torch-2.7.1a0+*.whl && \
|
|
||||||
rm -f /tmp/wheels/huggingface_hub-0.34.4*.whl || true && \
|
rm -f /tmp/wheels/huggingface_hub-0.34.4*.whl || true && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/torch*.whl && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/torch*.whl && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/vllm-*.whl || true && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/vllm-*.whl || true && \
|
||||||
|
|
@ -276,13 +277,11 @@ COPY _wheelhouse/ /tmp/wheels/
|
||||||
|
|
||||||
# ✅ 优先装你自编的 torch,避免被 PyPI 上的覆盖
|
# ✅ 优先装你自编的 torch,避免被 PyPI 上的覆盖
|
||||||
RUN ls -lh /tmp/wheels && \
|
RUN ls -lh /tmp/wheels && \
|
||||||
# rm -f /tmp/wheels/torch-2.7.1a0+*.whl && \
|
|
||||||
rm -f /tmp/wheels/huggingface_hub-0.34.4*.whl && \
|
rm -f /tmp/wheels/huggingface_hub-0.34.4*.whl && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/torch*.whl && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/torch*.whl && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/vllm-*.whl && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/vllm-*.whl && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/sgl_kernel-*.whl && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/sgl_kernel-*.whl && \
|
||||||
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/gradio-5.38.2*.whl && \
|
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/gradio-5.38.2*.whl && \
|
||||||
# python3 -m pip install --no-cache-dir --no-deps $(ls /tmp/wheels | grep -v '^gradio-' | sed 's|^|/tmp/wheels/|') && \
|
|
||||||
python3 -m pip install --no-cache-dir --no-deps $(find /tmp/wheels -maxdepth 1 -type f -name '*.whl' ! -name 'gradio-*') && \
|
python3 -m pip install --no-cache-dir --no-deps $(find /tmp/wheels -maxdepth 1 -type f -name '*.whl' ! -name 'gradio-*') && \
|
||||||
python3 -c "import gradio, sys; print('✅ Gradio version =', gradio.__version__)" && \
|
python3 -c "import gradio, sys; print('✅ Gradio version =', gradio.__version__)" && \
|
||||||
rm -rf /tmp/wheels
|
rm -rf /tmp/wheels
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue