This commit is contained in:
parent
57d862d695
commit
b9b1969610
12
Dockerfile
12
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
|
COPY --from=builder-torch /opt/pytorch/dist /tmp/torch_dist
|
||||||
RUN set -e && \
|
RUN set -e && \
|
||||||
echo "==> Files in /tmp/torch_dist:" && ls -lh /tmp/torch_dist && \
|
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) ────────────────────────────────
|
# ── 编译 torchvision 0.22.1 (依赖本地 torch) ────────────────────────────────
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
RUN git clone -b v0.22.1 https://github.com/pytorch/vision.git
|
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"
|
ENV FLASHINFER_CUDA_ARCH_LIST="7.5 8.0 8.6 8.9"
|
||||||
|
|
||||||
# 先做 AOT 预编译,再直接打 wheel(不隔离,使用同一份自编 torch)
|
# 先做 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 flashinfer.aot && \
|
||||||
python3 -m build --no-isolation --wheel && \
|
python3 -m build --no-isolation --wheel && \
|
||||||
ls -lh dist/
|
ls -lh dist/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue