pub struct PackedQ2Weight {
pub weight: DevicePtr,
pub n: u32,
pub k: u32,
pub group: u16,
}Expand description
2026-09-25: Keep-packed ternary Q2_0 weight: one buffer of raw block_q2_0
blocks ([fp16 d][group/4 bytes of 2-bit codes], value = (code - 1) * d),
row-major over [n, k], with the scale inline and no separate scale tensor.
Built from a WeightDtype::PackedQ2_0 store tensor, which the GGUF loader
produces under METRALE_GGUF_NATIVE_Q2=1. The store owns the buffer; this
struct only holds the pointer.
Fields§
§weight: DevicePtr2026-09-25: Raw packed block_q2_0 bytes, n * (k/group) * (2 + group/4) long.
n: u322026-09-25: Output rows (the weight is [n, k]).
k: u322026-09-25: Input columns (the contraction dimension).
group: u162026-09-25: Elements per block and per inline scale.
Implementations§
Trait Implementations§
Source§impl Clone for PackedQ2Weight
impl Clone for PackedQ2Weight
Source§fn clone(&self) -> PackedQ2Weight
fn clone(&self) -> PackedQ2Weight
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackedQ2Weight
impl Debug for PackedQ2Weight
Source§impl From<PackedQ2Weight> for QuantWeight
impl From<PackedQ2Weight> for QuantWeight
Source§fn from(w: PackedQ2Weight) -> Self
fn from(w: PackedQ2Weight) -> Self
Converts to this type from the input type.
impl Copy for PackedQ2Weight
Auto Trait Implementations§
impl Freeze for PackedQ2Weight
impl RefUnwindSafe for PackedQ2Weight
impl Send for PackedQ2Weight
impl Sync for PackedQ2Weight
impl Unpin for PackedQ2Weight
impl UnwindSafe for PackedQ2Weight
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more