diff --git a/docker/Dockerfile b/docker/Dockerfile index 74319e82b..628196c54 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -239,6 +239,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \ && echo '__version__ = "0.0.0"' > sglang/version.py \ && touch README.md \ && touch LICENSE \ + && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ + sed -i 's/cuda-python>=13\.0/cuda-python>=12,<13/' pyproject.toml && \ + sed -i 's/flashinfer_python\[cu13\]/flashinfer_python[cu12]/' pyproject.toml && \ + sed -i 's/nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' pyproject.toml; \ + fi \ && python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu${CUINDEX} ".[${BUILD_TYPE}]" \ && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ pip list --format=freeze | awk -F'==' '/-cu13(==|$)/ {print $1}' \ @@ -669,6 +674,11 @@ RUN if [ "$BRANCH_TYPE" = "local" ]; then \ # Clean up __pycache__/tests/pyc in same RUN to avoid writing ~28k files to layer RUN --mount=type=cache,target=/root/.cache/pip \ cd /sgl-workspace/sglang \ + && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ + sed -i 's/cuda-python>=13\.0/cuda-python>=12,<13/' python/pyproject.toml && \ + sed -i 's/flashinfer_python\[cu13\]/flashinfer_python[cu12]/' python/pyproject.toml && \ + sed -i 's/nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' python/pyproject.toml; \ + fi \ && python3 -m pip install --no-deps -e "python[${BUILD_TYPE}]" \ && kernels lock python \ && ( success=0; \