Compare commits

..

16 Commits

Author SHA1 Message Date
James Ravenscroft
77cde95cb9 remove deprecated cuda dockerfiles 2023-08-26 14:17:31 +01:00
James Ravenscroft
bea7ebdb34 correct runtime libs for openblas and clblast 2023-08-26 14:16:39 +01:00
James Ravenscroft
812bbea9d7 correct typo with clblast 2023-08-26 13:53:26 +01:00
James Ravenscroft
08e8834390 add changes to dockerfile 2023-08-26 13:51:50 +01:00
James Ravenscroft
25680e64d8 remove all the quotes 2023-08-26 13:43:33 +01:00
James Ravenscroft
dca25d8456 remove quotes 2023-08-26 13:42:11 +01:00
James Ravenscroft
1f6f84a783 add quotes to args 2023-08-26 13:39:02 +01:00
James Ravenscroft
0183b30502 always use ubuntu 22.04 2023-08-26 13:32:01 +01:00
James Ravenscroft
b465eae818 break out vars 2023-08-26 13:28:08 +01:00
James Ravenscroft
e8adff5339 try again 2023-08-26 13:22:09 +01:00
James Ravenscroft
f12dacaa15 read the readme properly 2023-08-26 13:16:34 +01:00
James Ravenscroft
0b0b914f92 add commas? 2023-08-26 13:12:27 +01:00
James Ravenscroft
b21dd0799d fix basenames 2023-08-26 13:10:23 +01:00
James Ravenscroft
c73c196364 build nvidia with default dockerfile 2023-08-26 13:08:19 +01:00
James Ravenscroft
30834e3121 remove brew update to prevent python breaking build 2023-08-26 12:58:02 +01:00
James Ravenscroft
39c3182a3a try to fix build args 2023-08-26 12:57:00 +01:00
5 changed files with 75 additions and 96 deletions

View File

@ -25,7 +25,6 @@ jobs:
- name: Dependencies
id: depends
run: |
brew update
brew install cmake boost asio
- name: Build
id: make_build

View File

@ -16,18 +16,52 @@ jobs:
strategy:
matrix:
config:
- {tag: "", dockerfile: "./Dockerfile.default", platforms: "linux/amd64,linux/arm64", build_args: [] }
- {
tag: "openblas",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64,linux/arm64",
build_args: [
"EXTRA_DEPS=libopenblas-dev",
"CMAKE_ARGS=\"-DGGML_OPENBLAS=On\""
]
}
- {tag: "-cuda11", dockerfile: "./Dockerfile.cuda11", platforms: "linux/amd64", build_args: [] }
- {tag: "-cuda12", dockerfile: "./Dockerfile.cuda12", platforms: "linux/amd64", build_args: [] }
- tag:
dockerfile: ./Dockerfile.default
platforms: linux/amd64,linux/arm64
build_base: ubuntu:22.04
runtime_base: ubuntu:22.04
- tag: -openblas
dockerfile: ./Dockerfile.default
platforms: linux/amd64,linux/arm64
build_base: ubuntu:22.04
runtime_base: ubuntu:22.04
extra_deps: libopenblas-dev
cmake_args: -DGGML_OPENBLAS=On
- tag: -cuda11-7
dockerfile: ./Dockerfile.default
platforms: linux/amd64
build_base: nvidia/cuda:11.7.1-devel-ubuntu22.04
runtime_base: nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04
cmake_args: -DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
- tag: -cuda12-0
dockerfile: ./Dockerfile.default
platforms: linux/amd64
build_base: nvidia/cuda:12.0.0-devel-ubuntu22.04
runtime_base: nvidia/cuda:12.0.0-runtime-ubuntu22.04
cmake_args: -DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
- tag: -cuda12-2
dockerfile: ./Dockerfile.default
platforms: linux/amd64
build_base: nvidia/cuda:12.2.0-devel-ubuntu22.04
runtime_base: nvidia/cuda:12.2.0-runtime-ubuntu22.04
cmake_args: -DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
- tag: -clblast
dockerfile: ./Dockerfile.default
platforms: linux/amd64
build_base: ubuntu:22.04
runtime_base: ubuntu:22.04
runtime_deps: libclblast1
extra_deps: libclblast-dev
cmake_args: -DGGML_CLBLAST=On
steps:
@ -54,7 +88,7 @@ jobs:
password: ${{ secrets.GH_TOKEN }}
- name: Build and push incremental
uses: docker/build-push-action@v4
uses: docker/build-push-action@v4.1.1
if: (!startsWith(github.ref, 'refs/tags/'))
with:
file: ${{matrix.config.dockerfile}}
@ -62,8 +96,12 @@ jobs:
tags: ghcr.io/ravenscroftj/turbopilot:nightly${{matrix.config.tag}}-${{ github.sha }}
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}
build-args: |
EXTRA_DEPS=${{matrix.config.extra_deps}}
CMAKE_ARGS=${{matrix.config.cmake_args}}
BUILD_BASE=${{matrix.config.build_base}}
RUNTIME_BASE=${{matrix.config.runtime_base}}
RUNTIME_DEPS=${{matrix.config.runtime_deps}}
- name: Build and push release (Main Latest Build)
@ -75,7 +113,11 @@ jobs:
tags: ghcr.io/ravenscroftj/turbopilot:${{ github.ref_name }}, ghcr.io/ravenscroftj/turbopilot:latest
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}
build-args: |
EXTRA_DEPS="${{matrix.config.extra_deps}}"
CMAKE_ARGS="${{matrix.config.cmake_args}}"
BUILD_BASE="${{matrix.config.build_base}}"
RUNTIME_BASE="${{matrix.config.runtime_base}}"
- name: Build and push release (Accelerated Builds)
@ -87,4 +129,8 @@ jobs:
tags: ghcr.io/ravenscroftj/turbopilot:${{ github.ref_name }}${{matrix.config.tag}}
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}
build-args: |
EXTRA_DEPS="${{matrix.config.extra_deps}}"
CMAKE_ARGS="${{matrix.config.cmake_args}}"
BUILD_BASE="${{matrix.config.build_base}}"
RUNTIME_BASE="${{matrix.config.runtime_base}}"

