Skip to main content

execute_sample_f32

Function execute_sample_f32 

Source
pub unsafe fn execute_sample_f32(
    logits: usize,
    dst: usize,
    batch: usize,
    vocab: usize,
    top_k: usize,
    top_p: f32,
    temperature: f32,
    seed: u64,
    base: *mut u8,
)
Expand description

Token-sampling reference. Shared by the CPU Thunk::Sample arm and the Metal unified-memory host fallback. logits is [batch, vocab] f32; writes one f32-encoded index per batch row to dst. With a fixed seed (and same top_k/top_p/temperature) the result is deterministic.