Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ggml-quants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ mod tests {
type Blk = Q8_1; // 切换测试类型
Comment thread
YdrMaster marked this conversation as resolved.
Outdated
const N: usize = 32;

#[test]
fn test_block_accuracy() {
crate::test_utils::test::<N, Blk>(4e-3, 0.0);
}

#[test]
fn test_quant_dequant_slice_ok() {
let mut rng = rand::rng();
Expand Down
10 changes: 10 additions & 0 deletions ggml-quants/src/structs/half.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ impl Quantize<f32, _1> for bf16 {
[self.to_f32()]
}
}

#[test]
fn test_f16() {
crate::test_utils::test::<1, f16>(4e-3, 0.);
}

#[test]
fn test_bf16() {
crate::test_utils::test::<1, bf16>(8e-3, 0.);
}
Comment thread
YdrMaster marked this conversation as resolved.
Outdated
2 changes: 1 addition & 1 deletion ggml-quants/src/structs/q8_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ impl Quantize<f32, _32> for Q8_1 {

#[test]
fn test_q8_1() {
crate::test_utils::test::<32, Q8_1>(4e-3, 0.);
crate::test_utils::test::<32, Q8_1>(4.2e-3, 0.);
}
5 changes: 5 additions & 0 deletions ggml-quants/src/structs/q8_k.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ impl Quantize<f32, _256> for Q8K {
self.quants.map(|x| x as f32 * delta)
}
}

#[test]
fn test_q8_k() {
crate::test_utils::test::<256, Q8K>(4.5e-3, 0.);
}