IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

BundledAllReduceSum

struct BundledAllReduceSum

Registers the mo.bundled.allreduce.sum graph op with the graph compiler.

Implemented traits​

AnyType, ImplicitlyDeletable

Methods​

execute​

static def execute[dtype: DType, rank: Int, target: StringSlice[ImmStaticOrigin], _trace_name: StringSlice[ImmStaticOrigin]](output: ManagedTensorSlice[IOSpec[_, _].FusedOutput, static_spec=output.static_spec], inputs: VariadicTensors[IOSpec[_, _].Input, static_specs=inputs.static_specs], signal_buffers: VariadicTensors[IOSpec[_, _].MutableInput, static_specs=signal_buffers.static_specs], ctx: DeviceContext)

Per-device allreduce sum, for use with mo.parallel dispatch.

Unlike DistributedAllReduceSum which dispatches to all GPUs internally, this kernel handles a single GPU. The mo.parallel framework is responsible for launching one instance per device and passing all N input buffers to each launch.

Parameters:

  • ​dtype (DType): Element type of the input and output tensors.
  • ​rank (Int): Number of dimensions in the input and output tensors.
  • ​target (StringSlice[ImmStaticOrigin]): Target device identifier for code generation.
  • ​_trace_name (StringSlice[ImmStaticOrigin]): Trace name used for profiling and debugging.

Args: