* ggml : add asserts
ggml-ci
* cont : fix constant type
Co-authored-by: Diego Devesa <redacted>
---------
Co-authored-by: Diego Devesa <redacted>
const float scale = 1.0f/sqrtf(mean + eps);
+ // if you hit this, likely you got an inf somewhere earlier
+ assert(scale > 0.0f);
+
ggml_vec_scale_f32(ne00, y, scale);
}
}
for (int i = np; i < n; ++i) {
sumf += (ggml_float)(GGML_CPU_FP16_TO_FP32(x[i])*GGML_CPU_FP16_TO_FP32(y[i]));
}
+
+ // if you hit this, you are likely running outside the FP range
+ assert(!isnan(sumf) && !isinf(sumf));
#else
for (int i = 0; i < n; ++i) {
sumf += (ggml_float)(GGML_CPU_FP16_TO_FP32(x[i])*GGML_CPU_FP16_TO_FP32(y[i]));