Skip to content

Commit 980ab41

Browse files
authored
docker : add gpu image CI builds (#3103)
Enables the GPU enabled container images to be built and pushed alongside the CPU containers. Co-authored-by: canardleteer <[email protected]>
1 parent e394084 commit 980ab41

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ jobs:
2626
strategy:
2727
matrix:
2828
config:
29-
- { tag: "light", dockerfile: ".devops/main.Dockerfile" }
30-
- { tag: "full", dockerfile: ".devops/full.Dockerfile" }
29+
- { tag: "light", dockerfile: ".devops/main.Dockerfile", platforms: "linux/amd64,linux/arm64" }
30+
- { tag: "full", dockerfile: ".devops/full.Dockerfile", platforms: "linux/amd64,linux/arm64" }
31+
# NOTE(canardletter): The CUDA builds on arm64 are very slow, so I
32+
# have disabled them for now until the reason why
33+
# is understood.
34+
- { tag: "light-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platforms: "linux/amd64" }
35+
- { tag: "full-cuda", dockerfile: ".devops/full-cuda.Dockerfile", platforms: "linux/amd64" }
36+
- { tag: "light-rocm", dockerfile: ".devops/main-rocm.Dockerfile", platforms: "linux/amd64,linux/arm64" }
37+
- { tag: "full-rocm", dockerfile: ".devops/full-rocm.Dockerfile", platforms: "linux/amd64,linux/arm64" }
3138
steps:
3239
- name: Check out the repo
3340
uses: actions/checkout@v3
@@ -51,7 +58,7 @@ jobs:
5158
with:
5259
context: .
5360
push: true
54-
platforms: linux/amd64,linux/arm64
61+
platforms: ${{ matrix.config.platforms }}
5562
tags: "ghcr.io/ggerganov/llama.cpp:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
5663
file: ${{ matrix.config.dockerfile }}
5764

@@ -60,6 +67,6 @@ jobs:
6067
with:
6168
context: .
6269
push: ${{ github.event_name == 'push' }}
63-
platforms: linux/amd64,linux/arm64
70+
platforms: ${{ matrix.config.platforms }}
6471
tags: "ghcr.io/ggerganov/llama.cpp:${{ matrix.config.tag }}"
6572
file: ${{ matrix.config.dockerfile }}

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,17 @@ Place your desired model into the `~/llama.cpp/models/` directory and execute th
844844
#### Images
845845
We have two Docker images available for this project:
846846

847-
1. `ghcr.io/ggerganov/llama.cpp:full`: This image includes both the main executable file and the tools to convert LLaMA models into ggml and convert into 4-bit quantization.
848-
2. `ghcr.io/ggerganov/llama.cpp:light`: This image only includes the main executable file.
847+
1. `ghcr.io/ggerganov/llama.cpp:full`: This image includes both the main executable file and the tools to convert LLaMA models into ggml and convert into 4-bit quantization. (platforms: `linux/amd64`, `linux/arm64`)
848+
2. `ghcr.io/ggerganov/llama.cpp:light`: This image only includes the main executable file. (platforms: `linux/amd64`, `linux/arm64`)
849+
850+
Additionally, there the following images, similar to the above:
851+
852+
- `ghcr.io/ggerganov/llama.cpp:full-cuda`: Same as `full` but compiled with CUDA support. (platforms: `linux/amd64`)
853+
- `ghcr.io/ggerganov/llama.cpp:light-cuda`: Same as `light` but compiled with CUDA support. (platforms: `linux/amd64`)
854+
- `ghcr.io/ggerganov/llama.cpp:full-rocm`: Same as `full` but compiled with ROCm support. (platforms: `linux/amd64`, `linux/arm64`)
855+
- `ghcr.io/ggerganov/llama.cpp:light-rocm`: Same as `light` but compiled with ROCm support. (platforms: `linux/amd64`, `linux/arm64`)
856+
857+
The GPU enabled images are not currently tested by CI beyond being built. They are not built with any variation from the ones in the Dockerfiles defined in [.devops/](.devops/) and the Gitlab Action defined in [.github/workflows/docker.yml](.github/workflows/docker.yml). If you need different settings (for example, a different CUDA or ROCm library, you'll need to build the images locally for now).
849858
850859
#### Usage
851860

0 commit comments

Comments
 (0)