ProfilerSink

Trait ProfilerSink 

Source
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§

Source

const ENABLED: bool = false

Whether the caller should pay profiling overhead on the hot path.

Provided Methods§

Source

fn begin_token(&mut self)

Start timing a new token forward pass.

Source

fn record_attention(&mut self, _layer: usize, _duration: Duration)

Record attention-kernel duration for layer.

Source

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.

Implementors§