FBTriton View on GitHub ↗

TLX documentation

TLX on sm100 (Blackwell)

Supported ops and extension builtins on NVIDIA Blackwell.

B200-class GPUs: TMA descriptors with multicast, tcgen05 async MMA with TMEM accumulators and scales, 2-CTA clusters, Cluster Launch Control (CLC), warp specialization with async_task regions, and microscaling (FP4/FP8) datatypes. Tags follow tlx.md.

Supported tlx.ops

OpVariantImplDtypesRequiresBackwardWhat it does
mmwsmm/sm100.py:mmfloat16tma, tmemnoPersistent warp-specialized GEMM: TMA producers, tcgen05 consumers, TMEM-lived accumulators, CLC launch control, TMA epilogue stores, split-K reduce.
mm_bias_gradws_wgrad_biasmm_bias_grad/sm100.py:mm_bias_grad—tma, tmemnoHorizontally fused GEMM weight-gradient + bias-grad rowsum sharing dout tiles; TMEM-drain epilogue; fused split-K+bias reduce.
addmmtma_wsaddmm/sm100.py:addmmfloat16—noPersistent WS GEMM+bias with TMA stores, tcgen05 commit tracking, CLC-coordinated producers; direct-load baseline included.
grouped_gemmwsgrouped_gemm/sm100.py:grouped_gemm—tma, tmemnoOne persistent WS kernel over all groups with per-group TMA descriptors built on-device.
mm_mxfp8ws_mxfp8mm_mxfp8/sm100.py:mm_mxfp8—tma, tmemnoMXFP8 GEMM: B-resident overlap, scaled tcgen05 MMA, TMEM scales via tmem_copy, LDS aliasing across phases.
grouped_gemm_mxfp8ws_persistent_mxfp8grouped_gemm_mxfp8/sm100.py:grouped_gemm_mxfp8—tma, tmemnoPersistent grouped MXFP8 pipeline with explicit fetch/wait/signal tile protocol; scaled MMA throughout.
mm_torchtlxinductor_blackwell_gemm_wsinductor/sm100_torch:mmfloat16tma, tmemnoInductor template entry for the Blackwell WS GEMM.
flash_attnws_pipelined_persistentflash_attn/sm100.py:flash_attnfloat16tma, tmemyesFA4-style attention: TMEM accumulators, 1CTA/2CTA MMA paths, TMA multicast, CLC, ballot-built causal masks.
flash_attn_mxfp8ws_pipelined_persistent_mxfp8flash_attn_mxfp8/sm100.py:flash_attn_mxfp8bfloat16tma, tmemyesMXFP8 attention: scaled tcgen05 MMA both dots, dual-scale 32x32 Q layout, TMEM scale handling.
hstu_attn_devwshstu_attn/sm100.py:hstu_attnfloat16tma, tmemyesHSTU attention: WS forward with softmax/SiLU/correction inner loops + biases; backward recomputes QK/probs per activation path.
kimi_delta_attentionwskda/sm100.py:kimi_delta_attentionfloat16tma, tmemyesChunkwise Delta Attention forward (chunk matmuls + WY inverse) and VJP-scan backward with TMEM/TMA staging.

Supported extension builtins (tlx.*)

Scalars, types, diagnostics

BuiltinPurpose
assume_uniformScalar uniformity assert (no-op on NV)
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
stoch_roundStochastic-round FP32 to FP8/BF16/F16 (cvt.rs)

Local and tensor memory

BuiltinPurpose
local_allocAllocate num SMEM/TMEM buffers
local_view / local_slice / subsliceBuffer subviews (TMEM delegates to subslice)
local_store / local_loadRegisters to/from local/TMEM buffer
local_gather / local_scatterIndexed gather/scatter along an axis
tmem_copyAsync SMEM-to-TMEM copy incl. packed scales
tmem_shiftShift TMEM rows down one, async
storage_alias_specSized/unsized shared-buffer alias spec
buffered_tensor / buffered_tensor_typeMemory-backed buffer value and its type

Async copy and descriptors (TMA)

