pub enum PhysicalWeightLayout {
Dense {
component_id: WeightId,
},
Stored {
component: PhysicalWeightComponentBinding,
},
Composite {
parts: Vec<CompositeWeightPart>,
},
Quantized {
packed_values: PhysicalWeightComponentBinding,
packed_dimensions: Vec<u64>,
scales: PhysicalWeightComponentBinding,
zero_points: Option<PhysicalWeightComponentBinding>,
zero_point_packed_dimensions: Option<Vec<u64>>,
axis_indices: Option<AxisWeightComponent>,
permutation: Option<AxisWeightComponent>,
codebook: Option<PhysicalWeightComponentBinding>,
group_axis: u32,
group_padding: PhysicalWeightPadding,
},
BlockQuantized {
blocks: PhysicalWeightComponentBinding,
block_axis: u32,
block_padding: PhysicalWeightPadding,
},
AxisReshapePermutation {
values: Box<PhysicalWeightLayout>,
axis: u32,
logical_offset: u64,
extent: u64,
reshape: Vec<u64>,
stored_axis_order: Vec<u32>,
},
Indexed {
indices: AxisWeightComponent,
values: Box<PhysicalWeightLayout>,
source_axis_extent: u64,
},
ExpertStack {
experts: Vec<PhysicalWeightLayout>,
expert_axis: u32,
},
}Expand description
Typed physical storage tree for one logical weight. Every leaf binds one physical component exactly once. Recursive composition allows indexing or expert stacking around dense, tiled, strided, or quantized values without architecture-specific cases.
Variants§
Dense
Exact, contiguous dense values. This common leaf deliberately remains
compact; use Stored for explicit stride, tile, or padding geometry.
Stored
Fields
component: PhysicalWeightComponentBindingComposite
Fields
parts: Vec<CompositeWeightPart>Quantized
Fields
packed_values: PhysicalWeightComponentBindingpacked_dimensions: Vec<u64>Semantic packed-storage shape before the binding’s optional
stride/tile mapping. Its element product must equal the exact byte
count implied by logical elements and bits_per_weight.
scales: PhysicalWeightComponentBindingzero_points: Option<PhysicalWeightComponentBinding>zero_point_packed_dimensions: Option<Vec<u64>>Optional packed storage shape for asymmetric zero points. When
absent, one dense zero-point scalar is stored per quantization
group. When present, it must contain exactly bits_per_weight
bits per group and the bound component dtype describes the packed
storage word (for example I32 words containing eight INT4 values).
axis_indices: Option<AxisWeightComponent>Per-coordinate group assignment. Its semantic shape is the one dimensional logical axis extent, not the multi-dimensional group tensor shape.
permutation: Option<AxisWeightComponent>codebook: Option<PhysicalWeightComponentBinding>group_padding: PhysicalWeightPaddingBlockQuantized
One opaque, self-contained quantization block represents a fixed
number of logical values along block_axis. The bound component shape
is the padded logical shape with that axis divided by the block width.
AxisReshapePermutation
A contiguous logical subrange on one axis is stored by reshaping that subrange and permuting the reshape axes. This captures checkpoint layouts such as grouped-to-tiled head order without a model flag, synthetic index tensor, or eager repack.
Fields
values: Box<PhysicalWeightLayout>Indexed
ExpertStack
Trait Implementations§
Source§impl Clone for PhysicalWeightLayout
impl Clone for PhysicalWeightLayout
Source§fn clone(&self) -> PhysicalWeightLayout
fn clone(&self) -> PhysicalWeightLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more