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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34481>
This commit is contained in:
Tomeu Vizoso
2024-12-11 13:18:18 +01:00
committed by Marge Bot
parent 15a8c49ad5
commit 80e09e9b1f
+1 -1
View File
@@ -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] << " ";