char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aclyvulkan : incremental shader builds (#16341)e29acf74f

char/aliceai-t5-moe
625 B24 linesraw
1#version 450
2
3#include "types.glsl"
4#include "generic_unary_head.glsl"
5
6const uint num_threads = 128;
7
8layout(local_size_x = num_threads, local_size_y = 1, local_size_z = 1) in;
9
10void main() {
11    uint idx = get_idx();
12
13    // num_threads * num_iter must equal 512, to match the wg_denoms and get_idx calculation
14    const uint num_iter = 4;
15
16    [[unroll]] for (uint i = 0; i < num_iter; ++i) {
17        if (idx >= p.ne) {
18            continue;
19        }
20
21        data_d[get_doffset() + idx] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + idx]) * FLOAT_TYPE(p.param1) + FLOAT_TYPE(p.param2));
22        idx += num_threads;
23    }
24}