From 05a6fdeda673163281ceed18bdb07f14f219ce2d Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 31 Jul 2024 10:45:59 -0400 Subject: [PATCH] feat: provide CUDA image for AMD64 (#37) * feat: provide CUDA image for AMD64 Fixes #36 Signed-off-by: Jeff MAURY * fix: apply reviews from @benoitf and @lstocchi Signed-off-by: Jeff MAURY --- .github/workflows/build-publish.yaml | 3 +++ .github/workflows/pr-check.yaml | 3 +++ .github/workflows/release.yaml | 3 +++ chat/cuda/amd64/Containerfile | 27 +++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 chat/cuda/amd64/Containerfile diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 49c89ee..28f6ae1 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -40,6 +40,9 @@ jobs: - containerfile: "./chat/vulkan/arm64/Containerfile" build-image-name: "ai-lab-playground-chat-vulkan" archs: arm64 + - containerfile: "./chat/cuda/amd64/Containerfile" + build-image-name: "ai-lab-playground-chat-cuda" + archs: amd64 fail-fast: false steps: diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index e76bcf4..85e2125 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -36,6 +36,9 @@ jobs: - containerfile: "./chat/vulkan/arm64/Containerfile" build-image-name: "ai-lab-playground-chat-vulkan" archs: arm64 + - containerfile: "./chat/cuda/amd64/Containerfile" + build-image-name: "ai-lab-playground-chat-cuda" + archs: amd64 fail-fast: false steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 205fea4..fa24fc0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,6 +47,9 @@ jobs: - containerfile: "./chat/vulkan/arm64/Containerfile" build-image-name: "ai-lab-playground-chat-vulkan" archs: arm64 + - containerfile: "./chat/cuda/amd64/Containerfile" + build-image-name: "ai-lab-playground-chat-cuda" + archs: amd64 steps: - uses: actions/checkout@v4 with: diff --git a/chat/cuda/amd64/Containerfile b/chat/cuda/amd64/Containerfile new file mode 100644 index 0000000..86d94c3 --- /dev/null +++ b/chat/cuda/amd64/Containerfile @@ -0,0 +1,27 @@ +# +# Copyright (C) 2024 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +FROM quay.io/opendatahub/workbench-images:cuda-ubi9-python-3.9-20231206 +USER root +RUN dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ +USER 1001 +WORKDIR /locallm +COPY requirements.txt . +COPY run.sh . +ENV CMAKE_ARGS="-DGGML_CUDA=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF" +ENV FORCE_CMAKE=1 +RUN CC="/opt/rh/gcc-toolset-13/root/usr/bin/gcc" CXX="/opt/rh/gcc-toolset-13/root/usr/bin/g++" pip install --no-cache-dir -r ./requirements.txt +ENTRYPOINT [ "sh", "run.sh" ]