pub struct WeightsConfig {
pub num_bits: u8,
pub type_: String,
pub symmetric: bool,
pub strategy: String,
pub axis: Option<usize>,
pub group_size: Option<usize>,
pub fp8_variant: Option<String>,
}Expand description
The compressed-tensors weights block for one scheme.
Fields§
§num_bits: u8Bits per quantized element.
type_: String"int" or "float".
symmetric: boolWhether zero_point is implicitly 0 (no _zero_point tensor is written).
strategy: String"tensor", "channel", or "group" (see Granularity::strategy_name).
axis: Option<usize>The axis grouping runs along, present for "channel"/"group" strategies. Required to
reconstruct the exact element->group mapping (see crate::quant::compute_groups) –
strategy and group_size alone are ambiguous for tensors with rank > 2.
group_size: Option<usize>Elements per group, only present when strategy == "group".
fp8_variant: Option<String>"e4m3" or "e5m2", present only for type == "float". The two FP8 encodings are
not bit-compatible with each other, so this is required to correctly decode – without
it, crate::validate would have to guess the variant used to write the file.
Trait Implementations§
Source§impl Clone for WeightsConfig
impl Clone for WeightsConfig
Source§fn clone(&self) -> WeightsConfig
fn clone(&self) -> WeightsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more