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_pull_1stage_kernel
def broadcast_pull_1stage_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)
Single-stage pull broadcast kernel: each GPU reads root's input directly.
All GPUs participate in the start and end barriers; after the start barrier every GPU copies the root's input buffer to its own output buffer using a grid-strided vectorized load/store loop. This one-stage path is preferred for small messages (up to a few MiB) and for 2-GPU configurations where the 2-stage scatter/gather overhead is not justified.
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.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!