pub struct Simulator { /* private fields */ }Implementations§
Source§impl Simulator
impl Simulator
pub fn new(config: Config) -> Result<Self, String>
Sourcepub fn new_with_tokenizer(
config: Config,
tokenizer: Option<BatchTokenizerFn>,
) -> Result<(Self, Config), String>
pub fn new_with_tokenizer( config: Config, tokenizer: Option<BatchTokenizerFn>, ) -> Result<(Self, Config), String>
Create a new simulator with an optional batch tokenizer for dataset mode Returns the simulator and the potentially updated config (e.g., num_requests set from dataset)
Sourcepub fn run_with_callback<F>(&mut self, callback: F) -> Result<(), String>where
F: FnMut(ProgressInfo<'_>),
pub fn run_with_callback<F>(&mut self, callback: F) -> Result<(), String>where
F: FnMut(ProgressInfo<'_>),
Run the simulation with progress callbacks
pub fn get_metrics_summary(&mut self) -> MetricsSummary
pub fn get_time_series_data(&self) -> &[TimeSeriesPoint]
pub fn get_input_lengths(&self) -> &[u32]
pub fn get_output_lengths(&self) -> &[u32]
pub fn get_current_time(&self) -> f64
pub fn get_latency_samples( &self, ) -> ((&[f64], &[f64]), (&[f64], &[f64]), (&[f64], &[f64]))
Auto Trait Implementations§
impl Freeze for Simulator
impl RefUnwindSafe for Simulator
impl Send for Simulator
impl !Sync for Simulator
impl Unpin for Simulator
impl UnwindSafe for Simulator
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