pub struct ComputeKnobs {
pub fidelity: MathFidelity,
pub fp32_dest_acc: bool,
pub packer_l1_acc: bool,
pub pcc_floor: f64,
}Expand description
The compute NUMERICS knobs of an emitted matmul program. They are part of the program’s identity: the
host’s ComputeConfig carries them, the program prints them on its LOGOS_MM_PASS line, and the ledger
refuses a row whose printed knobs differ from what the harness requested — so a LoFi run can never again
be compared to a HiFi4 run as if they were one config.
Fields§
§fidelity: MathFidelityFPU passes per multiply (see MathFidelity).
fp32_dest_acc: boolAccumulate in fp32 in the DST register file (halves the DST tile budget; higher PCC).
packer_l1_acc: boolAccumulate K-block partials in L1 through the packer instead of reloading DST — NOT yet implemented by
the emitted compute kernel, so the emitter refuses it (see ComputeKnobs::check_supported).
pcc_floor: f64The PCC the emitted program requires of itself to print LOGOS_MM_PASS.
Implementations§
Source§impl ComputeKnobs
impl ComputeKnobs
Sourcepub fn from_env() -> Result<Self, String>
pub fn from_env() -> Result<Self, String>
The knobs the measurement harness asks for: LOGOS_TT_FIDELITY (LoFi|HiFi2|HiFi3|HiFi4),
LOGOS_TT_FP32 (0|1), LOGOS_TT_L1ACC (0|1); an unset variable means the default.
Sourcepub fn from_vars(
fidelity: Option<&str>,
fp32: Option<&str>,
l1acc: Option<&str>,
) -> Result<Self, String>
pub fn from_vars( fidelity: Option<&str>, fp32: Option<&str>, l1acc: Option<&str>, ) -> Result<Self, String>
The pure core of ComputeKnobs::from_env.
Sourcepub fn dst_tiles(&self, chip: &ChipKnobs) -> usize
pub fn dst_tiles(&self, chip: &ChipKnobs) -> usize
The DST tile budget these numerics leave on chip: fp32 accumulate halves it.
Sourcepub fn check_supported(&self) -> Result<(), String>
pub fn check_supported(&self) -> Result<(), String>
Refuse, typed, any knob the emitted kernels do not actually implement — a program must never print a numerics knob it does not run.
Sourcepub fn compute_config_fields(&self) -> String
pub fn compute_config_fields(&self) -> String
The .math_fidelity = …, .fp32_dest_acc_en = …, fragment of a tt-metal ComputeConfig.
Sourcepub fn pass_tokens(&self) -> String
pub fn pass_tokens(&self) -> String
The knob tokens of the LOGOS_MM_PASS line (the ledger re-parses exactly these).
Trait Implementations§
Source§impl Clone for ComputeKnobs
impl Clone for ComputeKnobs
Source§fn clone(&self) -> ComputeKnobs
fn clone(&self) -> ComputeKnobs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComputeKnobs
impl Debug for ComputeKnobs
Source§impl Default for ComputeKnobs
impl Default for ComputeKnobs
Source§impl PartialEq for ComputeKnobs
impl PartialEq for ComputeKnobs
impl Copy for ComputeKnobs
impl StructuralPartialEq for ComputeKnobs
Auto Trait Implementations§
impl Freeze for ComputeKnobs
impl RefUnwindSafe for ComputeKnobs
impl Send for ComputeKnobs
impl Sync for ComputeKnobs
impl Unpin for ComputeKnobs
impl UnsafeUnpin for ComputeKnobs
impl UnwindSafe for ComputeKnobs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.