x
This commit is contained in:
+6
-8
@@ -286,22 +286,20 @@ COPY scripts/cache_warmer.py /opt/scripts/cache_warmer.py
|
||||
# ===========================================================================
|
||||
RUN set -ex && \
|
||||
export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
||||
# 先安装 vllm 的全部 Python 运行时依赖(--no-build-isolation 不自动装)
|
||||
# 跳过 setuptools 版本约束(与 PyTorch ROCm 构建工具链冲突)
|
||||
# 1) 安装 vllm(让 pip 完整解析依赖,参考 ROCm7.2升级指南.md 7.8 节)
|
||||
cd /opt/vllm && \
|
||||
grep -v 'setuptools' requirements/common.txt > /tmp/vllm_deps.txt && \
|
||||
${VENV}/bin/pip install -r /tmp/vllm_deps.txt && \
|
||||
${VENV}/bin/pip install -e . --no-build-isolation && \
|
||||
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
|
||||
# 2) 装完 vllm 后强制复查 PyTorch(vllm 依赖可能拉成 CUDA 版 torch)
|
||||
${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} && \
|
||||
# 深度验证 vllm(确保 AsyncEngineArgs、AsyncLLM 等关键模块可导入,缺包直接构建失败)
|
||||
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
|
||||
# 3) 深度验证 vllm(确保 AsyncEngineArgs、AsyncLLM 等关键模块可导入,缺包直接构建失败)
|
||||
${VENV}/bin/python -c "from vllm.engine.arg_utils import AsyncEngineArgs; from vllm.v1.engine.async_llm import AsyncLLM; print('vllm deep import OK:', __import__('vllm').__version__)" && \
|
||||
# 确保 mineru-api 子进程不依赖 PYTHONPATH 也能导入 vllm
|
||||
# 4) 确保 mineru-api 子进程不依赖 PYTHONPATH 也能导入 vllm
|
||||
echo "/opt/vllm" > ${VENV}/lib/python${PYTHON_VER}/site-packages/vllm.pth && \
|
||||
# 锁定 ROCm 关键包版本(不含 setuptools,避免与 vllm/mineru 依赖冲突)
|
||||
# 5) 锁定 ROCm 关键包版本(不含 setuptools,避免与 vllm/mineru 依赖冲突)
|
||||
${VENV}/bin/pip freeze | grep -iE "^(torch|vllm|triton|pytorch.triton|torchvision|flash.attn|aiter)" >> ${VENV}/torch-constraint.txt && \
|
||||
rm -rf /opt/vllm_build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user