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 function
broadcast_multimem_kernel
def broadcast_multimem_kernel[dtype: DType, Layout: TensorLayout, BLOCK_SIZE: Int, ngpus: Int, simd_width: Int = simd_width_of[dtype, get_gpu_target()]()](output: TileTensor[dtype, Layout, MutAnyOrigin], input: TileTensor[dtype, Layout, ImmutAnyOrigin], rank_sigs: Array[Pointer[Signal, MutAnyOrigin, _safe=False], Int(8)], my_rank: Int, root: Int)
Broadcast kernel using multimem.st for multicast writes.
Root GPU writes to multicast address, data appears on all GPUs. Only root performs the stores; other GPUs just participate in barriers.
Parameters:
- βdtype (
DType): Element data type of the input and output tensors. - βLayout (
TensorLayout):TensorLayoutshared by both tensors. - βBLOCK_SIZE (
Int): Number of threads per thread block. - βngpus (
Int): Number of GPUs participating in the broadcast. - βsimd_width (
Int): Vector width used for memory access (defaults to the device-native SIMD width fordtype).
Args:
- βoutput (
TileTensor[dtype, Layout, MutAnyOrigin]): OutputTileTensorfor this GPU. - βinput (
TileTensor[dtype, Layout, ImmutAnyOrigin]): InputTileTensor(root's data, readable via P2P). - βrank_sigs (
Array[Pointer[Signal, MutAnyOrigin, _safe=False], Int(8)]): Per-GPUSignalpointers for barrier synchronization. - βmy_rank (
Int): Rank of this GPU in the communicator. - βroot (
Int): Rank of the source GPU whose data is broadcast to all GPUs.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!