pub struct BnbQuantState {
pub n: usize,
pub k: usize,
pub block_size: usize,
pub nested: Option<BnbNestedState>,
}Expand description
The geometry + format discriminators extracted from a
bitsandbytes quant_state JSON blob. Parsed via
parse_bnb_quant_state; consumed by load_nf4_layer to
reconstruct the [N, K/block_size] absmax layout from bnb’s
flat [N * K / block_size] storage.
Only the fields needed to drive Nf4Weight construction are
extracted; the parser ignores unknown fields (forward-compat
with future bnb metadata additions).
Fields§
§n: usizeNumber of output features (rows of the weight matrix).
k: usizeNumber of input features (the K in (M, K) @ (K, N) → (M, N)).
block_size: usizeFirst-level (un-nested) quantization block size — typically 64.
nested: Option<BnbNestedState>Second-level (double-quantization) parameters when the absmax is
itself quantized; None for a plain single-level checkpoint.
Trait Implementations§
Source§impl Clone for BnbQuantState
impl Clone for BnbQuantState
Source§impl Debug for BnbQuantState
impl Debug for BnbQuantState
Source§impl PartialEq for BnbQuantState
impl PartialEq for BnbQuantState
impl StructuralPartialEq for BnbQuantState
Auto Trait Implementations§
impl Freeze for BnbQuantState
impl RefUnwindSafe for BnbQuantState
impl Send for BnbQuantState
impl Sync for BnbQuantState
impl Unpin for BnbQuantState
impl UnsafeUnpin for BnbQuantState
impl UnwindSafe for BnbQuantState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more