From 04c99e882cb0e499daab00f2b6daaa87ec9f7f62 Mon Sep 17 00:00:00 2001 From: Alex Azarov Date: Sat, 13 Jan 2024 23:31:11 +0100 Subject: [PATCH 1/2] Correctly set support_simdgroup_reduction and support_simdgroup_mm on iPhone/iPad --- ggml-metal.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ggml-metal.m b/ggml-metal.m index cae52c9830cb2..f44f616f92c4c 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -330,7 +330,6 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){ } } -#if TARGET_OS_OSX // print MTL GPU family: GGML_METAL_LOG_INFO("%s: GPU name: %s\n", __func__, [[ctx->device name] UTF8String]); @@ -366,7 +365,7 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){ ctx->support_simdgroup_reduction |= [ctx->device supportsFamily:MTLGPUFamilyMetal3]; ctx->support_simdgroup_mm = [ctx->device supportsFamily:MTLGPUFamilyApple7]; - +#if TARGET_OS_OSX GGML_METAL_LOG_INFO("%s: simdgroup reduction support = %s\n", __func__, ctx->support_simdgroup_reduction ? "true" : "false"); GGML_METAL_LOG_INFO("%s: simdgroup matrix mul. support = %s\n", __func__, ctx->support_simdgroup_mm ? "true" : "false"); GGML_METAL_LOG_INFO("%s: hasUnifiedMemory = %s\n", __func__, ctx->device.hasUnifiedMemory ? "true" : "false"); From d7c078c416d55f247de29cd033587b9d228339e9 Mon Sep 17 00:00:00 2001 From: Alex Azarov Date: Sun, 14 Jan 2024 00:22:39 +0100 Subject: [PATCH 2/2] log a little bit more info on iOS --- ggml-metal.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml-metal.m b/ggml-metal.m index f44f616f92c4c..2ca726055f9ea 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -365,10 +365,11 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){ ctx->support_simdgroup_reduction |= [ctx->device supportsFamily:MTLGPUFamilyMetal3]; ctx->support_simdgroup_mm = [ctx->device supportsFamily:MTLGPUFamilyApple7]; -#if TARGET_OS_OSX + GGML_METAL_LOG_INFO("%s: simdgroup reduction support = %s\n", __func__, ctx->support_simdgroup_reduction ? "true" : "false"); GGML_METAL_LOG_INFO("%s: simdgroup matrix mul. support = %s\n", __func__, ctx->support_simdgroup_mm ? "true" : "false"); GGML_METAL_LOG_INFO("%s: hasUnifiedMemory = %s\n", __func__, ctx->device.hasUnifiedMemory ? "true" : "false"); +#if TARGET_OS_OSX GGML_METAL_LOG_INFO("%s: recommendedMaxWorkingSetSize = %8.2f MB\n", __func__, ctx->device.recommendedMaxWorkingSetSize / 1e6); if (ctx->device.maxTransferRate != 0) { GGML_METAL_LOG_INFO("%s: maxTransferRate = %8.2f MB/s\n", __func__, ctx->device.maxTransferRate / 1e6);