BuiltinPurpose
async_load / async_load_commit_group / async_load_wait_groupcp.async global-to-SMEM pipeline
async_storeAsync SMEM-to-global bulk copy
async_descriptor_loadTMA global-to-SMEM load tracked by barrier
async_descriptor_gather / async_descriptor_scatterTMA row gather/scatter
async_descriptor_store / async_descriptor_store_waitTMA store + wait
async_descriptor_prefetch_tensor / prefetchL2 prefetch hints
allocate_tensor_descriptor128B-aligned descriptor scratch
make_tensor_descriptor / reinterpret_tensor_descriptorCreate / reinterpret TMA descriptors
tensor_descriptor_ptr / tensor_descriptor_ptr_typeDescriptor pointer values and types

Layout control

BuiltinPurpose
local_trans / local_reshape / local_reinterpretMetadata-only descriptor transforms
require_layout / release_layoutPin / release register layouts
dot_scaledScaled dot with optional tile schedule
slice_layout / layoutRank-reduced view / user Shape:Stride layout
layout_encoding / shared_layout_encodingBase layout classes
swizzled_shared_layout_encoding / swizzled_layoutSwizzled SMEM layouts
padded_shared_layout_encodingPadded SMEM layout
shared_linear_layout_encodingExplicit linear SMEM mapping
DummyRegisterLayoutEncodingPlaceholder layout resolved post-inline
nv_mma_shared_layout_encodingNVIDIA shared-memory layout used by Blackwell TMA and MMA operands
tensor_memory_layout_encoding / make_tensor_memory_layoutTMEM layouts
tensor_memory_scales_layout_encoding / make_tensor_memory_scales_layoutTMEM scale layouts
TMemCTAModeTMEM CTA-mode enum
storage_kindBuffer storage selector (smem/tmem/smemCluster)
reuse_group / reuse_group_type / reuse_group_ir_typeBuffer overlap trees
storage_alias_spec_type / storage_alias_spec_type_classAlias-spec MLIR types

Async compute

BuiltinPurpose
async_dotWarp-group async MMA (tcgen05)
async_dot_scaledAsync scaled MMA with FP4/FP8 scales
async_dot_waitWait for prior async dots
tcgen05_commitTrack tcgen05 ops on a dedicated barrier

Synchronization

BuiltinPurpose
alloc_barriers / alloc_warp_barrierSMEM / warp / cluster barriers
barrier_expect_bytes / barrier_wait / barrier_arriveExpect-tx, wait, arrive (multicast capable)
remote_viewMap barrier into another cluster CTA
remote_shmem_store / async_remote_shmem_store / async_remote_shmem_copyCross-CTA SMEM access
named_barrier_wait / named_barrier_arriveHardware named barriers (ids 3-15)
cluster_barrier / fence_mbarrier_init_clusterCluster sync / init fence
fence / fence_async_sharedMemory and proxy fences
mbarrier / mbarrier_type / async_tokenBarrier values, types, completion tokens

Warp specialization, votes, clusters

BuiltinPurpose
async_task / async_tasksWarp-specialized task regions and grouping
async_task_replica_idReplica id inside an async region
warp_all / warp_any / warp_reduxVotes and warp reductions (redux.sync)
vote_ballot_syncWarp ballot bitmask
clc_create_context / clc_producer / clc_consumerCluster Launch Control pipeline
clc_response / clc_response_type / CLCPipelineContextCLC response values and aggregate state
cluster_cta_rank / cluster_size_1dCTA rank / cluster size
thread_id / num_warpsThread id / kernel warp count

Notes

TMA descriptors need 16-byte-aligned row strides and a trailing

stride of 1; the mm/flash_attn catalog entries enforce this via accepts.

packed_add4, packed_sub4, packed_mul4, and packed_fma4 require SM103+ and PTX 9.4. They are rejected on SM100; the packed-arithmetic tests cover SM100 rejection and SM103 code generation.
nv_mma_layout describes a Hopper WGMMA register accumulator, not a Blackwell TMEM accumulator. Use tensor_memory_layout_encoding for Blackwell async_dot accumulators. This is distinct from nv_mma_shared_layout_encoding, which Blackwell uses for TMA and MMA shared-memory operands; see the compute implementation.