llama-rs 0.16.1

A high-performance Rust implementation of llama.cpp - LLM inference engine with full GGUF support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Softmax pass 3: Normalize by dividing by sum

cbuffer Params : register(b0) {
    int n;
    float inv_sum;
};

RWStructuredBuffer<float> data : register(u0);

[numthreads(256, 1, 1)]
void main(uint3 dtid : SV_DispatchThreadID) {
    uint idx = dtid.x;
    if (idx < (uint)n) {
        data[idx] *= inv_sum;
    }
}