2024-01-28 07:55:31 +00:00
|
|
|
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
|
|
|
|
|
2024-07-17 18:21:55 +00:00
|
|
|
FROM ${BASE_ROCM_DEV_CONTAINER} AS build
|
2024-01-28 07:55:31 +00:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
ARG ROCM_DOCKER_ARCH=\
|
|
|
|
gfx803 \
|
|
|
|
gfx900 \
|
|
|
|
gfx906 \
|
|
|
|
gfx908 \
|
|
|
|
gfx90a \
|
|
|
|
gfx1010 \
|
|
|
|
gfx1030 \
|
|
|
|
gfx1100 \
|
|
|
|
gfx1101 \
|
|
|
|
gfx1102
|
|
|
|
|
|
|
|
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
|
|
|
|
ENV GPU_TARGETS=${ROCM_DOCKER_ARCH}
|
|
|
|
# Enable ROCm
|
2024-06-26 16:32:07 +00:00
|
|
|
ENV GGML_HIPBLAS=1
|
2024-01-28 07:55:31 +00:00
|
|
|
ENV CC=/opt/rocm/llvm/bin/clang
|
|
|
|
ENV CXX=/opt/rocm/llvm/bin/clang++
|
2024-08-27 09:07:01 +00:00
|
|
|
# Must be set to 0.0.0.0 so it can listen to requests from host machine
|
|
|
|
ENV LLAMA_ARG_HOST=0.0.0.0
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-04-04 16:31:22 +00:00
|
|
|
# Enable cURL
|
|
|
|
ENV LLAMA_CURL=1
|
|
|
|
RUN apt-get update && \
|
2024-06-25 15:13:27 +00:00
|
|
|
apt-get install -y libcurl4-openssl-dev curl
|
2024-04-04 16:31:22 +00:00
|
|
|
|
2024-06-12 23:41:52 +00:00
|
|
|
RUN make -j$(nproc) llama-server
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-06-25 15:13:27 +00:00
|
|
|
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
|
|
|
|
|
2024-06-12 23:41:52 +00:00
|
|
|
ENTRYPOINT [ "/app/llama-server" ]
|