x
This commit is contained in:
+5
-17
@@ -294,29 +294,17 @@ RUN set -ex && \
|
|||||||
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
|
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
|
||||||
--index-url ${TORCH_INDEX} && \
|
--index-url ${TORCH_INDEX} && \
|
||||||
${VENV}/bin/python -c "import vllm; print('vllm import OK:', vllm.__version__)" && \
|
${VENV}/bin/python -c "import vllm; print('vllm import OK:', vllm.__version__)" && \
|
||||||
${VENV}/bin/pip show vllm | awk '/^Version:/{printf "vllm==%s\n", $2}' >> ${VENV}/torch-constraint.txt && \
|
# 锁定所有 ROCm 关键包版本,防止 mineru 安装时覆盖
|
||||||
|
${VENV}/bin/pip freeze | grep -iE "^(torch|vllm|triton|pytorch.triton|setuptools)" >> ${VENV}/torch-constraint.txt && \
|
||||||
rm -rf /opt/vllm_build
|
rm -rf /opt/vllm_build
|
||||||
|
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# 阶段 9:安装 MinerU + RDNA 适配补丁 + PyTorch 恢复
|
# 阶段 9:安装 MinerU(--no-deps 避免污染 ROCm 环境)
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
RUN set -ex && \
|
RUN set -ex && \
|
||||||
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
||||||
${VENV}/bin/pip install 'mineru[core]' && \
|
${VENV}/bin/pip install --no-deps 'mineru[core]' && \
|
||||||
# mineru[core] 会把 ROCm PyTorch/vllm 替换成 CUDA 版
|
${VENV}/bin/python -c "import torch; import vllm; import mineru; print('MinerU OK')"
|
||||||
# 必须先卸载 CUDA triton,再装回 ROCm 版 torch + vllm
|
|
||||||
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
|
|
||||||
${VENV}/bin/pip install --force-reinstall \
|
|
||||||
torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \
|
|
||||||
--index-url ${TORCH_INDEX} && \
|
|
||||||
cd /opt/vllm && \
|
|
||||||
sed -i 's/license = "Apache-2.0"/license = {text = "Apache-2.0"}/' pyproject.toml && \
|
|
||||||
# mineru[core] 把 setuptools 降级了,需要升回去
|
|
||||||
${VENV}/bin/pip install -U "setuptools>=77.0.3" setuptools_scm setuptools_rust wheel && \
|
|
||||||
${VENV}/bin/pip install -e . --no-build-isolation --no-deps && \
|
|
||||||
${VENV}/bin/python -c "import triton.language; print('triton OK')" && \
|
|
||||||
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
|
|
||||||
${VENV}/bin/python -c "import vllm; print('vllm OK:', vllm.__version__)"
|
|
||||||
|
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# 阶段 10:入口与最终验证
|
# 阶段 10:入口与最终验证
|
||||||
|
|||||||
Reference in New Issue
Block a user