This commit is contained in:
hailin 2025-09-19 09:39:41 +08:00
parent b036c487e4
commit 25dd4c4f52
1 changed files with 9 additions and 4 deletions

View File

@ -100,10 +100,15 @@ RUN python3 -m pip install ".[srt,openai]" --no-build-isolation && \
# ── 用你本地源码编 sgl-kernel==0.3.9.post2与自编 torch 完全 ABI 对齐) ────── # ── 用你本地源码编 sgl-kernel==0.3.9.post2与自编 torch 完全 ABI 对齐) ──────
WORKDIR /sgl/sglang/sgl-kernel WORKDIR /sgl/sglang/sgl-kernel
RUN python3 -m pip install --no-cache-dir "cmake>=3.27,<4.0" scikit-build-core==0.11.6 pybind11[global] packaging && \ RUN python3 -m pip install --no-cache-dir "cmake>=3.27,<4.0" scikit-build-core==0.11.6 pybind11[global] packaging && \
bash -lc 'export CMAKE_PREFIX_PATH="$(python3 -c "import torch; print(torch.utils.cmake_prefix_path)")" \ bash -lc '\
&& export TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9" SGL_KERNEL_COMPILE_THREADS=1 CMAKE_BUILD_PARALLEL_LEVEL=${MAX_JOBS:-96} FORCE_CUDA=1 \ export CMAKE_PREFIX_PATH="$(python3 -c "import torch; print(torch.utils.cmake_prefix_path)")" && \
&& export CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5" \ # 这些卡就够了A100(80), 3090(86), 4090(89)。别碰 90a。
&& python3 -m pip wheel . --no-deps --no-build-isolation -w /tmp/sgl_kernel_wheels' export TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9" && \
export CUDAARCHS="80;86;89" && \
export CMAKE_CUDA_ARCHITECTURES="$CUDAARCHS" && \
# 同时把它塞进 CMAKE_ARGS不认识的开关会被忽略不会报错
export CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_CUDA_ARCHITECTURES=$CUDAARCHS -DFA3_WITH_SM90A=OFF -DSGLK_DISABLE_SM90A=ON" && \
python3 -m pip wheel . --no-deps --no-build-isolation -w /tmp/sgl_kernel_wheels'
# ── 收集所有 wheel 到 /wheels ────────────────────────────────────────────── # ── 收集所有 wheel 到 /wheels ──────────────────────────────────────────────