Skip to content

Commit

Permalink
Update ggml-sys-bleedingedge, add k_quants
Browse files Browse the repository at this point in the history
  • Loading branch information
KerfuffleV2 committed Jun 16, 2023
1 parent 8bb3a71 commit c82019b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 16 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c82019b

Please sign in to comment.