Skip to main content

StackPolicy

Struct StackPolicy 

Source
pub struct StackPolicy {
Show 16 fields pub mode: Mode, pub timing: Timing, pub require_validation: bool, pub tolerance: Tolerance, pub warmups: usize, pub samples: usize, pub max_candidates: usize, pub budget: Duration, pub min_speedup: f64, pub max_relative_mad: f64, pub workspace_limit: Option<u64>, pub capacity: usize, pub max_parallel_tunes: usize, pub ttl: Duration, pub regression_pairs: usize, pub regression_ratio: f64,
}
Expand description

Immutable limits shared by operator, graph and application selection. Defaults are selection rules, not measured performance guarantees.

Fields§

§mode: Mode

Explore, cache-only or reference-only operation; defaults to Explore.

§timing: Timing

Completed timing scope; defaults to EndToEnd.

§require_validation: bool

Require numerical validation before promoting a choice; defaults to true.

§tolerance: Tolerance

Numerical limits and combined reference/candidate readback quota.

§warmups: usize

Positive warmup count in 1..=100; default 2.

§samples: usize

Odd sample count. Each non-reference sample is paired with a fresh reference measurement.

§max_candidates: usize

Positive candidate trial limit up to 4096; default 32.

§budget: Duration

A soft deadline checked BETWEEN completed trials; running kernels are never interrupted.

§min_speedup: f64

Required reciprocal median timing ratio for promotion; finite and at least 1. Default 1.05 is a threshold, not an observed speedup.

§max_relative_mad: f64

Maximum median absolute deviation of paired ratios divided by their median.

§workspace_limit: Option<u64>

Optional candidate scratch-byte ceiling. Unknown estimates do not fit an enabled limit, including for the declared reference. Default None.

§capacity: usize

Maximum retained keys in 1..=65536; default 1024.

§max_parallel_tunes: usize

Maximum simultaneous trials in 1..=256; default 1, also per-device serialized.

§ttl: Duration

Nonzero cache lifetime; default seven days. Future-dated entries expire.

§regression_pairs: usize

Odd nonzero regression window in 3..=101; default 7.

§regression_ratio: f64

Median selected/reference threshold above 1; default 1.15.

Implementations§

Source§

impl StackPolicy

Source

pub fn validate(&self) -> Result<(), TuneFailure>

Reject invalid counts, bounds, nonfinite numerical limits or zero durations. Returns FailureKind::InvalidInput without starting a trial or touching disk.

Source

pub fn accuracy_key(&self) -> String

Mode is intentionally excluded: an offline Explore cache is usable by CacheOnly.

Trait Implementations§

Source§

impl Clone for StackPolicy

Source§

fn clone(&self) -> Self

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 Debug for StackPolicy

Source§

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

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

impl Default for StackPolicy

Source§

fn default() -> Self

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

Source§

type At<'a> = T

The concrete input type at lifetime 'a.