pub struct CastConfig {
pub out_dtype: DType,
pub sf_block: Option<(usize, usize)>,
pub round_sf: bool,
}Expand description
Cast configuration carried by ops that emit a typed output.
Inspired by TileKernels’ CastInputConfig / CastOutputConfig: a single
dataclass that flows from the layer down to the kernel selector, so adding
new quantized formats (FP8 e4m3, FP4 e2m1, blocked scaling) becomes a
matter of populating fields rather than threading new flags through call
sites.
Today only out_dtype is consulted by backends — the scaling-factor
fields are reserved for future quantization passes (FP8 / blocked SF).
Constructed once by the precision pass and embedded in fused ops.
Fields§
§out_dtype: DTypeDestination dtype for the cast (fragment of the output tensor).
sf_block: Option<(usize, usize)>Scaling factor block size (rows, cols) for blocked quantization.
None means no scaling factor (plain cast).
round_sf: boolRound scaling factors to powers of two (UE8M0 style).
Implementations§
Trait Implementations§
Source§impl Clone for CastConfig
impl Clone for CastConfig
Source§fn clone(&self) -> CastConfig
fn clone(&self) -> CastConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CastConfig
Source§impl Debug for CastConfig
impl Debug for CastConfig
Source§impl PartialEq for CastConfig
impl PartialEq for CastConfig
Source§fn eq(&self, other: &CastConfig) -> bool
fn eq(&self, other: &CastConfig) -> bool
self and other values to be equal, and is used by ==.