Skip to main content

Module ffi

Module ffi 

Source
Expand description

FFI bindings to the C kernels in c-kernels/.

These wrappers provide safe Rust interfaces to the compiled C implementations of the hot numerical loops. The Rust side handles all validation; the C code only performs the tight inner loops.

Functionsยง

c_compressed_attention_logits
Compute compressed attention logits via C kernel.
c_decode_vector_block
Decode a vector block: gather codewords by index.
c_encode_vector_block
Encode a vector block: find nearest codeword for each block of block_dim floats. Returns the codeword indices.
c_softmax
Numerically stable softmax via C kernel.