pub struct AutoTuner { /* private fields */ }Expand description
The auto-tuner: detects hardware and recommends inference parameters.
Implementations§
Source§impl AutoTuner
impl AutoTuner
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new auto-tuner that auto-detects CPU and uses system RSS as a rough memory estimate (defaults to 4096 MB if detection fails).
Sourcepub fn with_memory_mb(memory_mb: usize) -> Self
pub fn with_memory_mb(memory_mb: usize) -> Self
Create an auto-tuner with an explicit memory budget (in MB).
Sourcepub fn recommend(
&self,
model_params: usize,
bits_per_weight: f32,
num_layers: usize,
num_heads: usize,
head_dim: usize,
) -> TuningRecommendation
pub fn recommend( &self, model_params: usize, bits_per_weight: f32, num_layers: usize, num_heads: usize, head_dim: usize, ) -> TuningRecommendation
Generate tuning recommendations for a specific model configuration.
model_params— total number of model parameters.bits_per_weight— quantisation bits (e.g. 1.125 for Q1_0_g128).num_layers/num_heads/head_dim— transformer architecture.
Sourcepub fn benchmark_kernel(&self, iterations: usize) -> KernelBenchmark
pub fn benchmark_kernel(&self, iterations: usize) -> KernelBenchmark
Quick micro-benchmark: run a synthetic FMA-heavy kernel to estimate raw compute throughput.
Sourcepub fn cpu_features(&self) -> &CpuFeatures
pub fn cpu_features(&self) -> &CpuFeatures
Reference to the detected CPU features.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoTuner
impl RefUnwindSafe for AutoTuner
impl Send for AutoTuner
impl Sync for AutoTuner
impl Unpin for AutoTuner
impl UnsafeUnpin for AutoTuner
impl UnwindSafe for AutoTuner
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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