Skip to main content

dequantize_aligned

Function dequantize_aligned 

Source
pub fn dequantize_aligned<Q: Scalar, S: CubePrimitive, F: Numeric, NQ: Size, NF: Size>(
    value: Vector<Q, NQ>,
    scale: S,
    table: ComptimeOption<Box<[f32]>>,
    scheme: QuantScheme,
) -> Vector<F, NF>
Expand description

Dequantize a vector of values, where vector_size * num_quants is a power of two. Unaligned values can’t be dequantized in place.

scale is the effective scale for these values: how many scale levels the scheme has and how they combine is the caller’s business, folded before the call. This is what keeps the primitive per-read arithmetic, serving equally a one-level read, a view multiplying the per-tensor scale in per read, or a tile handing every read one register. table is a lookup scheme’s 2^bits-entry table, and must be present exactly when scheme.mode is QuantMode::Lookup.