View File

@ -1,39 +0,0 @@
FROM nvidia/cuda:11.7.1-devel-ubuntu22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
# inlude kitware apt repo to allow us to grab latest cmake
RUN apt-get update && apt-get install ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev libboost-thread-dev
ADD ./ /turbopilot
RUN mkdir /turbopilot/build
WORKDIR /turbopilot/build
RUN cmake -DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc ..
RUN make turbopilot
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04 AS runtime
WORKDIR /app
COPY --from=build /turbopilot/build/bin/turbopilot /app/turbopilot
ENV THREADS=4
ENV MODEL="/models/codegen-2B-multi-ggml-4bit-quant.bin"
ENV BATCHSIZE=64
COPY ./run.sh /app/
EXPOSE 18080
CMD /app/run.sh

View File

@ -1,37 +0,0 @@
FROM nvidia/cuda:12.2.0-devel-ubuntu20.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
# inlude kitware apt repo to allow us to grab latest cmake
RUN apt-get update && apt-get install ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev libboost-thread-dev
ADD ./ /turbopilot
RUN mkdir /turbopilot/build
WORKDIR /turbopilot/build
RUN cmake -DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc ..
RUN make turbopilot
FROM nvidia/cuda:12.2.0-runtime-ubuntu20.04 AS runtime
WORKDIR /app
COPY --from=build /turbopilot/build/bin/turbopilot /app/turbopilot
ENV THREADS=4
ENV MODEL="/models/codegen-2B-multi-ggml-4bit-quant.bin"
ENV BATCHSIZE=64
COPY ./run.sh /app/
EXPOSE 18080
CMD /app/run.sh

View File

@ -1,7 +1,13 @@
ARG BUILD_BASE="ubuntu:22.04"
ARG RUNTIME_BASE="ubuntu:22.04"
FROM ${BUILD_BASE} AS build
ARG EXTRA_DEPS=""
ARG CMAKE_ARGS=""
FROM ubuntu:22.04 AS build
RUN echo "CMAKE_ARGS: ${CMAKE_ARGS}"
RUN echo "EXTRA_DEPS: ${EXTRA_DEPS}"
ENV DEBIAN_FRONTEND=noninteractive
@ -21,7 +27,11 @@ WORKDIR /turbopilot/build
RUN cmake .. ${CMAKE_ARGS}
RUN make turbopilot
FROM ubuntu:22.04 AS runtime
FROM ${RUNTIME_BASE} AS runtime
ARG RUNTIME_DEPS=""
RUN if [[ -z "${RUNTIME_DEPS}" ]] ; then echo "No runtime libs required" ; else apt-get update && apt-get install -y ${RUNTIME_DEPS} ; fi
WORKDIR /app