pub enum Codec {
Show 33 variants
Q4K,
Q5K,
Q6K,
Q8_0,
Q3K,
Q4_0,
Float16,
BFloat16,
Q2K,
Q5_1,
Q5_0,
Q4_1,
Q8_1,
Q8K,
Iq1S,
Iq1M,
Iq2Xxs,
Iq2Xs,
Iq2S,
Iq3Xxs,
Iq3S,
Iq4Nl,
Iq4Xs,
Tq10,
Tq20,
Mxfp4,
Nvfp4,
Q1_0,
Q2_0,
BFloat8,
Bf8E5M2,
Bf4E2M1,
Fp6E3M2,
}Expand description
Which packed byte layout a codec-tagged buffer holds.
Variants§
Q4K
Q5K
Q6K
Q8_0
Q3K
Q4_0
Float16
BFloat16
Q2K
Q5_1
Q5_0
Q4_1
Q8_1
Q8K
Iq1S
Iq1M
Iq2Xxs
Iq2Xs
Iq2S
Iq3Xxs
Iq3S
Iq4Nl
Iq4Xs
Tq10
Tq20
Mxfp4
Nvfp4
Q1_0
Q2_0
BFloat8
Bf8E5M2
Bf4E2M1
Fp6E3M2
Implementations§
Source§impl Codec
impl Codec
Sourcepub const FP6_E3M2_BLOCK_ELEMENTS: usize = 32
pub const FP6_E3M2_BLOCK_ELEMENTS: usize = 32
Weights per Codec::Fp6E3M2 block, one f16 absmax scale each.
Sourcepub const FP6_E3M2_BLOCK_BYTES: usize
pub const FP6_E3M2_BLOCK_BYTES: usize
Bytes per Codec::Fp6E3M2 block: the 6-bit FloatLayout::E3M2 fields
packed, then the f16 scale.
Sourcepub fn tag(self) -> u8
pub fn tag(self) -> u8
The wire byte a sidecar tags this codec with. Stable across releases – an on-disk sidecar’s bytes decode by this mapping.
Sourcepub fn from_tag(tag: u8) -> Option<Self>
pub fn from_tag(tag: u8) -> Option<Self>
The inverse of Self::tag. None for a byte no codec claims.
Sourcepub const fn block_layout(self) -> Option<BlockLayout>
pub const fn block_layout(self) -> Option<BlockLayout>
The block packing of the linear block codecs, None for every other codec.
Sourcepub const fn layout(self) -> Option<FloatLayout>
pub const fn layout(self) -> Option<FloatLayout>
The element layout of the float codecs, None for every codec that is not a plain float
layout (block-quantized integer codecs, codebooks, and the formats with no decoder).
Fp6E3M2 is the layout of its six-bit fields; the f16 scale per 32 elements is its block.
Trait Implementations§
impl Copy for Codec
impl Eq for Codec
impl StructuralPartialEq for Codec
Auto Trait Implementations§
impl Freeze for Codec
impl RefUnwindSafe for Codec
impl Send for Codec
impl Sync for Codec
impl Unpin for Codec
impl UnsafeUnpin for Codec
impl UnwindSafe for Codec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.