char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
e29acf74f
char/aliceai-t5-moe
1#version 450 2 3#extension GL_EXT_control_flow_attributes : enable 4 5#include "types.glsl" 6#include "generic_head.glsl" 7 8layout(local_size_x_id = 0, local_size_y = 1, local_size_z = 1) in; 9 10layout (binding = 0) readonly buffer X {A_TYPE data_a[];}; 11layout (binding = 1) readonly buffer Y {B_TYPE data_b[];}; 12layout (binding = 2) buffer D {D_TYPE data_d[];}; 13 14const uint CHUNK_SIZE = 512; 15 16void main() { 17 const uint base = gl_WorkGroupID.x * CHUNK_SIZE; 18 const uint col = gl_LocalInvocationID.x; 19 20 uint count = 0; 21 [[unroll]] 22 for (uint i = 0; i < CHUNK_SIZE; i += gl_WorkGroupSize.x) { 23 const uint idx = base + i + col; 24 if (idx >= p.KX) { 25 break; 26 } 27 count += uint(data_a[idx] == data_b[idx]); 28 } 29 30 atomicAdd(data_d[0], D_TYPE(count)); 31}