pub struct AnytimeConfig {
pub time_budget_ms: Option<f64>,
pub max_age_ms: Option<f64>,
pub quality_target: Option<f32>,
pub quality_floor: Option<f32>,
pub max_refines: Option<u32>,
pub max_stall: Option<u32>,
}Expand description
Refinement policy for an anytime node (anytime: on a task).
Every field is optional, but validation requires at least one - time_budget_ms,
max_age_ms and max_refines; see CuConfig::validate_anytime_configs.
Two orthogonal axes organize the fields:
- Budget — how much to spend per result:
time_budget_msandmax_refinesare hard bounds,quality_targetandmax_stallstop spending early when more is provably not worth it. - Utility — whether the result is worth having at all:
max_age_ms(worthless because too old) andquality_floor(worthless because too crude).
Fields§
§time_budget_ms: Option<f64>Wall-clock window for one job in milliseconds, measured from the start of the base computation and checked between refinement quanta. In background placement it is measured on the worker thread and may exceed the copperlist period.
max_age_ms: Option<f64>Validity deadline in milliseconds, measured from the input’s earliest time of validity (Tov): past this data age a result is no longer worth starting or waiting for.
quality_target: Option<f32>Stop refining early once the reported quality reaches this target, in
(0.0, 1.0] on the normalized quality scale. Only valid for tasks that
report a comparable quality.
quality_floor: Option<f32>Publish only if the final reported quality is at least this floor, in
(0.0, 1.0) on the normalized quality scale; below it the payload is
cleared. Only valid for tasks that report a comparable quality.
max_refines: Option<u32>Hard bound on refinement quanta per job.
max_stall: Option<u32>Stop after this many quanta without the published quality improving. Only valid for tasks that report a comparable quality.
Trait Implementations§
Source§impl Clone for AnytimeConfig
impl Clone for AnytimeConfig
Source§fn clone(&self) -> AnytimeConfig
fn clone(&self) -> AnytimeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnytimeConfig
impl Debug for AnytimeConfig
Source§impl Default for AnytimeConfig
impl Default for AnytimeConfig
Source§fn default() -> AnytimeConfig
fn default() -> AnytimeConfig
Source§impl<'de> Deserialize<'de> for AnytimeConfig
impl<'de> Deserialize<'de> for AnytimeConfig
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>,
Source§impl PartialEq for AnytimeConfig
impl PartialEq for AnytimeConfig
Source§impl Serialize for AnytimeConfig
impl Serialize for AnytimeConfig
impl StructuralPartialEq for AnytimeConfig
Auto Trait Implementations§
impl Freeze for AnytimeConfig
impl RefUnwindSafe for AnytimeConfig
impl Send for AnytimeConfig
impl Sync for AnytimeConfig
impl Unpin for AnytimeConfig
impl UnsafeUnpin for AnytimeConfig
impl UnwindSafe for AnytimeConfig
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> GetTypeRegistration for T
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> ⓘ
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> ⓘ
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