From adad61ece40a96489f6bfa10153a539ef5c9298d Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Tue, 3 Dec 2024 07:28:08 +0000 Subject: [PATCH 1/2] feat: use kompute backend for apple silicon Signed-off-by: Sertac Ozercan --- Dockerfile.base-applesilicon | 9 ++++----- pkg/aikit2llb/inference/convert.go | 3 ++- pkg/utils/const.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile.base-applesilicon b/Dockerfile.base-applesilicon index 64595de9..61232586 100644 --- a/Dockerfile.base-applesilicon +++ b/Dockerfile.base-applesilicon @@ -1,13 +1,12 @@ -FROM fedora:39@sha256:d63d63fe593749a5e8dbc8152427d40bbe0ece53d884e00e5f3b44859efa5077 +FROM fedora:41@sha256:3ec60eb34fa1a095c0c34dd37cead9fd38afb62612d43892fcf1d3425c32bc1e -ARG MESA_VERSION="23.3.5-102" +ARG MESA_VERSION="24.1.2-101" USER 0 # Install the patched mesa-krunkit drivers RUN dnf -y install dnf-plugins-core && \ - dnf -y copr enable slp/mesa-krunkit && \ + dnf -y copr enable slp/mesa-krunkit epel-9-aarch64 && \ dnf -y install \ - mesa-vulkan-drivers-$MESA_VERSION \ - vulkan-loader-devel vulkan-tools vulkan-loader && \ + mesa-vulkan-drivers-$MESA_VERSION.el9.aarch64 && \ dnf clean all diff --git a/pkg/aikit2llb/inference/convert.go b/pkg/aikit2llb/inference/convert.go index 374a91e6..f8a665eb 100644 --- a/pkg/aikit2llb/inference/convert.go +++ b/pkg/aikit2llb/inference/convert.go @@ -15,6 +15,7 @@ const ( distrolessBase = "ghcr.io/sozercan/base:latest" localAIRepo = "https://github.com/mudler/LocalAI" localAIVersion = "v2.23.0" + localAICommit = "2859433" cudaVersion = "12-5" ) @@ -158,7 +159,7 @@ func installCuda(c *config.InferenceConfig, s llb.State, merge llb.State) (llb.S func addLocalAI(c *config.InferenceConfig, s llb.State, merge llb.State, platform specs.Platform) (llb.State, llb.State, error) { var localAIURL string if c.Runtime == utils.RuntimeAppleSilicon { - localAIURL = fmt.Sprintf("https://sertacstoragevs.blob.core.windows.net/localai/%[1]s/vulkan/local-ai", localAIVersion) + localAIURL = fmt.Sprintf("https://sertaccdnvs.azureedge.net/localai/%[1]s/kompute/local-ai", localAICommit) } else { binaryNames := map[string]string{ utils.PlatformAMD64: "local-ai-Linux-x86_64", diff --git a/pkg/utils/const.go b/pkg/utils/const.go index f8ece0c1..8e10349e 100644 --- a/pkg/utils/const.go +++ b/pkg/utils/const.go @@ -16,7 +16,7 @@ const ( APIv1alpha1 = "v1alpha1" UbuntuBase = "docker.io/library/ubuntu:22.04" - AppleSiliconBase = "ghcr.io/sozercan/applesilicon/base:latest" + AppleSiliconBase = "docker.io/sozercan/base:applesilicon" CudaDevel = "nvcr.io/nvidia/cuda:12.3.2-devel-ubuntu22.04" PlatformLinux = "linux" From 59519a67d982d6b92eded1e743f909282de40bec Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Mon, 9 Dec 2024 07:30:42 +0000 Subject: [PATCH 2/2] update base Signed-off-by: Sertac Ozercan --- pkg/utils/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/const.go b/pkg/utils/const.go index 8e10349e..f8ece0c1 100644 --- a/pkg/utils/const.go +++ b/pkg/utils/const.go @@ -16,7 +16,7 @@ const ( APIv1alpha1 = "v1alpha1" UbuntuBase = "docker.io/library/ubuntu:22.04" - AppleSiliconBase = "docker.io/sozercan/base:applesilicon" + AppleSiliconBase = "ghcr.io/sozercan/applesilicon/base:latest" CudaDevel = "nvcr.io/nvidia/cuda:12.3.2-devel-ubuntu22.04" PlatformLinux = "linux"