pub struct BackwardPassStep {
pub node_id: String,
pub op: String,
pub peer_contributions: HashMap<String, BackwardStepStatus>,
pub aggregated_gradient_cid: Option<String>,
pub started_at: Instant,
}Expand description
Tracks one layer’s backward pass across multiple peers
Fields§
§node_id: StringNode (layer) identifier
op: StringOperation type (e.g. “matmul”, “relu”)
peer_contributions: HashMap<String, BackwardStepStatus>Per-peer status map
aggregated_gradient_cid: Option<String>CID of the aggregated gradient (set after aggregation)
started_at: InstantWall-clock start time of this step
Implementations§
Source§impl BackwardPassStep
impl BackwardPassStep
Sourcepub fn record_gradient_received(&mut self, peer_id: &str, cid: &str)
pub fn record_gradient_received(&mut self, peer_id: &str, cid: &str)
Record that a gradient CID was received from peer_id
Sourcepub fn record_gradient_failed(&mut self, peer_id: &str, reason: &str)
pub fn record_gradient_failed(&mut self, peer_id: &str, reason: &str)
Record a failure for peer_id
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true when every peer has either received or failed
Sourcepub fn ready_to_aggregate(&self) -> bool
pub fn ready_to_aggregate(&self) -> bool
Returns true when all peers have received (no pending/failed)
Sourcepub fn received_count(&self) -> usize
pub fn received_count(&self) -> usize
Number of peers whose gradient has been received
Sourcepub fn failed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Number of peers that have failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BackwardPassStep
impl RefUnwindSafe for BackwardPassStep
impl Send for BackwardPassStep
impl Sync for BackwardPassStep
impl Unpin for BackwardPassStep
impl UnsafeUnpin for BackwardPassStep
impl UnwindSafe for BackwardPassStep
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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