pub enum LowPrecisionState {
F16(Vec<f16>),
BF16(Vec<bf16>),
I8 {
values: Vec<i8>,
scale: f32,
},
I4 {
values: Vec<u8>,
scale: f32,
},
Sparse {
indices: Vec<usize>,
values: Vec<f32>,
},
}Expand description
Low-precision state representation for memory-efficient optimizer states
Variants§
F16(Vec<f16>)
16-bit float representation
BF16(Vec<bf16>)
16-bit brain float representation
I8
8-bit integer representation with scale factor
I4
4-bit integer representation with scale factor
Sparse
Sparse representation for mostly-zero states
Implementations§
Trait Implementations§
Source§impl Clone for LowPrecisionState
impl Clone for LowPrecisionState
Source§fn clone(&self) -> LowPrecisionState
fn clone(&self) -> LowPrecisionState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LowPrecisionState
impl RefUnwindSafe for LowPrecisionState
impl Send for LowPrecisionState
impl Sync for LowPrecisionState
impl Unpin for LowPrecisionState
impl UnsafeUnpin for LowPrecisionState
impl UnwindSafe for LowPrecisionState
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,
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