For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
DistributedReduceScatterSum
struct DistributedReduceScatterSum
Registers the mo.distributed.reducescatter.sum graph op with the graph compiler.
Implemented traitsβ
Methodsβ
executeβ
static def execute[dtype: DType, rank: Int, target: StringSlice[ImmStaticOrigin], _trace_name: StringSlice[ImmStaticOrigin], axis: Int = Int(0), group_size: Int = Int(0)](outputs: _FusedOutputVariadicTensors[static_specs=outputs.static_specs], inputs: VariadicTensors[IOSpec[_, _].Input, static_specs=inputs.static_specs], signal_buffers: VariadicTensors[IOSpec[_, _].MutableInput, static_specs=signal_buffers.static_specs], dev_ctxs_input: DeviceContextArray)
Distributed reduce-scatter operation implementation for sum reduction.
Limitations: - Maximum of 8 GPUs supported (matches MAX_GPUS in comm/sync.mojo) - Tensor element count must be multiple of SIMD width - Requires identical tensor shapes within each reduce-scatter group
Parameters:
- βdtype (
DType): Element type of the input and output tensors. - βrank (
Int): Tensor rank (number of dimensions) of the inputs and outputs. - βtarget (
StringSlice[ImmStaticOrigin]): Target device string for tracing. - β_trace_name (
StringSlice[ImmStaticOrigin]): Trace name for profiling. - βaxis (
Int): Axis along which to scatter the reduced result (defaults to 0). - βgroup_size (
Int): Number of devices per reduce-scatter group; must be at least 1 and must evenly divide the total number of devices (defaults to 0).
Args:
- βoutputs (
_FusedOutputVariadicTensors[static_specs=outputs.static_specs]): Output tensors (one per GPU) to store scattered reduced results. - βinputs (
VariadicTensors[IOSpec[_, _].Input, static_specs=inputs.static_specs]): Input tensors (one per GPU) containing values to reduce. - βsignal_buffers (
VariadicTensors[IOSpec[_, _].MutableInput, static_specs=signal_buffers.static_specs]): Preallocated synchronization buffers for cross-GPU coordination. - βdev_ctxs_input (
DeviceContextArray): Device contexts for participating GPUs.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!