Module profiler

Module profiler 

Source
Expand description

Profiling & Benchmarking — op-level timing, memory tracking, model summaries.

Structs§

BenchmarkResult
Result of benchmarking a model’s forward pass.
MemoryTracker
Tracks tensor memory allocations for profiling.
ModelSummary
Summary statistics for a model.
ProfileEntry
Aggregated statistics for a single event name.
ProfileEvent
A single profiling event with a name, duration, and optional metadata.
ProfileReport
A formatted profiling report, printed with Display.
Profiler
A lightweight profiler that collects named timing events.
ScopedTimer
An RAII timer guard. Drops into a profiler automatically.
Stopwatch
A simple stopwatch for manual timing.

Functions§

benchmark_forward
Benchmark a model’s forward pass.
benchmark_forward_backward
Benchmark forward + backward pass.
estimate_model_memory
Estimate the memory usage of a module’s parameters in bytes.
format_bytes
Format bytes into a human-readable string (B, KB, MB, GB).