This commit is contained in:
2026-03-11 17:12:30 +08:00
parent 549f2d9a2b
commit 608e2f20a6
2 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
# AMD R9700 vLLM Toolbox
amd-r9700-vllm-toolboxes/
amd-r9700-vllm-toolboxes-main/
+11 -13
View File
@@ -6,7 +6,7 @@ RUN dnf -y install --setopt=install_weak_deps=False --nodocs \
gcc gcc-c++ binutils make ffmpeg-free \
cmake ninja-build aria2c tar xz vim nano \
libdrm-devel zlib-devel openssl-devel jq \
numactl-devel gperftools-libs procps-ng \
numactl-devel gperftools-libs dialog procps-ng \
&& dnf clean all && rm -rf /var/cache/dnf/*
# 2. Install "TheRock" ROCm SDK (Tarball Method)
@@ -54,24 +54,23 @@ ENV PIP_NO_CACHE_DIR=1
RUN printf 'source /opt/venv/bin/activate\n' > /etc/profile.d/venv.sh
RUN python -m pip install --upgrade pip wheel packaging "setuptools<80.0.0"
# 5. Install PyTorch (TheRock Nightly) and PyYAML
# 5. Install PyTorch (TheRock Nightly)
RUN python -m pip install \
--index-url https://rocm.nightlies.amd.com/v2-staging/gfx120X-all/ \
--pre torch torchaudio torchvision && \
python -m pip install pyyaml
--pre torch torchaudio torchvision
# Flash-Attention
WORKDIR /opt
ENV FLASH_ATTENTION_TRITON_AMD_ENABLE="TRUE"
RUN pip install flash-attn --no-build-isolation \
--index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN git clone https://github.com/ROCm/flash-attention.git &&\
cd flash-attention &&\
git checkout main_perf &&\
python setup.py install && \
cd /opt && rm -rf /opt/flash-attention
# 6. Clone vLLM (with retry mechanism)
RUN for i in 1 2 3; do \
git clone --depth 1 https://github.com/vllm-project/vllm.git /opt/vllm && break || \
{ echo "Attempt $i failed. Retrying in 5 seconds..."; sleep 5; rm -rf /opt/vllm 2>/dev/null; }; \
done
# 6. Clone vLLM
RUN git clone https://github.com/vllm-project/vllm.git /opt/vllm
WORKDIR /opt/vllm
# --- PATCHING ---
@@ -118,8 +117,7 @@ ENV CXX="/opt/rocm/llvm/bin/clang++"
RUN export HIP_DEVICE_LIB_PATH=$(find /opt/rocm -type d -name bitcode -print -quit) && \
echo "Compiling with Bitcode: $HIP_DEVICE_LIB_PATH" && \
export CMAKE_PREFIX_PATH="/opt/venv/lib64/python3.13/site-packages/torch/share/cmake:/opt/rocm" && \
export CMAKE_ARGS="-DROCM_PATH=/opt/rocm -DHIP_PATH=/opt/rocm -DAMDGPU_TARGETS=gfx1201 -DHIP_ARCHITECTURES=gfx1201 -DCMAKE_PREFIX_PATH=/opt/venv/lib64/python3.13/site-packages/torch/share/cmake:/opt/rocm" && \
export CMAKE_ARGS="-DROCM_PATH=/opt/rocm -DHIP_PATH=/opt/rocm -DAMDGPU_TARGETS=gfx1201 -DHIP_ARCHITECTURES=gfx1201" && \
python -m pip wheel --no-build-isolation --no-deps -w /tmp/dist -v . && \
python -m pip install /tmp/dist/*.whl