docsapi referencedarkforest-cluster-ring-all_reduce_sum
API Referencecrate: darkforest-clustersince v0.1.0-alpha

all_reduce_sum

Executes scatter-reduce and all-gather phases across the ring.

all_reduce_sum

darkforest-cluster module: ring since v0.1.0-alpha

Signature

rust
pub fn all_reduce_sum(ring: &mut TcpRing, tensor: &mut Tensor) -> Result<(), ClusterError>

Overview

Executes scatter-reduce and all-gather phases across the ring.

Invariants & Design Principles

  • Invariant: Adheres strictly to Dark Forest 64-byte alignment and strided memory invariants.
  • Invariant: Verified via unit tests, Miri memory model, and PyTorch cross-checks.

Usage Example

rust
// Example calling all_reduce_sum
let _res = darkforest_cluster::ring::all_reduce_sum();

Related Components