Skip to main content

Zero3PerformanceStats

Struct Zero3PerformanceStats 

Source
pub struct Zero3PerformanceStats {
Show 13 fields pub forward_passes: u64, pub backward_passes: u64, pub optimizer_steps: u64, pub total_forward_time: Duration, pub total_backward_time: Duration, pub total_optimizer_time: Duration, pub parameter_transfer_time: Duration, pub gradient_sync_time: Duration, pub layer_timings: HashMap<String, LayerTimingStats>, pub throughput_metrics: ThroughputMetrics, pub memory_transfer_metrics: MemoryTransferMetrics, pub communication_stats: CommunicationStats, pub optimization_efficiency: OptimizationEfficiency,
}
Expand description

Comprehensive performance statistics for ZeRO-3 operations

Tracks all aspects of ZeRO-3 performance including:

  • Forward and backward pass timing
  • Parameter transfer and optimization statistics
  • Memory management performance
  • Distributed synchronization metrics
  • Throughput and efficiency measurements

Fields§

§forward_passes: u64

Number of forward passes completed

§backward_passes: u64

Number of backward passes completed

§optimizer_steps: u64

Number of optimizer steps completed

§total_forward_time: Duration

Total time spent in forward passes

§total_backward_time: Duration

Total time spent in backward passes

§total_optimizer_time: Duration

Total time spent in optimizer steps

§parameter_transfer_time: Duration

Time spent transferring parameters between CPU/GPU

§gradient_sync_time: Duration

Time spent synchronizing gradients across ranks

§layer_timings: HashMap<String, LayerTimingStats>

Per-layer execution timings

§throughput_metrics: ThroughputMetrics

Throughput metrics

§memory_transfer_metrics: MemoryTransferMetrics

Memory transfer performance

§communication_stats: CommunicationStats

Distributed communication statistics

§optimization_efficiency: OptimizationEfficiency

Optimization efficiency metrics

Implementations§

Source§

impl Zero3PerformanceStats

Source

pub fn new() -> Self

Create new performance statistics

Source

pub fn record_forward_pass(&mut self, duration: Duration, num_tokens: usize)

Record a completed forward pass

Source

pub fn record_backward_pass(&mut self, duration: Duration, num_tokens: usize)

Record a completed backward pass

Source

pub fn record_optimizer_step(&mut self, duration: Duration, num_params: usize)

Record a completed optimizer step

Source

pub fn record_layer_execution(&mut self, layer_name: String, duration: Duration)

Record layer execution timing

Source

pub fn record_layer_backward(&mut self, layer_name: String, duration: Duration)

Record layer backward pass timing

Source

pub fn record_parameter_transfer( &mut self, duration: Duration, bytes_transferred: usize, direction: TransferDirection, )

Record parameter transfer operation

Source

pub fn record_gradient_sync( &mut self, duration: Duration, num_gradients: usize, world_size: usize, )

Record gradient synchronization

Source

pub fn record_communication( &mut self, operation: CommunicationOperation, duration: Duration, bytes: usize, )

Record distributed communication operation

Source

pub fn average_forward_time(&self) -> Duration

Get average forward pass time

Source

pub fn average_backward_time(&self) -> Duration

Get average backward pass time

Source

pub fn average_optimizer_time(&self) -> Duration

Get average optimizer step time

Source

pub fn get_tokens_per_second(&self) -> f64

Get tokens per second throughput

Source

pub fn get_memory_bandwidth_gbps(&self) -> f64

Get memory transfer bandwidth in GB/s

Source

pub fn get_communication_efficiency(&self) -> f64

Get communication efficiency metrics

Source

pub fn get_training_efficiency(&self) -> f64

Get overall training efficiency score (0.0 to 1.0)

Source

pub fn get_performance_summary(&self) -> PerformanceSummary

Get detailed performance summary

Source

pub fn reset(&mut self)

Reset all statistics

Source

pub fn merge(&mut self, other: &Zero3PerformanceStats)

Merge statistics from another instance (useful for distributed aggregation)

Trait Implementations§

Source§

impl Clone for Zero3PerformanceStats

Source§

fn clone(&self) -> Zero3PerformanceStats

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Zero3PerformanceStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Zero3PerformanceStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more