pub struct QuantizationBenchmarker {
pub config: BenchmarkConfig,
pub metrics: Vec<BenchmarkResult>,
}Expand description
Performance benchmarking utilities for quantization analysis
Fields§
§config: BenchmarkConfigConfiguration for benchmarking
metrics: Vec<BenchmarkResult>Collected benchmark metrics
Implementations§
Source§impl QuantizationBenchmarker
impl QuantizationBenchmarker
Sourcepub fn new(config: BenchmarkConfig) -> Self
pub fn new(config: BenchmarkConfig) -> Self
Create a new benchmarker with configuration
Sourcepub fn benchmark_scheme(
&mut self,
scheme: QScheme,
operation: impl Fn() -> TorshResult<()>,
) -> TorshResult<BenchmarkResult>
pub fn benchmark_scheme( &mut self, scheme: QScheme, operation: impl Fn() -> TorshResult<()>, ) -> TorshResult<BenchmarkResult>
Benchmark a quantization scheme
Sourcepub fn benchmark_comparison(
&mut self,
schemes: &[QScheme],
operation_factory: impl Fn(QScheme) -> Box<dyn Fn() -> TorshResult<()>>,
) -> TorshResult<Vec<BenchmarkResult>>
pub fn benchmark_comparison( &mut self, schemes: &[QScheme], operation_factory: impl Fn(QScheme) -> Box<dyn Fn() -> TorshResult<()>>, ) -> TorshResult<Vec<BenchmarkResult>>
Benchmark multiple schemes and compare
Sourcepub fn generate_report(&self) -> String
pub fn generate_report(&self) -> String
Generate benchmark report
Sourcepub fn find_best_scheme(
&self,
criteria: OptimizationCriteria,
) -> Option<QScheme>
pub fn find_best_scheme( &self, criteria: OptimizationCriteria, ) -> Option<QScheme>
Find the best scheme based on criteria
Sourcepub fn clear_metrics(&mut self)
pub fn clear_metrics(&mut self)
Clear all collected metrics
Sourcepub fn get_metrics(&self) -> &[BenchmarkResult]
pub fn get_metrics(&self) -> &[BenchmarkResult]
Get all collected metrics
Trait Implementations§
Source§impl Clone for QuantizationBenchmarker
impl Clone for QuantizationBenchmarker
Source§fn clone(&self) -> QuantizationBenchmarker
fn clone(&self) -> QuantizationBenchmarker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuantizationBenchmarker
impl Debug for QuantizationBenchmarker
Auto Trait Implementations§
impl Freeze for QuantizationBenchmarker
impl RefUnwindSafe for QuantizationBenchmarker
impl Send for QuantizationBenchmarker
impl Sync for QuantizationBenchmarker
impl Unpin for QuantizationBenchmarker
impl UnsafeUnpin for QuantizationBenchmarker
impl UnwindSafe for QuantizationBenchmarker
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> 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