From ef15f9738576b128dc44482e72aba1cf2177d953 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 1 Mar 2024 14:34:31 -0800 Subject: [PATCH] fix(metal): fix metal build of tabby (#1601) --- .gitmodules | 2 +- crates/llama-cpp-bindings/build.rs | 4 ++++ crates/llama-cpp-bindings/llama.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index e150ac479..6f96885ce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "crates/llama-cpp-bindings/llama.cpp"] path = crates/llama-cpp-bindings/llama.cpp - url = https://github.com/TabbyML/llama.cpp + url = https://github.com/ggerganov/llama.cpp diff --git a/crates/llama-cpp-bindings/build.rs b/crates/llama-cpp-bindings/build.rs index bc00a56b1..bd6a63128 100644 --- a/crates/llama-cpp-bindings/build.rs +++ b/crates/llama-cpp-bindings/build.rs @@ -23,9 +23,13 @@ fn build_llama_cpp() { let mut config = Config::new("llama.cpp"); config.define("LLAMA_NATIVE", "OFF"); config.define("INS_ENB", "ON"); + if cfg!(not(debug_assertions)) { + config.define("CMAKE_BUILD_TYPE", "Release"); + } if cfg!(target_os = "macos") { config.define("LLAMA_METAL", "ON"); + config.define("LLAMA_METAL_EMBED_LIBRARY", "ON"); println!("cargo:rustc-link-lib=framework=Foundation"); println!("cargo:rustc-link-lib=framework=Accelerate"); println!("cargo:rustc-link-lib=framework=Metal"); diff --git a/crates/llama-cpp-bindings/llama.cpp b/crates/llama-cpp-bindings/llama.cpp index 807ee66db..c29af7e22 160000 --- a/crates/llama-cpp-bindings/llama.cpp +++ b/crates/llama-cpp-bindings/llama.cpp @@ -1 +1 @@ -Subproject commit 807ee66dbfb9e395362388a7cfb12684a41d1d09 +Subproject commit c29af7e2252d288f2ea58a7d437c1cb7c0abf160