pub struct PackedQ2Weight {
pub weight: DevicePtr,
pub n: u32,
pub k: u32,
pub group: u16,
}Expand description
Keep-packed ternary Q2_0 weight: a single contiguous buffer of raw PrismML
block_q2_0 blocks ([fp16 d][group/4 bytes of 2-bit codes], value = (code-1)*d), row-major over [n, k]. The scale is INLINE (one fp16 per
group of group elements) — there is no companion scale tensor, unlike
NVFP4/FP8. Consumed by the native q2_0_gemv decode kernel, which reads the
scale from each block. Built from a WeightDtype::PackedQ2_0 store tensor
under ATLAS_GGUF_NATIVE_Q2=1; the buffer is owned by the WeightStore, so
this struct only borrows the pointer (no free on drop).
Fields§
§weight: DevicePtrRaw packed block_q2_0 bytes, n * (k/group) * (2 + group/4) long.
n: u32Output rows (weight is [n, k]).
k: u32Input columns (contraction dim).
group: u16Group size (128 or 64) — elements per block / 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