From 80e09e9b1ff23c05723633c17cbc3786d4a8e516 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 11 Dec 2024 13:18:18 +0100 Subject: [PATCH] teflon/tests: Divide the tolerance level by a constant A final tolerance of 0.6 seems to be about right for big models with per-channel quantization. Part-of: --- src/gallium/targets/teflon/test_teflon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/targets/teflon/test_teflon.cpp b/src/gallium/targets/teflon/test_teflon.cpp index bdc18620330..5465ed13a3e 100644 --- a/src/gallium/targets/teflon/test_teflon.cpp +++ b/src/gallium/targets/teflon/test_teflon.cpp @@ -67,7 +67,7 @@ test_model(void *buf, size_t buf_size, std::string cache_dir, unsigned tolerance case kTfLiteFloat32: { float *cpu = ((float**)cpu_output)[i]; float *npu = ((float**)npu_output)[i]; - if (abs(cpu[j] - npu[j]) > tolerance) { + if (abs(cpu[j] - npu[j]) > tolerance / 33.0) { std::cout << "CPU: "; for (int k = 0; k < std::min(int(output_sizes[i]), 24); k++) std::cout << std::setfill('0') << std::setw(6) << cpu[k] << " ";