From b19adcd71f1586f59326c4101fab34bdcfe05dbe Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 18 Sep 2025 08:32:26 +0300 Subject: [PATCH] metal : handle nil cv during pipeline creation ggml-ci --- ggml/src/ggml-metal/ggml-metal-device.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-metal/ggml-metal-device.m b/ggml/src/ggml-metal/ggml-metal-device.m index 9983640b43eb8..4974bd15b97a9 100644 --- a/ggml/src/ggml-metal/ggml-metal-device.m +++ b/ggml/src/ggml-metal/ggml-metal-device.m @@ -327,12 +327,19 @@ ggml_metal_pipeline_t ggml_metal_library_compile_pipeline(ggml_metal_library_t l GGML_LOG_DEBUG("%s: compiling pipeline: base = '%s', name = '%s'\n", __func__, base, name); - id mtl_function = [lib->obj newFunctionWithName:base_func constantValues:(cv ? cv->obj : nil) error:&error]; + id mtl_function; + if (!cv) { + mtl_function = [lib->obj newFunctionWithName:base_func]; + } else { + mtl_function = [lib->obj newFunctionWithName:base_func constantValues:cv->obj error:&error]; + } if (!mtl_function) { ggml_critical_section_end(); GGML_LOG_ERROR("%s: error: failed to compile pipeline: base = '%s', name = '%s'\n", __func__, base, name); - GGML_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + if (error) { + GGML_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + } return nil; }