pub struct ModelMonitor { /* private fields */ }Expand description
Central monitoring system for tracking model performance and resource usage
Implementations§
Source§impl ModelMonitor
impl ModelMonitor
pub fn new() -> Self
pub fn with_config(config: MonitoringConfig) -> Self
Sourcepub fn start_forward_pass(
&mut self,
batch_size: usize,
sequence_length: usize,
) -> Result<MonitoringSession>
pub fn start_forward_pass( &mut self, batch_size: usize, sequence_length: usize, ) -> Result<MonitoringSession>
Start monitoring a forward pass
Sourcepub fn track_attention(
&mut self,
session: &MonitoringSession,
layer_idx: usize,
attention_weights: &Tensor,
input_tokens: Option<&[String]>,
) -> Result<()>
pub fn track_attention( &mut self, session: &MonitoringSession, layer_idx: usize, attention_weights: &Tensor, input_tokens: Option<&[String]>, ) -> Result<()>
Track attention weights for visualization
Sourcepub fn track_memory(
&mut self,
session: &MonitoringSession,
checkpoint: &str,
) -> Result<MemorySnapshot>
pub fn track_memory( &mut self, session: &MonitoringSession, checkpoint: &str, ) -> Result<MemorySnapshot>
Track memory usage at a specific point
Sourcepub fn end_session(
&mut self,
session: MonitoringSession,
) -> Result<MonitoringReport>
pub fn end_session( &mut self, session: MonitoringSession, ) -> Result<MonitoringReport>
End monitoring session and collect results
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable monitoring
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Get current monitoring status
Trait Implementations§
Source§impl Clone for ModelMonitor
impl Clone for ModelMonitor
Source§fn clone(&self) -> ModelMonitor
fn clone(&self) -> ModelMonitor
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 ModelMonitor
impl Debug for ModelMonitor
Auto Trait Implementations§
impl Freeze for ModelMonitor
impl RefUnwindSafe for ModelMonitor
impl Send for ModelMonitor
impl Sync for ModelMonitor
impl Unpin for ModelMonitor
impl UnsafeUnpin for ModelMonitor
impl UnwindSafe for ModelMonitor
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> 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