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β
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:
- βoutput (
ManagedTensorSlice[IOSpec[_, _].FusedOutput, static_spec=output.static_spec]): Output tensor for THIS GPU. - βinputs (
VariadicTensors[IOSpec[_, _].Input, static_specs=inputs.static_specs]): Input tensors from ALL participating GPUs. - βsignal_buffers (
VariadicTensors[IOSpec[_, _].MutableInput, static_specs=signal_buffers.static_specs]): Signal buffers for ALL participating GPUs. - βctx (
DeviceContext): Device context for THIS GPU.