From c82019b2dc7387514f5714bb500abfe4be6de367 Mon Sep 17 00:00:00 2001 From: KerfuffleV2 Date: Fri, 16 Jun 2023 15:27:51 -0600 Subject: [PATCH] Update ggml-sys-bleedingedge, add k_quants --- Cargo.toml | 11 ++++++++++- src/util.rs | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d440025..bce3ead 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,17 @@ edition = "2021" license = "MIT" resolver = "2" +[features] +default = ["ggml-sys-bleedingedge/use_cmake"] +no_k_quants = ["ggml-sys-bleedingedge/no_k_quants"] +no_accelerate = ["ggml-sys-bleedingedge/no_accelerate"] +cublas = ["ggml-sys-bleedingedge/cublas"] +clblast = ["ggml-sys-bleedingedge/clblast"] +openblas = ["ggml-sys-bleedingedge/openblas"] +metal = ["ggml-sys-bleedingedge/metal"] + [dependencies] -ggml-sys-bleedingedge = "=2305030125.0.0" +ggml-sys-bleedingedge = "=2306162112.0.0" anyhow = "1" thiserror = "1" num-traits = "0.2" diff --git a/src/util.rs b/src/util.rs index c574e6a..81de489 100644 --- a/src/util.rs +++ b/src/util.rs @@ -26,15 +26,30 @@ pub enum GError { num_derive::ToPrimitive, )] /// GGML element type. Items starting with `Q` generally will be quantized. +#[allow(non_camel_case_types)] pub enum GType { F32 = gg::ggml_type_GGML_TYPE_F32, F16 = gg::ggml_type_GGML_TYPE_F16, Q4_0 = gg::ggml_type_GGML_TYPE_Q4_0, Q4_1 = gg::ggml_type_GGML_TYPE_Q4_1, - Q4_2 = gg::ggml_type_GGML_TYPE_Q4_2, Q5_0 = gg::ggml_type_GGML_TYPE_Q5_0, Q5_1 = gg::ggml_type_GGML_TYPE_Q5_1, Q8_0 = gg::ggml_type_GGML_TYPE_Q8_0, + /// Used internally, may not be available for (de)quantization. + Q8_1 = gg::ggml_type_GGML_TYPE_Q8_1, + #[cfg(not(feature = "no_k_quants"))] + Q2_K = gg::ggml_type_GGML_TYPE_Q2_K, + #[cfg(not(feature = "no_k_quants"))] + Q3_K = gg::ggml_type_GGML_TYPE_Q3_K, + #[cfg(not(feature = "no_k_quants"))] + Q4_K = gg::ggml_type_GGML_TYPE_Q4_K, + #[cfg(not(feature = "no_k_quants"))] + Q5_K = gg::ggml_type_GGML_TYPE_Q5_K, + #[cfg(not(feature = "no_k_quants"))] + Q6_K = gg::ggml_type_GGML_TYPE_Q6_K, + #[cfg(not(feature = "no_k_quants"))] + /// Used internally, may not be available for (de)quantization. + Q8_K = gg::ggml_type_GGML_TYPE_Q8_K, I8 = gg::ggml_type_GGML_TYPE_I8, I16 = gg::ggml_type_GGML_TYPE_I16, I32 = gg::ggml_type_GGML_TYPE_I32,