From b9b1969610f3a57f15f32010cc307a139d63297f Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 20 Sep 2025 10:43:14 +0800 Subject: [PATCH] . --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74dcd2bfc..d7ea6ce4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,9 +57,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY --from=builder-torch /opt/pytorch/dist /tmp/torch_dist RUN set -e && \ echo "==> Files in /tmp/torch_dist:" && ls -lh /tmp/torch_dist && \ - find /tmp/torch_dist -name 'torch-*.whl' -print | xargs -r python3 -m pip install --no-cache-dir --no-deps + find /tmp/torch_dist -name 'torch-*.whl' -print | xargs -r python3 -m pip install --no-cache-dir --no-deps && \ + # 立刻补齐 torch 运行时依赖(重点!) + python3 -m pip install --no-cache-dir \ + "typing-extensions>=4.10.0" "sympy>=1.13.3" jinja2 fsspec networkx filelock +RUN python3 - <<'PY' +import torch, typing_extensions, sympy, jinja2, fsspec, networkx +print("✅ Torch:", torch.__version__) +PY + # ── 编译 torchvision 0.22.1 (依赖本地 torch) ──────────────────────────────── WORKDIR /opt RUN git clone -b v0.22.1 https://github.com/pytorch/vision.git @@ -77,7 +85,7 @@ WORKDIR /opt/flashinfer ENV FLASHINFER_CUDA_ARCH_LIST="7.5 8.0 8.6 8.9" # 先做 AOT 预编译,再直接打 wheel(不隔离,使用同一份自编 torch) -RUN python3 -m pip install --no-cache-dir numpy requests build "cuda-python>=12.0,<13" "nvidia-nvshmem-cu12" ninja pynvml filelock && \ +RUN python3 -m pip install --no-cache-dir numpy requests build "cuda-python>=12.0,<13" "nvidia-nvshmem-cu12" ninja pynvml && \ python3 -m flashinfer.aot && \ python3 -m build --no-isolation --wheel && \ ls -lh dist/