mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-14 23:09:53 +00:00
Fixed dequant precision issues in Q4_1 and Q5_1 (#9711)
This commit is contained in:
parent
c83ad6d01e
commit
5639971466
@ -55,12 +55,12 @@ static __dpct_inline__ void dequantize_q4_1(const void *vx, const int64_t ib,
|
|||||||
#ifdef GGML_SYCL_F16
|
#ifdef GGML_SYCL_F16
|
||||||
// v = v * {d, d};
|
// v = v * {d, d};
|
||||||
// v = v + {m, m};
|
// v = v + {m, m};
|
||||||
v.s0() = (v.s0() * d) + m;
|
v.s0() = sycl::fma(v.s0(), d, m);
|
||||||
v.s1() = (v.s1() * d) + m;
|
v.s1() = sycl::fma(v.s1(), d, m);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
v.x() = (v.x() * d) + m;
|
v.x() = sycl::fma(v.x(), d, m);
|
||||||
v.y() = (v.y() * d) + m;
|
v.y() = sycl::fma(v.y(), d, m);
|
||||||
#endif // GGML_SYCL_F16
|
#endif // GGML_SYCL_F16
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,11 +110,11 @@ static __dpct_inline__ void dequantize_q5_1(const void *vx, const int64_t ib,
|
|||||||
#ifdef GGML_SYCL_F16
|
#ifdef GGML_SYCL_F16
|
||||||
// v = v * {d, d};
|
// v = v * {d, d};
|
||||||
// v = v + {m, m};
|
// v = v + {m, m};
|
||||||
v.s0() = (v.s0() * d) + m;
|
v.s0() = sycl::fma(v.s0(), d, m);
|
||||||
v.s1() = (v.s1() * d) + m;
|
v.s1() = sycl::fma(v.s1(), d, m);
|
||||||
#else
|
#else
|
||||||
v.x() = (v.x() * d) + m;
|
v.x() = sycl::fma(v.x(), d, m);
|
||||||
v.y() = (v.y() * d) + m;
|
v.y() = sycl::fma(v.y(), d, m);
|
||||||
#endif // GGML_SYCL_F16
|
#endif // GGML_SYCL_F16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user