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
DistributedBroadcast
struct DistributedBroadcast
Distributed broadcast: copy tensor from root GPU to all GPUs.
A single instance of this op handles all participating GPUs. It receives:
- input: The source tensor from the root GPU (P2P accessible)
- outputs: Destination tensors, one per GPU
- signal_buffers: Synchronization buffers for all participating GPUs
- dev_ctxs_input: Device contexts for all participating GPUs
Implemented traits
Methods
execute
static def execute[Outs: TypeList[Outs.values], Sigs: TypeList[Sigs.values], //, root: Int, _trace_name: StaticString](outputs: TensorTuple[*Outs.values], input: T, signal_buffers: TensorTuple[*Sigs.values], dev_ctxs_input: DeviceContextArray)
Execute distributed broadcast operation.
Limitations: - Maximum of 8 GPUs supported (MAX_GPUS). - Requires P2P access between GPUs (NVLink or PCIe P2P).
Parameters:
- Outs (
TypeList[values]): The element types ofoutputs(inferred). - Sigs (
TypeList[values]): The element types ofsignal_buffers(inferred). - root (
Int): Index of the root GPU (source of data). - _trace_name (
StaticString): Trace name for profiling.
Args:
- outputs (
TensorTuple[*Outs.values]): Output tensors (one per GPU) to store broadcast results. - input (
T): Input tensor from root GPU (P2P accessible from all GPUs). - signal_buffers (
TensorTuple[*Sigs.values]): Synchronization buffers for cross-GPU coordination. - dev_ctxs_input (
DeviceContextArray): Device contexts for participating GPUs.