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 struct
KernelContext
struct KernelContext[num_clc_pipeline_stages: Int, cta_group: Int, CLUSTER_M: Int, CLUSTER_N: Int]
Shared kernel state: election vars, CTA coords, multicast masks, pipeline states.
Parametersβ
- βnum_clc_pipeline_stages (
Int): Number of CLC pipeline stages managed by the scheduler work iterator. - βcta_group (
Int): Number of CTAs that cooperate as a single group, either 1 or 2 for dual-CTA (2SM) mode. - βCLUSTER_M (
Int): Number of CTAs in the cluster along the M dimension. - βCLUSTER_N (
Int): Number of CTAs in the cluster along the N dimension.
Fieldsβ
- βelect_one_warp (
Bool): - βelect_one_thread (
Bool): - βelect_one_cta (
Bool): - βis_first_cta_in_cluster (
Bool): - βwarp_id (
UInt32): - βrank_m (
Int): - βrank_n (
Int): - βpeer_cta_coord (
Tuple[Int, Int, Int]): - βa_multicast_mask (
UInt16): - βb_multicast_mask (
UInt16): - βmma_complete_mask (
Int): - βptr_tmem_addr (
Pointer[UInt32, MutUntrackedOrigin, address_space=AddressSpace.SHARED, _safe=False]):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyDeletable,
Movable
comptime membersβ
TmemAddrArrayβ
comptime TmemAddrArray = SMemArray[UInt32, Int(1)]
Methodsβ
__init__β
def __init__(out self, ptr_tmem_addr: Pointer[UInt32, MutUntrackedOrigin, address_space=AddressSpace.SHARED, _safe=False])
Initialize context from TMEM pointer; computes all derived state.
Args:
- βptr_tmem_addr (
Pointer[UInt32, MutUntrackedOrigin, address_space=AddressSpace.SHARED, _safe=False]): Shared-memory pointer to the TMEM address used by the epilogue warps.
def __init__(out self, tmem_addr: SMemArray[UInt32, Int(1)])
Initialize context from typed TMEM address array.
Args:
- βtmem_addr (
SMemArray[UInt32, Int(1)]): Typed TMEM address array to initialize the context from.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!