Skip to main content

PhysicalWeightLayout

Enum PhysicalWeightLayout 

Source
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.

Fields

§component_id: WeightId
§

Stored

§

Composite

§

Quantized

Fields

§packed_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.

§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.

§group_axis: u32
§

BlockQuantized

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.

Fields

§block_axis: u32
§

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

§axis: u32
§logical_offset: u64
§extent: u64
§reshape: Vec<u64>
§stored_axis_order: Vec<u32>

Stored axis position -> reshaped logical axis, matching an n-dimensional transpose/permute order.

§

Indexed

Fields

§source_axis_extent: u64
§

ExpertStack

Fields

§expert_axis: u32

Trait Implementations§

Source§

impl Clone for PhysicalWeightLayout

Source§

fn clone(&self) -> PhysicalWeightLayout

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PhysicalWeightLayout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PhysicalWeightLayout

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for PhysicalWeightLayout

Source§

impl PartialEq for PhysicalWeightLayout

Source§

fn eq(&self, other: &PhysicalWeightLayout) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PhysicalWeightLayout

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PhysicalWeightLayout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V