Skip to content

LLM inference in C/C++

C++ ggml

ci: fix flaky ADD_ADD f16 by using the fused ADD tolerance (#29904)

Pascala55e952b8574
diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp
index 5c7f61a78b..37d3ef086b 100644
--- a/tests/test-backend-ops.cpp
+++ b/tests/test-backend-ops.cpp
@@ -3913,6 +3913,17 @@ struct test_add_add : public test_case {
return out;
}
+
+ double max_nmse_err() override {
+ // Fused ADDs can keep FP32 intermediates while the CPU rounds each ADD to FP16/BF16.
+ if (type == GGML_TYPE_F16) {
+ return 1e-6;
+ }
+ if (type == GGML_TYPE_BF16) {
+ return 1e-4;
+ }
+ return test_case::max_nmse_err();
+ }
};
// GGML_OP_ADD + GGML_OP_RMS_NORM (fused operation)