mirror of
https://github.com/likelovewant/ollama-for-amd.git
synced 2025-12-22 06:43:57 +00:00
Remove unnecessary MacOs 13 and lower Patches (#12656)
* Remove unnecessary macos 13 Patch * Remove unnecessary MacOs Version Guard patch * rename patchesw * remove again macos13 patch * rename files
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Hiltgen <daniel@ollama.com>
|
|
||||||
Date: Wed, 30 Jul 2025 08:43:46 -0700
|
|
||||||
Subject: [PATCH] BF16 macos version guard
|
|
||||||
|
|
||||||
Only enable BF16 on supported MacOS versions (v14+)
|
|
||||||
---
|
|
||||||
ggml/src/ggml-metal/ggml-metal-context.m | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/ggml/src/ggml-metal/ggml-metal-context.m b/ggml/src/ggml-metal/ggml-metal-context.m
|
|
||||||
index 052efb7ac..b47dc7879 100644
|
|
||||||
--- a/ggml/src/ggml-metal/ggml-metal-context.m
|
|
||||||
+++ b/ggml/src/ggml-metal/ggml-metal-context.m
|
|
||||||
@@ -125,7 +125,12 @@ ggml_metal_t ggml_metal_init(ggml_metal_device_t dev) {
|
|
||||||
|
|
||||||
res->d_queue = dispatch_queue_create("ggml-metal", DISPATCH_QUEUE_CONCURRENT);
|
|
||||||
|
|
||||||
- res->use_bfloat = props_dev->has_bfloat;
|
|
||||||
+ if (@available(macOS 14.0, *)) {
|
|
||||||
+ res->use_bfloat = props_dev->has_bfloat;
|
|
||||||
+ } else {
|
|
||||||
+ res->use_bfloat = false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
res->use_fusion = getenv("GGML_METAL_FUSION_DISABLE") == nil;
|
|
||||||
res->use_concurrency = getenv("GGML_METAL_CONCURRENCY_DISABLE") == nil;
|
|
||||||
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Hiltgen <daniel@ollama.com>
|
|
||||||
Date: Sun, 3 Aug 2025 10:00:20 -0700
|
|
||||||
Subject: [PATCH] Disable ggml-blas on macos v13 and older
|
|
||||||
|
|
||||||
---
|
|
||||||
ggml/src/ggml-blas/ggml-blas.cpp | 5 +++++
|
|
||||||
1 file changed, 5 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/ggml/src/ggml-blas/ggml-blas.cpp b/ggml/src/ggml-blas/ggml-blas.cpp
|
|
||||||
index 88d088952..6a38a51a2 100644
|
|
||||||
--- a/ggml/src/ggml-blas/ggml-blas.cpp
|
|
||||||
+++ b/ggml/src/ggml-blas/ggml-blas.cpp
|
|
||||||
@@ -507,6 +507,11 @@ static const struct ggml_backend_reg_i ggml_backend_blas_reg_i = {
|
|
||||||
};
|
|
||||||
|
|
||||||
ggml_backend_reg_t ggml_backend_blas_reg(void) {
|
|
||||||
+ // MacOS prior to v14 does not include cblas_sgemm - disable this backend if it isn't available
|
|
||||||
+ if (&cblas_sgemm == NULL) {
|
|
||||||
+ GGML_LOG_INFO("Disabling ggml-blas backend on old MacOS version\n");
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
static struct ggml_backend_reg ggml_backend_blas_reg = {
|
|
||||||
/* .api_version = */ GGML_BACKEND_API_VERSION,
|
|
||||||
/* .iface = */ ggml_backend_blas_reg_i,
|
|
||||||
@@ -507,11 +507,6 @@ static const struct ggml_backend_reg_i ggml_backend_blas_reg_i = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ggml_backend_reg_t ggml_backend_blas_reg(void) {
|
ggml_backend_reg_t ggml_backend_blas_reg(void) {
|
||||||
// MacOS prior to v14 does not include cblas_sgemm - disable this backend if it isn't available
|
|
||||||
if (&cblas_sgemm == NULL) {
|
|
||||||
GGML_LOG_INFO("Disabling ggml-blas backend on old MacOS version\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
static struct ggml_backend_reg ggml_backend_blas_reg = {
|
static struct ggml_backend_reg ggml_backend_blas_reg = {
|
||||||
/* .api_version = */ GGML_BACKEND_API_VERSION,
|
/* .api_version = */ GGML_BACKEND_API_VERSION,
|
||||||
/* .iface = */ ggml_backend_blas_reg_i,
|
/* .iface = */ ggml_backend_blas_reg_i,
|
||||||
|
|||||||
@@ -125,12 +125,7 @@ ggml_metal_t ggml_metal_init(ggml_metal_device_t dev) {
|
|||||||
|
|
||||||
res->d_queue = dispatch_queue_create("ggml-metal", DISPATCH_QUEUE_CONCURRENT);
|
res->d_queue = dispatch_queue_create("ggml-metal", DISPATCH_QUEUE_CONCURRENT);
|
||||||
|
|
||||||
if (@available(macOS 14.0, *)) {
|
res->use_bfloat = props_dev->has_bfloat;
|
||||||
res->use_bfloat = props_dev->has_bfloat;
|
|
||||||
} else {
|
|
||||||
res->use_bfloat = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
res->use_fusion = getenv("GGML_METAL_FUSION_DISABLE") == nil;
|
res->use_fusion = getenv("GGML_METAL_FUSION_DISABLE") == nil;
|
||||||
res->use_concurrency = getenv("GGML_METAL_CONCURRENCY_DISABLE") == nil;
|
res->use_concurrency = getenv("GGML_METAL_CONCURRENCY_DISABLE") == nil;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user