pub struct TunableSet<K, Inputs, Output>where
K: AutotuneKey,
Inputs: Send + 'static,
Output: 'static,{ /* private fields */ }
Expand description
Groups operations of the same type for autotune
Implementations§
Source§impl<K, Inputs, Output> TunableSet<K, Inputs, Output>
impl<K, Inputs, Output> TunableSet<K, Inputs, Output>
Sourcepub fn new<KMarker, IMarker>(
key_gen: impl IntoKeyGenerator<K, Inputs, KMarker>,
input_gen: impl IntoInputGenerator<K, Inputs, IMarker>,
) -> TunableSet<K, Inputs, Output>
pub fn new<KMarker, IMarker>( key_gen: impl IntoKeyGenerator<K, Inputs, KMarker>, input_gen: impl IntoInputGenerator<K, Inputs, IMarker>, ) -> TunableSet<K, Inputs, Output>
Create a tunable set from a key generator and an input generator
Sourcepub fn with(
self,
tunable: Tunable<K, Inputs, Output>,
) -> TunableSet<K, Inputs, Output>
pub fn with( self, tunable: Tunable<K, Inputs, Output>, ) -> TunableSet<K, Inputs, Output>
Register a tunable with this tunable set
Sourcepub fn with_custom_checksum(
self,
checksum: impl Fn(&TunableSet<K, Inputs, Output>) -> String + Send + Sync + 'static,
) -> TunableSet<K, Inputs, Output>
pub fn with_custom_checksum( self, checksum: impl Fn(&TunableSet<K, Inputs, Output>) -> String + Send + Sync + 'static, ) -> TunableSet<K, Inputs, Output>
Override the checksum algorithm
Sourcepub fn autotunables(
&self,
) -> Vec<Arc<dyn TuneFn<Inputs = Inputs, Output = Output>>>
pub fn autotunables( &self, ) -> Vec<Arc<dyn TuneFn<Inputs = Inputs, Output = Output>>>
All candidate operations for autotuning this operation type Operations can run on toy tensors of relevant size
Sourcepub fn fastest(
&self,
fastest_index: usize,
) -> Arc<dyn TuneFn<Inputs = Inputs, Output = Output>>
pub fn fastest( &self, fastest_index: usize, ) -> Arc<dyn TuneFn<Inputs = Inputs, Output = Output>>
Returns the operation for the given index, matching the order returned by autotunables. Operation obtained here runs on original tensors Nb: The 0 index is used a “good default”.
Sourcepub fn compute_checksum(&self) -> String
pub fn compute_checksum(&self) -> String
Compute a checksum that can invalidate outdated cached auto-tune results.
Sourcepub fn generate_key(&self, inputs: &Inputs) -> K
pub fn generate_key(&self, inputs: &Inputs) -> K
Generate a key from a set of inputs
Trait Implementations§
impl<K, In, Out> Send for TunableSet<K, In, Out>where
K: AutotuneKey,
In: Send,
impl<K, In, Out> Sync for TunableSet<K, In, Out>where
K: AutotuneKey,
In: Send,
Auto Trait Implementations§
impl<K, Inputs, Output> Freeze for TunableSet<K, Inputs, Output>
impl<K, Inputs, Output> !RefUnwindSafe for TunableSet<K, Inputs, Output>
impl<K, Inputs, Output> Unpin for TunableSet<K, Inputs, Output>
impl<K, Inputs, Output> !UnwindSafe for TunableSet<K, Inputs, Output>
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