Skip to content

Commit

Permalink
Change RMSNorm eps to 1e-6 (ggerganov#173)
Browse files Browse the repository at this point in the history
I think this is what is used in the Python code
  • Loading branch information
ggerganov committed Mar 19, 2023
1 parent d7def1a commit 22213a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -5556,7 +5556,7 @@ static void ggml_compute_forward_rms_norm_f32(
const size_t nb2 = dst->nb[2];
const size_t nb3 = dst->nb[3];

const ggml_float eps = 1e-5f; // TODO: make this a parameter
const ggml_float eps = 1e-6f; // TODO: make this a parameter

// TODO: optimize
for (int i03 = 0; i03 < ne03; i03++) {
Expand All @@ -5572,7 +5572,7 @@ static void ggml_compute_forward_rms_norm_f32(
mean /= ne00;

float * y = (float *) ((char *) dst->data + i01*nb1 + i02*nb2 + i03*nb3);

memcpy(y, x, ne00 * sizeof(float));
// for (int i00 = 0; i00 < ne00; i00++) {
// y[i00] = x[i00];
Expand Down

0 comments on commit 22213a1

Please sign in to comment.