pub struct ModelProfiler { /* private fields */ }Expand description
Comprehensive model profiler for performance analysis
Implementations§
Source§impl ModelProfiler
impl ModelProfiler
Sourcepub fn new(config: ProfilerConfig) -> Result<Self>
pub fn new(config: ProfilerConfig) -> Result<Self>
Create a new model profiler
Sourcepub fn start_profiling(&mut self, model_id: &str) -> Result<String>
pub fn start_profiling(&mut self, model_id: &str) -> Result<String>
Start profiling a model
Sourcepub fn stop_profiling(&mut self, session_id: &str) -> Result<ProfilingResult>
pub fn stop_profiling(&mut self, session_id: &str) -> Result<ProfilingResult>
Stop profiling and generate results
Sourcepub fn record_layer_execution(
&mut self,
session_id: &str,
layer_name: &str,
layer_type: &str,
forward_time: Duration,
memory_usage: LayerMemoryUsage,
input_shapes: Vec<Vec<usize>>,
output_shapes: Vec<Vec<usize>>,
) -> Result<()>
pub fn record_layer_execution( &mut self, session_id: &str, layer_name: &str, layer_type: &str, forward_time: Duration, memory_usage: LayerMemoryUsage, input_shapes: Vec<Vec<usize>>, output_shapes: Vec<Vec<usize>>, ) -> Result<()>
Record a layer execution
Sourcepub fn record_memory_snapshot(
&mut self,
session_id: &str,
snapshot: MemorySnapshot,
) -> Result<()>
pub fn record_memory_snapshot( &mut self, session_id: &str, snapshot: MemorySnapshot, ) -> Result<()>
Record a memory snapshot
Sourcepub fn record_operation(
&mut self,
session_id: &str,
trace: OperationTrace,
) -> Result<()>
pub fn record_operation( &mut self, session_id: &str, trace: OperationTrace, ) -> Result<()>
Record an operation trace
Sourcepub fn get_active_sessions(&self) -> Vec<String>
pub fn get_active_sessions(&self) -> Vec<String>
Get active profiling sessions
Sourcepub fn get_completed_profiles(&self) -> &HashMap<String, ProfilingResult>
pub fn get_completed_profiles(&self) -> &HashMap<String, ProfilingResult>
Get completed profiling results
Auto Trait Implementations§
impl Freeze for ModelProfiler
impl RefUnwindSafe for ModelProfiler
impl Send for ModelProfiler
impl Sync for ModelProfiler
impl Unpin for ModelProfiler
impl UnsafeUnpin for ModelProfiler
impl UnwindSafe for ModelProfiler
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