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 function

allgather_rmsnorm_quant

def allgather_rmsnorm_quant[in_dtype: DType, ngpus: Int, in_layout: TensorLayout, in_origin: Origin[mut=in_origin.mut], //, quant_epilogue: def[width: Int](row: Int, col: Int, val: SIMD[in_dtype, width]) capturing thin -> None, domain_id: Int = Int(0)](input_buffers: Array[TileTensor[in_dtype, in_layout, in_origin], ngpus], normed_out: TileTensor[in_dtype, Storage=normed_out.Storage, address_space=normed_out.address_space, linear_idx_type=normed_out.linear_idx_type], sum_out: TileTensor[in_dtype, Storage=sum_out.Storage, address_space=sum_out.address_space, linear_idx_type=sum_out.linear_idx_type], gamma: TileTensor[in_dtype, Storage=gamma.Storage, address_space=gamma.address_space, linear_idx_type=gamma.linear_idx_type], epsilon: Float32, weight_offset: Scalar[in_dtype], rank_sigs: Array[Pointer[Signal, MutAnyOrigin], Int(8)], ctx: DeviceContext, local_rank: Optional[Int] = None)

allgather_rmsnorm that also hands each normed value to an epilogue.

The epilogue sees the bf16 that lands in normed_out, so a folded-in quantizer emits the same bytes one launch fewer. Caller-supplied because comm cannot depend on linalg (which already depends on comm).

Parameters:

  • in_dtype (DType): Input/output data type (bf16).
  • ngpus (Int): Number of GPUs participating.
  • in_layout (TensorLayout): Layout of the input shard TileTensors.
  • in_origin (Origin[mut=in_origin.mut]): Origin of the input shard TileTensors.
  • quant_epilogue (def[width: Int](row: Int, col: Int, val: SIMD[in_dtype, width]) capturing thin -> None): Normed-value epilogue; see _allgather_rmsnorm_impl.
  • domain_id (Int): Barrier counter bank; see _allgather_rmsnorm_impl.

Args: