x
This commit is contained in:
+9
-9
@@ -4,7 +4,7 @@ FROM registry.fedoraproject.org/fedora:43
|
|||||||
RUN dnf -y install --setopt=install_weak_deps=False --nodocs \
|
RUN dnf -y install --setopt=install_weak_deps=False --nodocs \
|
||||||
python3.13 python3.13-devel git rsync libatomic bash ca-certificates curl \
|
python3.13 python3.13-devel git rsync libatomic bash ca-certificates curl \
|
||||||
gcc gcc-c++ binutils make ffmpeg-free \
|
gcc gcc-c++ binutils make ffmpeg-free \
|
||||||
cmake ninja-build aria2c tar xz vim nano \
|
cmake ninja-build aria2c tar xz vim nano proxychains \
|
||||||
libdrm-devel zlib-devel openssl-devel jq \
|
libdrm-devel zlib-devel openssl-devel jq \
|
||||||
numactl-devel gperftools-libs procps-ng \
|
numactl-devel gperftools-libs procps-ng \
|
||||||
&& dnf clean all && rm -rf /var/cache/dnf/*
|
&& dnf clean all && rm -rf /var/cache/dnf/*
|
||||||
@@ -16,12 +16,12 @@ ARG GFX=gfx120X-all
|
|||||||
RUN set -euo pipefail; \
|
RUN set -euo pipefail; \
|
||||||
BASE="https://therock-nightly-tarball.s3.amazonaws.com"; \
|
BASE="https://therock-nightly-tarball.s3.amazonaws.com"; \
|
||||||
PREFIX="therock-dist-linux-${GFX}-${ROCM_MAJOR_VER}"; \
|
PREFIX="therock-dist-linux-${GFX}-${ROCM_MAJOR_VER}"; \
|
||||||
KEY="$(curl -s "${BASE}?list-type=2&prefix=${PREFIX}" \
|
KEY="$(proxychains curl -s "${BASE}?list-type=2&prefix=${PREFIX}" \
|
||||||
| tr '<' '\n' \
|
| tr '<' '\n' \
|
||||||
| grep -o "therock-dist-linux-${GFX}-${ROCM_MAJOR_VER}\..*\.tar\.gz" \
|
| grep -o "therock-dist-linux-${GFX}-${ROCM_MAJOR_VER}\..*\.tar\.gz" \
|
||||||
| sort -V | tail -n1)"; \
|
| sort -V | tail -n1)"; \
|
||||||
echo "Downloading Latest Tarball: ${KEY}"; \
|
echo "Downloading Latest Tarball: ${KEY}"; \
|
||||||
aria2c -x 16 -s 16 -j 16 --file-allocation=none "${BASE}/${KEY}" -o therock.tar.gz; \
|
proxychains aria2c -x 16 -s 16 -j 16 --file-allocation=none "${BASE}/${KEY}" -o therock.tar.gz; \
|
||||||
mkdir -p /opt/rocm; \
|
mkdir -p /opt/rocm; \
|
||||||
tar xzf therock.tar.gz -C /opt/rocm --strip-components=1; \
|
tar xzf therock.tar.gz -C /opt/rocm --strip-components=1; \
|
||||||
rm therock.tar.gz
|
rm therock.tar.gz
|
||||||
@@ -55,23 +55,23 @@ 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"
|
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) and PyYAML
|
||||||
RUN python -m pip install \
|
RUN proxychains python -m pip install \
|
||||||
--index-url https://rocm.nightlies.amd.com/v2-staging/gfx120X-all/ \
|
--index-url https://rocm.nightlies.amd.com/v2-staging/gfx120X-all/ \
|
||||||
--pre torch torchaudio torchvision && \
|
--pre torch torchaudio torchvision && \
|
||||||
python -m pip install pyyaml
|
proxychains python -m pip install pyyaml
|
||||||
|
|
||||||
# Flash-Attention
|
# Flash-Attention
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
ENV FLASH_ATTENTION_TRITON_AMD_ENABLE="TRUE"
|
ENV FLASH_ATTENTION_TRITON_AMD_ENABLE="TRUE"
|
||||||
|
|
||||||
RUN git clone https://github.com/ROCm/flash-attention.git &&\
|
RUN proxychains git clone https://github.com/ROCm/flash-attention.git &&\
|
||||||
cd flash-attention &&\
|
cd flash-attention &&\
|
||||||
git checkout main_perf &&\
|
git checkout main_perf &&\
|
||||||
python setup.py install && \
|
python setup.py install && \
|
||||||
cd /opt && rm -rf /opt/flash-attention
|
cd /opt && rm -rf /opt/flash-attention
|
||||||
|
|
||||||
# 6. Clone vLLM
|
# 6. Clone vLLM
|
||||||
RUN git clone https://github.com/vllm-project/vllm.git /opt/vllm
|
RUN proxychains git clone https://github.com/vllm-project/vllm.git /opt/vllm
|
||||||
WORKDIR /opt/vllm
|
WORKDIR /opt/vllm
|
||||||
|
|
||||||
# --- PATCHING ---
|
# --- PATCHING ---
|
||||||
@@ -108,7 +108,7 @@ ENV VLLM_TARGET_DEVICE="rocm"
|
|||||||
ENV PYTORCH_ROCM_ARCH="gfx1201"
|
ENV PYTORCH_ROCM_ARCH="gfx1201"
|
||||||
ENV HIP_ARCHITECTURES="gfx1201"
|
ENV HIP_ARCHITECTURES="gfx1201"
|
||||||
ENV AMDGPU_TARGETS="gfx1201"
|
ENV AMDGPU_TARGETS="gfx1201"
|
||||||
ENV MAX_JOBS="4"
|
ENV MAX_JOBS="32"
|
||||||
|
|
||||||
# --- FIX FOR SEGFAULT ---
|
# --- FIX FOR SEGFAULT ---
|
||||||
# We force the Host Compiler (CC/CXX) to be the ROCm Clang, not Fedora GCC.
|
# We force the Host Compiler (CC/CXX) to be the ROCm Clang, not Fedora GCC.
|
||||||
@@ -125,7 +125,7 @@ RUN export HIP_DEVICE_LIB_PATH=$(find /opt/rocm -type d -name bitcode -print -qu
|
|||||||
|
|
||||||
# --- bitsandbytes (ROCm) ---
|
# --- bitsandbytes (ROCm) ---
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
RUN git clone -b rocm_enabled_multi_backend https://github.com/ROCm/bitsandbytes.git
|
RUN proxychains git clone -b rocm_enabled_multi_backend https://github.com/ROCm/bitsandbytes.git
|
||||||
WORKDIR /opt/bitsandbytes
|
WORKDIR /opt/bitsandbytes
|
||||||
|
|
||||||
# Explicitly set HIP_PLATFORM (Docker ENV, not /etc/profile)
|
# Explicitly set HIP_PLATFORM (Docker ENV, not /etc/profile)
|
||||||
|
|||||||
+1
-1
@@ -265,7 +265,7 @@ build_image() {
|
|||||||
|
|
||||||
BUILD_START=$(date +%s)
|
BUILD_START=$(date +%s)
|
||||||
|
|
||||||
if docker build -t "${IMAGE_NAME}:${IMAGE_TAG}" .; then
|
if DOCKER_BUILDKIT=1 docker build --build-arg MAX_JOBS=32 -t "${IMAGE_NAME}:${IMAGE_TAG}" .; then
|
||||||
BUILD_END=$(date +%s)
|
BUILD_END=$(date +%s)
|
||||||
BUILD_TIME=$((BUILD_END - BUILD_START))
|
BUILD_TIME=$((BUILD_END - BUILD_START))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user