llama-cli-rocm.Dockerfile 1.01 KB
Newer Older
xuxzh1's avatar
init  
xuxzh1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
ARG UBUNTU_VERSION=22.04

# This needs to generally match the container host's environment.
ARG ROCM_VERSION=5.6

# Target the CUDA build image
ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete

FROM ${BASE_ROCM_DEV_CONTAINER} AS build

# Unless otherwise specified, we make a fat build.
# List from https://github.com/ggerganov/llama.cpp/pull/1087#issuecomment-1682807878
# This is mostly tied to rocBLAS supported archs.
xuxzh1's avatar
update  
xuxzh1 committed
14
ARG ROCM_DOCKER_ARCH="\
xuxzh1's avatar
init  
xuxzh1 committed
15
16
17
18
19
20
21
22
23
    gfx803 \
    gfx900 \
    gfx906 \
    gfx908 \
    gfx90a \
    gfx1010 \
    gfx1030 \
    gfx1100 \
    gfx1101 \
xuxzh1's avatar
update  
xuxzh1 committed
24
    gfx1102"
xuxzh1's avatar
init  
xuxzh1 committed
25
26
27
28
29
30
31
32
33
34
35
36

COPY requirements.txt   requirements.txt
COPY requirements       requirements

RUN pip install --upgrade pip setuptools wheel \
    && pip install -r requirements.txt

WORKDIR /app

COPY . .

# Set nvcc architecture
xuxzh1's avatar
update  
xuxzh1 committed
37
ENV AMDGPU_TARGETS=${ROCM_DOCKER_ARCH}
xuxzh1's avatar
init  
xuxzh1 committed
38
39
40
41
42
43
44
45
# Enable ROCm
ENV GGML_HIPBLAS=1
ENV CC=/opt/rocm/llvm/bin/clang
ENV CXX=/opt/rocm/llvm/bin/clang++

RUN make -j$(nproc) llama-cli

ENTRYPOINT [ "/app/llama-cli" ]