@@ -4,7 +4,7 @@ ARG UBUNTU_VERSION=24.04
44ARG ROCM_VERSION=6.4
55ARG AMDGPU_VERSION=6.4
66
7- # Target the CUDA build image
7+ # Target the ROCm build image
88ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
99
1010# ## Build image
@@ -15,16 +15,13 @@ FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1515# This is mostly tied to rocBLAS supported archs.
1616# gfx803, gfx900, gfx1032, gfx1101, gfx1102,not officialy supported
1717# gfx906 is deprecated
18- # check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.2.4 /reference/system-requirements.html
18+ # check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.4.1 /reference/system-requirements.html
1919
20- ARG ROCM_DOCKER_ARCH='gfx803, gfx900, gfx906, gfx908, gfx90a, gfx942, gfx1010, gfx1030, gfx1032, gfx1100, gfx1101, gfx1102'
21- # ARG ROCM_DOCKER_ARCH=gfx1100
20+ ARG ROCM_DOCKER_ARCH='gfx803; gfx900; gfx906; gfx908; gfx90a; gfx942; gfx1010; gfx1030; gfx1032; gfx1100; gfx1101; gfx1102;gfx1200;gfx1201;gfx1151 '
21+ # ARG ROCM_DOCKER_ARCH='gfx1151'
2222
23- # Set nvcc architectured
23+ # Set ROCm architectures
2424ENV AMDGPU_TARGETS=${ROCM_DOCKER_ARCH}
25- # Enable ROCm
26- # ENV CC=/opt/rocm/llvm/bin/clang
27- # ENV CXX=/opt/rocm/llvm/bin/clang++
2825
2926RUN apt-get update \
3027 && apt-get install -y \
@@ -39,8 +36,16 @@ WORKDIR /app
3936
4037COPY . .
4138
39+ RUN git clone https://github.com/rocm/rocwmma --branch develop --depth 1
40+
4241RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
43- cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=$ROCM_DOCKER_ARCH -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \
42+ cmake -S . -B build \
43+ -DGGML_HIP=ON \
44+ -DGGML_HIP_ROCWMMA_FATTN=ON \
45+ -DCMAKE_HIP_FLAGS="-I$(pwd)/rocwmma/library/include/" \
46+ -DAMDGPU_TARGETS="$ROCM_DOCKER_ARCH" \
47+ -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
48+ -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \
4449 && cmake --build build --config Release -j$(nproc)
4550
4651RUN mkdir -p /app/lib \
0 commit comments