pub enum FP8Format {
E4M3,
E5M2,
}Expand description
FP8 data format specification
Variants§
E4M3
E4M3: 4-bit exponent, 3-bit mantissa (sign: 1, exp: 4, mantissa: 3) Range: ±448, better dynamic range Best for: Forward pass, activations, weights
E5M2
E5M2: 5-bit exponent, 2-bit mantissa (sign: 1, exp: 5, mantissa: 2) Range: ±57344, wider range but less precision Best for: Gradients, loss scaling
Implementations§
Source§impl FP8Format
impl FP8Format
Sourcepub fn min_positive_normal(&self) -> f32
pub fn min_positive_normal(&self) -> f32
Minimum positive normal value
Sourcepub fn mantissa_bits(&self) -> u8
pub fn mantissa_bits(&self) -> u8
Number of mantissa bits
Sourcepub fn exponent_bits(&self) -> u8
pub fn exponent_bits(&self) -> u8
Number of exponent bits
Sourcepub fn exponent_bias(&self) -> i32
pub fn exponent_bias(&self) -> i32
Exponent bias
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FP8Format
impl<'de> Deserialize<'de> for FP8Format
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for FP8Format
impl Eq for FP8Format
impl StructuralPartialEq for FP8Format
Auto Trait Implementations§
impl Freeze for FP8Format
impl RefUnwindSafe for FP8Format
impl Send for FP8Format
impl Sync for FP8Format
impl Unpin for FP8Format
impl UnsafeUnpin for FP8Format
impl UnwindSafe for FP8Format
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<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
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.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