pub struct BenchLimits {
pub warmup_loops: usize,
pub warmup_time: Duration,
pub max_loops: usize,
pub max_time: Duration,
}Fields§
§warmup_loops: usize§warmup_time: Duration§max_loops: usize§max_time: DurationImplementations§
Source§impl BenchLimits
impl BenchLimits
pub fn warmup( &self, runnable: &Arc<dyn Runnable>, inputs: &RunTensors, ) -> TractResult<()>
pub fn bench( &self, runnable: &Arc<dyn Runnable>, inputs: &RunTensors, ) -> TractResult<(usize, Duration)>
Source§impl BenchLimits
impl BenchLimits
Sourcepub fn bench_streams(
&self,
runnable: &Arc<dyn Runnable>,
inputs: &RunTensors,
streams: usize,
) -> TractResult<StreamsBench>
pub fn bench_streams( &self, runnable: &Arc<dyn Runnable>, inputs: &RunTensors, streams: usize, ) -> TractResult<StreamsBench>
One saturating loop per stream: streams threads, a state each, every one
of them feeding turns as fast as it can until the limits run out. The
limits are per stream, the wall clock is shared.
This is what an autobatch runtime is compared against: the same load offered
to the plain runtime is streams independent states running side by
side.
Sourcepub fn bench_streams_paced(
&self,
runnable: &Arc<dyn Runnable>,
inputs: &RunTensors,
streams: usize,
pacing: &Pacing,
) -> TractResult<PacedBench>
pub fn bench_streams_paced( &self, runnable: &Arc<dyn Runnable>, inputs: &RunTensors, streams: usize, pacing: &Pacing, ) -> TractResult<PacedBench>
One paced loop per stream: streams threads, a state each, every one of
them owing a turn every period of the wall clock, the way a live stream
does. Turn n of a stream is due at a fixed offset from its first, so a
turn which runs long does not push the ones behind it back – the stream
catches up or falls further behind, and added is what says which.
Streams are phased evenly over one period. Each session runs one turn before the clock starts, so the buffers a first turn allocates are not charged to the load.
Under churn a stream is a seat in a steady population rather than one
session: it holds a session for a draw around hold, gives it up, and
admits another in its place, so the lanes turn over while the load does
not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BenchLimits
impl RefUnwindSafe for BenchLimits
impl Send for BenchLimits
impl Sync for BenchLimits
impl Unpin for BenchLimits
impl UnsafeUnpin for BenchLimits
impl UnwindSafe for BenchLimits
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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