FBTriton View on GitHub ↗

TLX documentation

TLX on gfx942 (MI300)

Supported ops and extension builtins on AMD MI300.

MI300X: CDNA3 MFMA, per-CU LDS, explicit buffer loads. The catalog GEMM stages through registers with direct buffer loads plus explicit LDS. The compiler also supports direct-to-LDS copies with 32-bit per-lane transfers. Tags follow tlx.md.

Supported tlx.ops

OpVariantImplDtypesRequiresBackwardWhat it does
mmdirect_loadmm/gfx942.py:mmfloat16—noDirect-load GEMM: register-staged buffer loads + explicit LDS, hand-pinned MFMA layouts; intra-CTA K-split for short-M; N-edge panels share one A tile. No descriptor alignment constraints.
addmmfused_gemmaddmm/gfx942.py:addmmfloat16—noThin fused-bias wrapper over the mm direct-load path: one kernel does GEMM+bias.
mm_torchtlxinductor_gfx942_mminductor/gfx942_torch:mmfloat16—noInductor template entry so the gfx942 GEMM participates in PT2 template selection, autotuning, and fusion.
addmm_torchtlxinductor_gfx942_addmmaddmm/gfx942_torch:addmmfloat16—noInductor template entry for fused GEMM+bias on gfx942.

Supported extension builtins (tlx.*)

Same cross-backend set as gfx950, minus the gfx950-only items below.

Scalars, types, diagnostics

BuiltinPurpose
assume_uniformAssert scalar wave-uniform (v_readfirstlane)
zerosZero tensor, optional explicit register layout
dtype_of / size_ofElement type / byte size (host-side)
get_fp8_format_namee5m2/e4m3 for scaled-MMA format args
clock6464-bit hardware timer read
assert_same_layout / dump_layoutLayout assert / compile-time layout log

Local memory

BuiltinPurpose
local_alloc / local_view / local_sliceMulti-buffer alloc, index subview, same-rank slice
local_store / local_loadRegisters to/from LDS buffer
local_gather / local_scatterIndexed gather/scatter along an axis
storage_alias_specSized/unsized shared-buffer alias spec
buffered_tensor / buffered_tensor_typeMemory-backed buffer value and its type

AMD buffer ops

Register-staged loads are the primary path on this target (mm/gfx942.py uses buffer_load for all operand traffic).

BuiltinPurpose
buffer_load / buffer_storeGlobal access via scalar base + i32 offsets
buffer_atomic_addFP16/FP32/FP64/int32/int64 buffer addition; BF16 is rejected on gfx942
buffer_load_to_localDirect global-to-LDS buffer copy; 32-bit per-lane transfer required

FP16 atomics require two contiguous elements per thread and a pair-uniform mask. These limits follow the target feature checks and buffer-atomic lowering.

Layout control

BuiltinPurpose
local_trans / local_reshape / local_reinterpretMetadata-only descriptor transforms
require_layout / release_layoutPin / release register layouts
amd_mfma_layoutMFMA distributed layout, versions 1-4
dot_operand_layoutExplicit MFMA dot-operand view
require_amd_wmma_layoutPin tensor to explicit WMMA layout
slice_layout / layoutRank-reduced view / user Shape:Stride layout
layout_encoding / shared_layout_encodingBase layout classes
swizzled_shared_layout_encoding / swizzled_layoutSwizzled LDS layouts
padded_shared_layout_encodingPadded LDS layout (bank-conflict relief)
shared_linear_layout_encodingExplicit linear SMEM mapping
DummyRegisterLayoutEncodingPlaceholder layout resolved post-inline
storage_kindBuffer storage selector enum
reuse_group / reuse_group_type / reuse_group_ir_typeBuffer overlap trees for aliasing
storage_alias_spec_type / storage_alias_spec_type_classAlias-spec MLIR types

Compute and register control

BuiltinPurpose
dot_scaledScaled dot with optional tile schedule
amd_scheduled_mfmaNative MFMA chains (persistent needs VGPR on gfx942)
amd_mfma_commitWave-local MFMA completion boundary
amd_register_residentConstrain packed register groups (AGPR/VGPR)
amd_register_class_anchorPer-register tied allocator anchor

Synchronization

BuiltinPurpose
alloc_barriers / alloc_warp_barrierAllocate SMEM / warp barriers
barrier_wait / barrier_arrivePhase wait / arrival (arrive_count must be 1)
cluster_barrierSync all threads in all cluster CTAs
cond_barrierConditional s_barrier phase-shift primitive
workgroup_barrierFull workgroup barrier + LDS fence
mbarrier / mbarrier_typeBarrier values and types
async_tokenTracks async-op completion
allocate_tensor_descriptor128B-aligned descriptor scratch (host-side alloc)

Scheduling and threads

BuiltinPurpose
amd_sched_barrierCompiler scheduling marker (no sync/fence)
amd_iglp_optIGLP interleave hint
warp_predicateExecute body under per-lane predicate
cluster_cta_rank / cluster_size_1dCTA rank / cluster size
thread_id / num_warpsThread id / kernel warp count
warp_all / warp_anyLane votes

Copy and scheduling limits

async_load and its commit/wait groups have an AMD lowering on gfx942. Direct-to-LDS copies require a legal 32-bit per-lane transfer; pointer-based copies can fall back to a synchronous transfer. See async memory access.
extract_slice and rematerialized_range have target-independent AMD lowering; they are not restricted to gfx950. See the slice lowering and range lowering.
warp_pipeline_stage accepts HIP targets, including gfx942, but its existing target-specific examples exercise gfx950/gfx1250. Source availability is not a gfx942 runtime validation claim; see the pipeline implementation.
TDM descriptor operations (async_amd_descriptor_*) require the gfx1250 target family and are rejected on gfx942.