mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-06-30 04:45:17 +00:00
imatrix : don't use FMA explicitly
This should make comparisons between the formats easier because this matches the behavior of the previous version.
This commit is contained in:
@ -180,7 +180,7 @@ bool IMatrixCollector::collect_imatrix(struct ggml_tensor * t, bool ask, void *
|
|||||||
e.counts[ex]++;
|
e.counts[ex]++;
|
||||||
|
|
||||||
for (int j = 0; j < (int)src1->ne[0]; ++j) {
|
for (int j = 0; j < (int)src1->ne[0]; ++j) {
|
||||||
e.values[e_start + j] = std::fma(x[j], x[j], e.values[e_start + j]);
|
e.values[e_start + j] += x[j] * x[j];
|
||||||
if (!std::isfinite((float)e.values[e_start + j])) {
|
if (!std::isfinite((float)e.values[e_start + j])) {
|
||||||
LOG_ERR("%f detected in %s\n", (float)e.values[e_start + j], wname.c_str());
|
LOG_ERR("%f detected in %s\n", (float)e.values[e_start + j], wname.c_str());
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -220,7 +220,7 @@ bool IMatrixCollector::collect_imatrix(struct ggml_tensor * t, bool ask, void *
|
|||||||
const float * x = (const float *) (data + row * src1->nb[1]);
|
const float * x = (const float *) (data + row * src1->nb[1]);
|
||||||
e.counts[0]++;
|
e.counts[0]++;
|
||||||
for (int j = 0; j < (int)src1->ne[0]; ++j) {
|
for (int j = 0; j < (int)src1->ne[0]; ++j) {
|
||||||
e.values[j] = std::fma(x[j], x[j], e.values[j]);
|
e.values[j] += x[j] * x[j];
|
||||||
if (!std::isfinite((float)e.values[j])) {
|
if (!std::isfinite((float)e.values[j])) {
|
||||||
LOG_ERR("%f detected in %s\n", (float)e.values[j], wname.c_str());
|
LOG_ERR("%f detected in %s\n", (float)e.values[j], wname.c_str());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user