pub struct QuantizationPerformanceHints {
pub preferred_dtypes: Vec<QuantizedDType>,
pub preferred_schemes: Vec<QuantizationScheme>,
pub optimal_batch_size: usize,
pub prefer_inplace: bool,
}Expand description
Hardware-specific performance hints
Provides recommendations for optimal quantization strategies based on detected hardware capabilities.
Fields§
§preferred_dtypes: Vec<QuantizedDType>Recommended quantization data types in order of preference
preferred_schemes: Vec<QuantizationScheme>Recommended quantization schemes in order of preference
optimal_batch_size: usizeOptimal batch size for operations
prefer_inplace: boolWhether to prefer in-place operations
Implementations§
Source§impl QuantizationPerformanceHints
impl QuantizationPerformanceHints
Sourcepub fn for_hardware(features: &QuantizationHardwareFeatures) -> Self
pub fn for_hardware(features: &QuantizationHardwareFeatures) -> Self
Generate performance hints for the given hardware features
Sourcepub fn best_dtype_for_accuracy(
&self,
min_accuracy: f64,
) -> Option<&QuantizedDType>
pub fn best_dtype_for_accuracy( &self, min_accuracy: f64, ) -> Option<&QuantizedDType>
Get the best quantization data type for the given requirements
Sourcepub fn best_scheme_for_latency(
&self,
max_latency_factor: f64,
) -> Option<&QuantizationScheme>
pub fn best_scheme_for_latency( &self, max_latency_factor: f64, ) -> Option<&QuantizationScheme>
Get the best quantization scheme for the given performance requirements
Trait Implementations§
Source§impl Clone for QuantizationPerformanceHints
impl Clone for QuantizationPerformanceHints
Auto Trait Implementations§
impl Freeze for QuantizationPerformanceHints
impl RefUnwindSafe for QuantizationPerformanceHints
impl Send for QuantizationPerformanceHints
impl Sync for QuantizationPerformanceHints
impl Unpin for QuantizationPerformanceHints
impl UnsafeUnpin for QuantizationPerformanceHints
impl UnwindSafe for QuantizationPerformanceHints
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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