pub struct AutoConfigurator { /* private fields */ }Expand description
ML-powered auto-configurator
Implementations§
Source§impl AutoConfigurator
impl AutoConfigurator
Sourcepub fn new(objective: ConfigObjective) -> Self
pub fn new(objective: ConfigObjective) -> Self
Create a new auto-configurator with specified objective
Sourcepub fn recommend(
&self,
tensor: &Tensor,
constraints: Option<ConfigConstraints>,
) -> TorshResult<QuantConfig>
pub fn recommend( &self, tensor: &Tensor, constraints: Option<ConfigConstraints>, ) -> TorshResult<QuantConfig>
Recommend optimal configuration for a tensor
Sourcepub fn recommend_ranked(
&self,
tensor: &Tensor,
top_k: usize,
constraints: Option<ConfigConstraints>,
) -> TorshResult<Vec<(QuantConfig, f32)>>
pub fn recommend_ranked( &self, tensor: &Tensor, top_k: usize, constraints: Option<ConfigConstraints>, ) -> TorshResult<Vec<(QuantConfig, f32)>>
Recommend multiple configurations ranked by expected performance
Sourcepub fn update_performance(
&mut self,
config: &QuantConfig,
tensor: &Tensor,
observed_error: f32,
observed_compression: f32,
speedup: Option<f32>,
) -> TorshResult<()>
pub fn update_performance( &mut self, config: &QuantConfig, tensor: &Tensor, observed_error: f32, observed_compression: f32, speedup: Option<f32>, ) -> TorshResult<()>
Update the configurator with observed performance
Auto Trait Implementations§
impl Freeze for AutoConfigurator
impl RefUnwindSafe for AutoConfigurator
impl Send for AutoConfigurator
impl Sync for AutoConfigurator
impl Unpin for AutoConfigurator
impl UnsafeUnpin for AutoConfigurator
impl UnwindSafe for AutoConfigurator
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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