mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-02 14:54:35 +00:00
Fixes for norm.
This commit is contained in:
parent
06d4b21598
commit
32289aa447
@ -56,7 +56,7 @@ void main() {
|
|||||||
const float mean = sum[0];
|
const float mean = sum[0];
|
||||||
|
|
||||||
// recenter
|
// recenter
|
||||||
const uint y = (gl_WorkGroupID.x*pcs.ne00/4) + pcs.outOff; // Based from out_
|
const uint y = (gl_WorkGroupID.x*pcs.ne00) + pcs.outOff; // Based from out_
|
||||||
for (uint i00 = gl_LocalInvocationID.x; i00 < pcs.ne00; i00 += nth) {
|
for (uint i00 = gl_LocalInvocationID.x; i00 < pcs.ne00; i00 += nth) {
|
||||||
out_[y+i00] = in_[x+i00] - mean;
|
out_[y+i00] = in_[x+i00] - mean;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "common.comp"
|
#include "common.comp"
|
||||||
|
|
||||||
#define nth 256
|
#define nth 512
|
||||||
|
|
||||||
layout(local_size_x = nth) in;
|
layout(local_size_x = nth) in;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ void main() {
|
|||||||
|
|
||||||
const float scale = 1.0f/sqrt(sum[0] + pcs.eps);
|
const float scale = 1.0f/sqrt(sum[0] + pcs.eps);
|
||||||
|
|
||||||
const uint y = (gl_WorkGroupID.x*pcs.ne00/4) + pcs.outOff; // Based from out_
|
const uint y = (gl_WorkGroupID.x*pcs.ne00) + pcs.outOff; // Based from out_
|
||||||
for (uint i00 = gl_LocalInvocationID.x; i00 < pcs.ne00; i00 += nth) {
|
for (uint i00 = gl_LocalInvocationID.x; i00 < pcs.ne00; i00 += nth) {
|
||||||
out_[y+i00] = in_[x+i00] * scale;
|
out_[y+i00] = in_[x+i00] * scale;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user