Skip to main content

Numerics

Enum Numerics 

Source
pub enum Numerics {
    Exact,
    Fast,
}
Expand description

The numerics posture of an execution scope: the fidelity it demands of every kernel.

Exact demands the bit-identity fidelity — the reference bits, in every build. Today no offer-dispatched kernel meets it, so chain work computes on the built-in reference paths, while the fused cells serve under both postures: the reduce-window walk answers the reference bits outright, and the composed cells honor the demand by composing on the reference paths. Fast demands only the envelope fidelity: the chain as compiled, backends engaging above their per-task thresholds, which are cost heuristics inside this posture, never correctness boundaries.

The posture is a value, not a build flag: it rides an Entry onto every executor’s runs — interpreted or lowered — so an exact oracle result and a fast result are comparable in one process. The default — for entries and for host-side payload calls outside any run — is Fast: enabling a backend feature keeps meaning “use it”, and features change speed, never behavior classes. The one road that consults no default is Network::forward: whole-spec evaluation is the proving road and always runs Exact, so its bits are the same in every build.

Variants§

§

Exact

Only bit-certified kernels serve: the reference bits, the same in every build.

§

Fast

The compiled backend chain above its cost thresholds.

Implementations§

Source§

impl Numerics

Source

pub fn fidelity(self) -> Fidelity

The certified fidelity this posture demands of every kernel.

Source

pub fn exactly<Output>(body: impl FnOnce() -> Output) -> Output

Runs body with the Exact posture installed for the current thread, restoring the previous posture on return or panic.

It is the direct-call road to the reference bits: a payload operation outside any run consults the ambient posture, so Numerics::exactly(|| a.matmul(&b)) compares a direct call against the reference without compiling a plan. Runs keep their own posture regardless: an entry’s numerics override the ambient one for the whole run.

Trait Implementations§

Source§

impl Clone for Numerics

Source§

fn clone(&self) -> Numerics

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Numerics

Source§

impl Debug for Numerics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Numerics

Source§

fn default() -> Numerics

Returns the “default value” for a type. Read more
Source§

impl Eq for Numerics

Source§

impl PartialEq for Numerics

Source§

fn eq(&self, other: &Numerics) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Numerics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.