Expand description
Quantization functionality required in views
Modules§
Traits§
- RunWith
Quant Type - Run an arbitrary function with the quantization types from the scheme. Useful when concrete types aren’t available.
Functions§
- check_
global_ levels - The global-level half of
check_scale_bindings, for a consumer holding global scales already folded into a register rather than as countable bindings. - check_
scale_ bindings - Panic when the scale bindings and the scheme’s levels disagree.
- check_
table_ bindings - Panic when the lookup-table binding and the scheme disagree.
- dequantize_
aligned - Dequantize a vector of values, where
vector_size * num_quantsis a power of two. Unaligned values can’t be dequantized in place. - dequantize_
aligned_ wide - [
dequantize_aligned] for a scale a caller folded in f32, forming the product there too and narrowing only the result. - multiply_
global_ scale - The effective scale of values whose per-tensor scale multiplies on top of their block scale.
- unpack_
cast_ u32 - Unpack a set of values from u32, and convert to the specified floating point format.
tabledecodes each field underQuantMode::Lookupand must beNoneotherwise ([dequantize_aligned] checks the pairing). - unpack_
fields - Unpack
NFconsecutive fields of oneu32word starting at fieldfirst(a runtime index), cast but unscaled — the caller multiplies by whatever scale its lines carry. The sub-word counterpart of [unpack_cast_u32], for reads whose served line is narrower than a word:NFmay be any divisor of the packing factor, andfirstselects which slice of the word this line is.e2m1is refused — its native pairs cannot be split at a field boundary.