pub trait ProfilerSink {
const ENABLED: bool = false;
// Provided methods
fn begin_token(&mut self) { ... }
fn record_attention(&mut self, _layer: usize, _duration: Duration) { ... }
fn record_ffn(&mut self, _layer: usize, _duration: Duration) { ... }
}Expand description
Sink trait used by the model to surface per-layer timings without committing to a particular profiler implementation.
Provided Associated Constants§
Provided Methods§
Sourcefn begin_token(&mut self)
fn begin_token(&mut self)
Start timing a new token forward pass.
Sourcefn record_attention(&mut self, _layer: usize, _duration: Duration)
fn record_attention(&mut self, _layer: usize, _duration: Duration)
Record attention-kernel duration for layer.
Sourcefn record_ffn(&mut self, _layer: usize, _duration: Duration)
fn record_ffn(&mut self, _layer: usize, _duration: Duration)
Record feed-forward duration for layer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.