Revert GELU change
Seems it does not work on x86 for some reason
This commit is contained in:
parent
b81a81d543
commit
91632eb6ea
20
ggml.c
20
ggml.c
@ -723,21 +723,21 @@ inline static void ggml_vec_gelu_f16(const int n, ggml_fp16_t * y, const ggml_fp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void ggml_vec_gelu_f32(const int n, float * y, const float * x) {
|
|
||||||
uint16_t t;
|
|
||||||
for (int i = 0; i < n; ++i) {
|
|
||||||
ggml_fp16_t fp16 = ggml_fp32_to_fp16(x[i]);
|
|
||||||
memcpy(&t, &fp16, sizeof(uint16_t));
|
|
||||||
y[i] = table_gelu_f16[t];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//inline static void ggml_vec_gelu_f32(const int n, float * y, const float * x) {
|
//inline static void ggml_vec_gelu_f32(const int n, float * y, const float * x) {
|
||||||
|
// uint16_t t;
|
||||||
// for (int i = 0; i < n; ++i) {
|
// for (int i = 0; i < n; ++i) {
|
||||||
// y[i] = ggml_gelu_f32(x[i]);
|
// ggml_fp16_t fp16 = ggml_fp32_to_fp16(x[i]);
|
||||||
|
// memcpy(&t, &fp16, sizeof(uint16_t));
|
||||||
|
// y[i] = table_gelu_f16[t];
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
inline static void ggml_vec_gelu_f32(const int n, float * y, const float * x) {
|
||||||
|
for (int i = 0; i < n; ++i) {
|
||||||
|
y[i] = ggml_gelu_f32(x[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline static void ggml_vec_sum_f32 (const int n, float * s, const float * x) { ggml_float sum = 0.0; for (int i = 0; i < n; ++i) sum += x[i]; *s += sum; }
|
inline static void ggml_vec_sum_f32 (const int n, float * s, const float * x) { ggml_float sum = 0.0; for (int i = 0; i < n; ++i) sum += x[i]; *s += sum; }
|
||||||
inline static void ggml_vec_norm_inv_f32(const int n, float * s, const float * x) { ggml_vec_norm_f32(n, s, x); *s = 1./(*s); }
|
inline static void ggml_vec_norm_inv_f32(const int n, float * s, const float * x) { ggml_vec_norm_f32(n, s, x); *s = 1./(*s); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user