x
This commit is contained in:
+12
-12
@@ -15,7 +15,7 @@ ARG TORCH_INDEX=https://download.pytorch.org/whl/rocm7.2
|
||||
ARG GIT_PROXY=http://127.0.0.1:8118
|
||||
|
||||
# -- 国内镜像 ----------------------------------------------------------------
|
||||
ARG PIP_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
ARG PIP_INDEX=https://mirrors.aliyun.com/pypi/simple
|
||||
|
||||
# -- 环境变量 ---------------------------------------------------------------
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
@@ -95,10 +95,10 @@ RUN python${PYTHON_VER} -m venv ${VENV} && \
|
||||
mkdir -p /root/.pip && \
|
||||
echo "[global]" > /root/.pip/pip.conf && \
|
||||
echo "index-url = ${PIP_INDEX}" >> /root/.pip/pip.conf && \
|
||||
${VENV}/bin/pip install --no-cache-dir -U pip setuptools wheel && \
|
||||
${VENV}/bin/pip install -U pip setuptools wheel && \
|
||||
# PyTorch ROCm wheels 在海外 CDN,通过代理下载
|
||||
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
||||
${VENV}/bin/pip install --no-cache-dir --pre \
|
||||
${VENV}/bin/pip install --pre \
|
||||
torch==2.11.0+rocm7.2 \
|
||||
torchvision \
|
||||
pytorch-triton-rocm \
|
||||
@@ -120,7 +120,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# ===========================================================================
|
||||
RUN if [ -d /opt/rocm/share/amd_smi ]; then \
|
||||
cp -r /opt/rocm/share/amd_smi /opt/amd_smi && \
|
||||
cd /opt/amd_smi && ${VENV}/bin/pip install --no-cache-dir . --no-build-isolation && \
|
||||
cd /opt/amd_smi && ${VENV}/bin/pip install . --no-build-isolation && \
|
||||
echo "amdsmi installed."; \
|
||||
else \
|
||||
echo "amdsmi source not found, skipping."; \
|
||||
@@ -132,8 +132,8 @@ RUN if [ -d /opt/rocm/share/amd_smi ]; then \
|
||||
COPY aiter/ /opt/aiter/
|
||||
COPY flash-attention/ /opt/flash-attention/
|
||||
RUN set -ex && \
|
||||
${VENV}/bin/pip install --no-cache-dir -e /opt/aiter && \
|
||||
${VENV}/bin/pip install --no-cache-dir --no-build-isolation -e /opt/flash-attention && \
|
||||
${VENV}/bin/pip install -e /opt/aiter && \
|
||||
${VENV}/bin/pip install --no-build-isolation -e /opt/flash-attention && \
|
||||
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)"
|
||||
|
||||
# ===========================================================================
|
||||
@@ -141,7 +141,7 @@ RUN set -ex && \
|
||||
# ===========================================================================
|
||||
COPY vllm/ /opt/vllm/
|
||||
RUN set -ex && \
|
||||
${VENV}/bin/pip install --no-cache-dir -U \
|
||||
${VENV}/bin/pip install -U \
|
||||
"setuptools>=77.0.3" setuptools_scm setuptools_rust wheel && \
|
||||
cd /opt/vllm && \
|
||||
if [ -f csrc/mamba/mamba_ssm/selective_scan.h ]; then \
|
||||
@@ -277,12 +277,12 @@ COPY scripts/cache_warmer.py /opt/cache_warmer.py
|
||||
# 阶段 8b:安装 vllm + 平台补丁 + 验证
|
||||
# ===========================================================================
|
||||
RUN set -ex && \
|
||||
cd /opt/vllm && ${VENV}/bin/pip install --no-cache-dir -e . --no-build-isolation && \
|
||||
${VENV}/bin/pip install --no-cache-dir regex && \
|
||||
cd /opt/vllm && ${VENV}/bin/pip install -e . --no-build-isolation && \
|
||||
${VENV}/bin/pip install regex && \
|
||||
${VENV}/bin/python /opt/patch_vllm_platform.py && \
|
||||
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
|
||||
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
|
||||
${VENV}/bin/pip install --no-cache-dir --force-reinstall \
|
||||
${VENV}/bin/pip install --force-reinstall \
|
||||
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
|
||||
--index-url ${TORCH_INDEX} && \
|
||||
${VENV}/bin/python -c "import vllm; print('vllm import OK:', vllm.__version__)" && \
|
||||
@@ -292,13 +292,13 @@ RUN set -ex && \
|
||||
# 阶段 9:安装 MinerU + RDNA 适配补丁 + PyTorch 恢复
|
||||
# ===========================================================================
|
||||
RUN set -ex && \
|
||||
${VENV}/bin/pip install --no-cache-dir 'mineru[core]' && \
|
||||
${VENV}/bin/pip install 'mineru[core]' && \
|
||||
${VENV}/bin/python /opt/apply_mineru_patches.py && \
|
||||
# mineru[core] 会把 ROCm PyTorch 替换成 CUDA 版 + 安装 CUDA triton
|
||||
# 必须先卸载 CUDA triton,再装回 ROCm 版
|
||||
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
|
||||
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
||||
${VENV}/bin/pip install --no-cache-dir --force-reinstall \
|
||||
${VENV}/bin/pip install --force-reinstall \
|
||||
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
|
||||
--index-url ${TORCH_INDEX} && \
|
||||
${VENV}/bin/python -c "import triton.language; print('triton OK')" && \
|
||||
|
||||
Reference in New Issue
Block a user