This commit is contained in:
2026-06-09 15:36:23 +08:00
parent 0e9e9d6221
commit 4d7833162a
+4 -9
View File
@@ -127,27 +127,22 @@ RUN if [ -d /opt/rocm/share/amd_smi ]; then \
fi fi
# =========================================================================== # ===========================================================================
# 阶段 7:amd-aiter + flash_attn # 阶段 7:复制预克隆仓库 + 安装 aiter + flash_attn
# =========================================================================== # ===========================================================================
COPY aiter/ /opt/aiter/
COPY flash-attention/ /opt/flash-attention/
RUN set -ex && \ RUN set -ex && \
git config --global http.proxy ${GIT_PROXY} && \
git config --global https.proxy ${GIT_PROXY} && \
cd /opt && git clone --recursive --depth 1 https://github.com/ROCm/aiter.git && \
${VENV}/bin/pip install --no-cache-dir -e /opt/aiter && \ ${VENV}/bin/pip install --no-cache-dir -e /opt/aiter && \
cd /opt && git clone --recursive https://github.com/Dao-AILab/flash-attention.git && \
cd flash-attention && git checkout bba578d43974c1d3ba157ab597124dd0fe2ccdb4 && \
${VENV}/bin/pip install --no-cache-dir --no-build-isolation -e /opt/flash-attention && \ ${VENV}/bin/pip install --no-cache-dir --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)" ${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)"
# =========================================================================== # ===========================================================================
# 阶段 8a:编译 vllm(cmake + ninja,最耗时,单独缓存) # 阶段 8a:编译 vllm(cmake + ninja,最耗时,单独缓存)
# =========================================================================== # ===========================================================================
COPY vllm/ /opt/vllm/
RUN set -ex && \ RUN set -ex && \
git config --global http.proxy ${GIT_PROXY} && \
git config --global https.proxy ${GIT_PROXY} && \
${VENV}/bin/pip install --no-cache-dir -U \ ${VENV}/bin/pip install --no-cache-dir -U \
"setuptools>=77.0.3" setuptools_scm setuptools_rust wheel && \ "setuptools>=77.0.3" setuptools_scm setuptools_rust wheel && \
cd /opt && git clone --depth 1 https://github.com/vllm-project/vllm.git && \
cd /opt/vllm && \ cd /opt/vllm && \
if [ -f csrc/mamba/mamba_ssm/selective_scan.h ]; then \ if [ -f csrc/mamba/mamba_ssm/selective_scan.h ]; then \
sed -i '109,121s/^/\/\/ /' csrc/mamba/mamba_ssm/selective_scan.h && \ sed -i '109,121s/^/\/\/ /' csrc/mamba/mamba_ssm/selective_scan.h && \