Featured projects High-performance GPU kernels are rarely one-size-fits-all. Their optimization strategies are impacted by GPU architectures, tensor shapes and evolving real-world workload demand. Even SOTA kernels optimized for specific cases can be difficult to generalize and keep performant as hardware and workload requirements change. TLX.ops bridges this gap by turning SOTA, architecture-specific TLX kernels into reusable implementations. Its catalog spans GEMM (including low-precision and grouped variants), attention, MoE, normalization and fused operators. TLX.ops maintains rigorous correctness, performance and compile-time validation against shape lists derived from real-world workloads. In this blog, we provide detailed, first-principles walkthroughs of representative TLX.ops kernels, explaining how architecture capabilities and workload demands shape those kernels. The demonstrated GEMM kernels achieve up to 1.4x speedup over vendor libraries (cuBLAS/hipBLASLt). TLX.ops serves the following targeted users: For kernel engineers, the organized code base makes it easy to fork an existing kernel, build a variant, or contribute new implementations. For ML engineers, usage is as simple as from triton.tlx.ops import mm as tlx_mm; out = tlx_mm(a, b) For kernel-authoring agents, we will keep the source code symbolic and structurally consistent, making it easier for agents to understand, modify, and generate kernels. We also provide TLX-agents (to be covered in a future post) to enable co-evolution between the kernel library and kernel-authoring agents. Workload-Driven Performance Contract Rather than treating benchmark shapes as a static showcase of performance, TLX.ops maintains them as evolving optimization targets. This established an ongoing commitment to correctness, performance, and compile-time quality, guiding kernel optimization, validation, and regression detection. Kernel Deep Dives: Architecture-Specific Optimizations In this section, we walk through five kernels, four GEMMs and one LayerNorm, targeted at NVIDIA (Hopper/Blackwell) and AMD (MI300x/MI350x) GPUs. More examples are available in the fbtriton repo. Each subsection focuses on first-principles explanations of what/why and a short selection of shape-specific optimizations. Example 1. NVIDIA Blackwell GEMM On NVIDIA Blackwell, tcgen05 MMAs execute asynchronously, with accumulators residing in TMEM (256 KB per SM) rather than registers. Separate warps handle operand loading, MMA issuance and accumulator epilogues, creating opportunities for overlap but also synchronization challenges. Architectural Overview In a simple case (1-CTA, SPLIT_K=1, power-of-two BN), each CTA computes one BMxBN output tile. TMA copies A/B tiles from GMEM to an SMEM buffer ring. Tile A is split into MMA_GROUPS row slices and each slice runs an async tcgen05 MMA against the shared B tile into its own FP32 TMEM accumulator. The epilogue moves the accumulator to registers, stages it in SMEM buffers and writes them back with TMA stores. Figure-1: Architectural overview before the optimizations (1-CTA, split-K-free configuration) Asynchronous TMEM Hand-off and CLC scheduling The key challenge is to avoid Tensor Core idle time at tile boundaries. Waiting for the final tcgen05 MMAs to complete before notifying the epilogue would drain the MMA pipeline, even though the next tile can accumulate into a different TMEM buffer. Instead, tlx.tcgen05_commit asynchronously signals tmem_full upon MMA completion. With two or more TMEM buffers, the MMA warp then starts the next tile in another buffer. With one buffer, it waits on tmem_empty until the epilogue releases that buffer. Meanwhile, epilogue warps release each TMEM buffer once its last accumulator slice has been read into registers without waiting for the subsequent TMA stores. Cluster launch control (CLC) further reduces tile-boundary gaps by dynamically assigning pending tiles to available clusters. On 2-CTA FP16 1024×12800×1152, asynchronous commit reduced NCU-measured duration by 2.2% (#2008), with CLC scheduling contributing another 2.1% relative to its immediate baseline (#2251). Figure-2: Asynchronous TMEM hand-off and CLC scheduling Multi-CTA cooperation With NUM_CTAS=2, each CTA holds its own A rows, half of B, and its own accumulator, reducing B’s per-CTA SMEM footprint and TMA traffic. tlx.async_descriptor_load(..., two_ctas=True) routes both CTAs’ TMA completion to leader-side barriers. Only CTA 0 issues the cooperative cta_group::2 MMA through tlx.async_dot(..., two_ctas=True). Finally, tlx.tcgen05_commit(..., two_ctas=True) multicasts MMA completion notification to both CTAs, while both epilogues signal the leader’s tmem_empty barrier. The leader-only protocol eliminated per-K-step CTA synchronization, reducing dynamic instructions by 4.2% with approximately unchanged performance (#2291). Figure-3: Multi-CTA cooperation Deterministic Split-K for Under-Filled, Long-K Outputs In our workload, 38% of shapes have fewer 128×128 output tiles than SMs, most with K ≥ 100,000, leaving much of the GPU underutilized. Split-K partitions the K dimension into S ranges, creating S × num_mn_tiles independent work items that CLC schedules like ordinary output tiles. Each split writes its FP32 partial result to a separate workspace slab. A second kernel _reduce_k_kernel accumulates these partials in a fixed order and casts to the output dtype, ensuring run-to-run determinism without atomic reductions. # Simplified from _process_tile_epilogue_inner and _reduce_k_kernel split_id = tile_id // num_mn_tiles row_base = split_id * num_pid_m * BLOCK_SIZE_M # Store FP32 partial to the split's workspace slab # Reduction kernel: fixed accumulation order for s in range(SPLIT_K): acc += tl.load(workspace_ptr + base_offs + s * ROWS_PER_SPLIT * N, ...) tl.store(c_ptr + base_offs, acc.to(OUTPUT_DTYPE), ...) Configurations are heuristic picks from get_heuristic_config, computed on the CPU without launching kernels; the default space="full" autotunes each shape, so its measured winners may differ. Split-K increases parallelism for small outputs with long reduction dimensions, while 2-CTA configurations are favored for larger outputs. The 148-SM line marks a reference underutilization threshold for 128×128 tiles. Figure-4: Workload-driven configuration selection across 422 BF16 GEMM shapes Examples of Other Shape-Specific Optimizations Very tall outputs (M>>N): For example 32768×1024×1152. For 2-CTA clusters, pruning retains GROUP_SIZE_M=NUM_CTAS=2, so consecutive CTA pairs traverse the few N blocks while retaining the same two M blocks. This favors A reuse across nearby tiles while the small B remains L2-resident. (#958, #2294). Col-major operands: A is col-major in 200 out of 422 shapes, the TMA descriptor uses the transposed view and tlx.local_trans feeds the MMA without a copy (#1116). Tiny split-K outputs: (256×256×2433024) The reduction kernel uses a smaller 32×32 (instead of 128×128) block, so a 256×256 output launches 64 reduction CTAs instead of 4. (#1118) Tall, memory-bound outputs: For example 589824×2048×512. For GPU-saturated shapes with M/N > 4 and K ≤ 1.5·min(M,N), the heuristic favors narrower 256×128 tiles. Their smaller accumulators permit two TMEM buffers instead of one, overlapping the next tile’s MMAs with the current epilogue within the 256 KiB TMEM budget per SM (#960) One MMA group: With NUM_MMA_GROUPS=1, each MMA step consumes exactly one A tile and one B tile, so A and B share a single transaction-byte-counted full barrier per SMEM slot by having the producer set the combined byte count. (#2275) Non-power-of-two N: Split a NPOT tile into POT pieces (for example, 208=128+64+16), each with its own B ring, accumulator and MMA. Adjacent piece MMAs also share operand A in the TensorCore collector buffer. (#4161) Example 2. AMD MI350x GEMM MXFP8 Unlike Blackwell’s TMA-based warp specialization, MI350x schedules global-to-LDS copies, LDS reads, and MFMAs within each wave’s instruction stream. Efficient GEMM must therefore keep future K-step copies in flight while overlapping LDS reads with computation. MXFP8 adds one E8M0 scale byte per 32 E4M3 values along K. MI350x’s 16×16×128 scaled MFMA consumes scales from 32-bit registers, selecting one of four packed bytes through opSel. Bytewise LDS scale loads and subsequent permutations therefore add instruction overhead despite the small scale-data footprint. Register pressure is another constraint: a 256×256 output tile across eight waves requires 128 FP32 accumulator registers per lane, leaving limited capacity for operands, scales, and addresses. Figure-5: Architectural overview of MI350x GEMMs: (a) FP16/BF16 and (b) MXFP8 quadrant kernel Inter-wave pipelining The kernel uses eight waves, divided into two groups of four. Rather than assigning dedicated producer and consumer roles, both groups execute alternating mfma and mem stages. tlx.warp_pipeline_stage introduces conditional barriers that keep the groups one stage apart, allowing one group’s memory operations to overlap the other’s MFMAs. The mem stage receives higher hardware scheduling priority through s_setprio, helping keep operand delivery ahead of computation. Quadrant pipeline with direct-to-LDS copies The 256×256 output tile executes four 128×128 tl.dot_scaled quadrants in top-left → bottom-left → top-right → bottom-right order. Each operand half-tile has its own two-slot LDS ring, filled directly from global memory using tlx.buffer_load_to_local without register staging. Its 512-byte E8M0 scale atom shares an asynchronous commit group with 16 KiB of FP8 data, allowing one wait to cover both. The quadrant ordering maximizes operand reuse: each B half-tile feeds two consecutive quadrants, while each A half-tile remains in registers across an intervening quadrant. In the steady state, each sub-step combines one quadrant’s computation with an LDS read and a future global-to-LDS refill. Refills are issued six sub-steps ahead of consumption, with tlx.async_load_wait_group(5) controlling outstanding copy groups. tlx.amd_sched_barrier(0) additionally constrains compiler scheduling to keep LDS reads ahead of subsequent global refills. # From _quad_tile, hot-loop sub-step 0 tlx.async_load_wait_group(5) with tlx.warp_pipeline_stage("mfma", priority=0): acc_tl = tl.dot_scaled( a_top, sa_t, "e4m3", b_left, sb_l, "e4m3", acc_tl ) with tlx.warp_pipeline_stage("mem", priority=1): a_bot = tlx.local_load(smem_a_bot[0], relaxed=True) sa_b = _load_scale(smem_sa_bot[0], _SA_MFMA_LAYOUT, K_MAJOR) tlx.amd_sched_barrier(0) tlx.buffer_load_to_local(smem_b_left[0], b_left_base, b_left_off + ka) tlx.buffer_load_to_local(smem_sb_left[0], sb_left_base, sb_left_off + ks) tlx.async_load_commit_group() Figure-6: Quadrant pipeline and LDS buffer scheduling Scale Bytes in MFMA Consumption Order Each lane’s 32-bit scale register holds four E8M0 bytes for rows 32 apart, one per 16-row MFMA repeat. For example, (1) lane 37 reads scales for rows 5, 37, 69, and 101 at the same K-group and op_sel selects the appropriate byte for each repeat. (2) With sf_layout="cublas_blocked" (scales already in NVIDIA’s 128×4 swizzle, accepted for cross-vendor compatibility), the kernel avoids repacking, but these four bytes are 128 bytes apart in LDS, requiring four ds_read_u8 instructions and a v_perm (#3880). Natural scales already require repacking by the MI350x launcher. prepare_scales exploits this opportunity to store each 512-byte atom in K-major order, mapping byte (r, c) within the atom to: (r mod 32)⋅16 + c⋅4 + ⌊r/32⌋. The four required bytes become contiguous, allowing a single ds_read_b32 to replace four byte reads and a permutation. tlx.local_reinterpret exposes this arrangement. Both paths then load directly into the MFMA scale-register layout with tlx.local_load, avoiding a convert_layout through shared scratch memory that could race between the phase-shifted wave groups. # Simplified from _kmajor_scale_view / _load_scale view = _kmajor_scale_view(sa_buf) # 128×4 K-major atom sa = tlx.local_load( view, layout=_SA_MFMA_LAYOUT, relaxed=True ) Figure-7: Scale packing for efficient LDS reads Examples of Other Shape-Specific Optimizations Ragged M and N: For example, 129×257×256. On MI350x the public op accepts M and N that are not multiples of 128 (Blackwell requires 128-aligned rows); the generic tile wraps out-of-range rows and columns to valid ones and masks the store (#4348) Short or odd K: For example, 4096×4096×384. In the quadrant kernel, the pipelined loop covers an even number of 128-wide K-steps (here 2 of 3); the odd leftover step, or all of K when K = 128, runs as a cold tail with plain loads and no LDS ring (#3880). Large aligned problems: For example, 8192×8192×8192. The quadrant kernel is used only when whole 256×256 tiles (M, N multiples of 256), at least one tile per CU (M·N ≥ 4096²), 32-bit buffer offsets (128·K < 2³¹), and 16-byte-aligned pointers; any other shape uses a generic 128×128 tile (#4348). Example 3. NVIDIA Hopper GEMM Hopper supports TMA, warp specialization and async WGMMA, but has no TMEM. Compared with Blackwell, this introduces three important differences. First, register capacity constrains tile ownership. Due to the absence of TMEM, a single 4-warp group accumulating a 128×256 FP32 tile would require 256 registers per thread, exceeding Hopper’s 255-register limit. Therefore, we split the tile between two 4-warp consumer groups. Each group must drain its accumulator registers during epilogue before computing its next tile. Second, WGMMA completion is managed through tlx.async_dot_wait, which waits until at most N WGMMA groups remain outstanding, rather than Blackwell’s tcgen05_commit and completion mbarriers. Third, the kernel uses a static persistent grid without CLC or two-CTA cooperation. Cooperative consumers within a register budget To address the register-pressure constraint described above (#1), each CTA runs one TMA producer warp group and two consumer warp groups (replicate=2), each of which owns half the output tile’s rows. Unlike Blackwell GEMM, Hopper GEMM has no dedicated epilogue warp group. Each consumer has private A stages, while both share B stages: an A slot is released after one consumer arrives, but a B slot requires both (arrive_count=2). tlx.async_dot_wait(1) allows one WGMMA group to remain in flight while the previous stage’s buffers are released. with tlx.async_task(num_warps=4, replicate=2, registers=232): # consumers acc = tlx.async_dot(a_stage, b_stage, acc) acc = tlx.async_dot_wait(1, acc) # k-1 complete; k may remain outstanding tlx.barrier_arrive(empty_a_prev) # private A slot: one arrival tlx.barrier_arrive(empty_b_prev) # shared B slot: frees on the second arrival Examples of Other Shape-Specific Optimizations Skinny M: swap-AB. For M ≤ 64, two consumer groups would otherwise compute mostly padded rows. For example, M = 7 requires a 128-row tile, leaving the second consumer entirely on padding. Instead, the kernel computes Cᵀ = Bᵀ Aᵀ, mapping skinny M onto WGMMA’s N dimension. On 7×16384×4096, latency dropped from 84.8 to 78.6 µs, versus 81.7 µs for cuBLAS (#4265). Deterministic split-K and smaller tiles: For shapes such as 706×256×20992, the kernel uses smaller output tiles and divides K across CTAs to fill more SMs. FP32 partials are reduced in a fixed order, as in Blackwell GEMM. Split-K is limited to one wave of CTAs (tiles × splits ≤ SMs). Together, these changes reduced latency from 188 to 34.9 µs (#4249) Narrow N: L2 reuse and tile ordering. When N ≤ 1024, A loads use evict_last to preserve panels reused by neighboring N tiles. When N ≤ 512, the autotuner retains only row-major tile ordering to avoid unstable grouped-order performance. On 2000000×512×512, these refinements contributed to improved throughput (#3937). Partial waves: NPOT N tiles. Hopper WGMMA requires power-of-two N widths, but the kernel can compose widths such as 192 = 128 + 64 using separate WGMMA operations. On 706×8192×2560, a 128×192 tile reduces occupancy from 2.91 to 1.95 tile waves, improving per-configuration latency from 46.3 to 44.5 µs (#4355). Example 4. AMD MI300x GEMM Unlike MI350x kernels, the MI300x GEMM uses direct register loads and compiler-managed scheduling rather than explicit inter-wave pipelining. Two key distinctions shape its design: Narrower direct-to-LDS copies and much smaller LDS. MI300x supports up to 32-bit-per-lane direct-to-LDS loads (vs. 128 on MI350x) and provides 64 KiB of LDS per CU (vs. 160 KiB). Our tuned GEMM kernel therefore loads operands directly into registers without LDS staging. (#3503) Compiler-managed memory/computation overlap. The direct-load kernel uses Triton’s two-stage software pipeline and MI300x ‘s BlockPingpong pass to overlap memory instructions with MFMAs across waves. Although tlx.warp_pipeline_stage has a MI300x lowering path, it has not been evaluated for this kernel. Explicit three- and four-buffer LDS variants measured slower, with the 64 KiB LDS budget further limiting deeper buffering. Occupancy-aware Planning For underfilled GEMMs, _fill_plan chooses among direct, split-K, and Stream-K execution. It uses measured per-tile throughput and a wave-quantized cost model to compare direct and split-K configurations across 304 CUs: def wave_time(tile, tiles, k, rates): bm, bn, bk, _ = tile slots = 2 if bm * bn <= 8192 else 1 rounds = cdiv(tiles, 304 * slots) work = bm * bn * cdiv(k, bk) * bk return rounds * work / (rates[tile] * 1.23e12) # Direct GEMM: one workgroup per output tile direct_time = wave_time(tile, tiles, K, FILL_TILE_RATES) # Split-K: more workgroups, plus FP32 partials and reduction slice_k = cdiv(cdiv(K, bk), split) * bk split_time = ( wave_time(tile, tiles * split, slice_k, rates) + (split + 1) * M * N * 4 / 3e12 + 6e-6 ) Smaller tiles can schedule two workgroups per CU, reducing wave quantization at the cost of lower per-tile throughput. The planner compares eligible configurations using this model. For severely underfilled, long-K workloads, Stream-K instead distributes (tile, K-step) iterations evenly across 304 programs, with deterministic partial accumulation. Across the 81-shape evaluation, the planner covered 55 shapes, selecting direct tiles for 40, split-K for 14, and Stream-K for one (#4546). Examples of Other Shape-Specific Optimizations M = 7: intra-workgroup K splitting (LocalSplitU). For 7×8192×2048, only one output tile exists along M, limiting available workgroups. LocalSplitU uses smaller output tiles (BM=16, BN=32) and splits K across 16 waves within each workgroup. Each wave processes two of the 32 K tiles, writes its FP32 partial accumulator to LDS, then participates in a workgroup synchronization and local reduction. In full-space measurements, this raised performance from 0.38× to 0.93× of hipBLASLt; 7×2048×4096 improved from 0.36× to 0.97× (#3740). Ragged-K addmm: accumulator bias seeding. When K is not divisible by BLOCK_K and the bias is broadcast across rows, the kernel initializes the FP32 accumulator with the bias instead of adding it in the epilogue. This avoids an expensive epilogue layout conversion through LDS (#4546). XCD-Aware Tile Scheduling: MI300x distributes workgroups across eight XCDs, each with its own L2 cache slices. To improve operand locality, the kernel remaps complete groups of 64 workgroups so that each XCD receives eight consecutive logical tile IDs. The remapping preserves a bijection, while incomplete groups retain their original ordering (#3503). Stream-K: For example, 2032×2560×18688 produces only 160 output tiles with 256×128 tiling, leaving 144 of 304 CUs idle. Stream-K instead distributes 46,720 (tile, K-step) iterations across 304 programs, balancing the reduction work while preserving deterministic partial accumulation (#4546). Non-power-of-two M tiles: shared-B row panels. For FP16 MLP shapes such as 4662×2560×2560, a 160-row output tile is composed of 128-row and 32-row panels. Both panels reuse the same B operands while maintaining separate FP32 accumulators, reducing padding compared with 256-row tiles. The TorchTLX template also supports larger 320-row panels for this workload family (#4486). Example 5. NVIDIA Blackwell Layer Norm LayerNorm performs only a few arithmetic operations per element while moving at least four bytes per element for BF16 input and output. Each output also depends on its row’s mean and variance, so the kernel must retain the row on chip or read it again. Features in related models are often narrow: an N = 384 BF16 row occupies only 768 bytes. Coalescing, padded columns and load latency therefore shape the kernel, while Blackwell’s TMA and packed conversion instructions offer opportunities to overlap data movement and fuse the quantization needed by downstream GEMMs. Architectural Overview On the general path, each CTA owns BM rows and a BN = next_power_of_2(N) feature tile. Coalesced loads bring the input into registers, where FP32 reductions compute the mean, centered variance and reciprocal standard deviation. The same row values then feed normalization and the optional affine weight and bias before the output is stored. Mean and reciprocal standard deviation can be saved for backward. LayerNorm and RMSNorm share this implementation, with the compile-time IS_RMS flag removing mean subtraction for RMSNorm. Figure-8: Architectural overview of the general register path and the N = 384 TMA path Row Ownership and Deterministic Backward Reduction The _geometry heuristic chooses how many threads share a row (TPR), how many warps run in a CTA (NW) and how many contiguous elements each thread loads (V, at most four). The pin helper anchors each load to a tlx.layout through a require_layout / release_layout pair. For TPR ≤ 32, row ownership remains within one warp, allowing row reductions through warp shuffles. Larger thread groups provide more parallelism for wider rows or small row counts. # Simplified from _common._stage_load, direct path layout: tl.constexpr = tlx.layout( shape=((TPR, NW * 32 // TPR), (V, BN // (TPR * V), BM // (NW * 32 // TPR))), stride=((V, BN), (1, TPR * V, NW * 32 // TPR * BN))) x = pin(tl.load(X + offsets, mask=mask, other=0), layout) Backward reuses this row layout to compute dX while accumulating FP32 partial dW and dB vectors across the rows assigned to each persistent CTA. A separate _param_reduce kernel reduces those vectors in a fixed order, giving run-to-run deterministic parameter gradients without atomic accumulation. The source implementation’s Blackwell BF16 benchmark records 5.228 µs for LayerNorm backward at 128×384, versus 18.412 µs for Quack (3.52x). Three Exact Chunks and a Persistent TMA Ring For contiguous, 16-byte-aligned BF16 input with N = 384 and M ≥ 4096, _norm_fwd_384 represents each row as three 128-column chunks, avoiding the 128 padded columns of a 512-wide tile. This route requires contiguous output and no residual, post-normalization addend or residual output. At most 8 × SM-count programs stride over 32-row blocks; smaller inputs use direct loads, while M ≥ 65536 enables TMA. The TMA route holds two stages, each containing three 32×128 BF16 boxes (24 KiB per stage). Their combined transaction byte count is tracked by one completion mbarrier. A CTA issues the next block’s three copies before waiting for the current block. After reading all current chunks into registers, tl.debug_barrier makes the stage safe to reuse. The next TMA transfer can then overlap the current block’s statistics, affine computation and stores. # Simplified from _norm_fwd_384, USE_TMA path if next_row < end_row: next_id = buffer_id ^ 1 tlx.barrier_expect_bytes(producer_bars[next_id], expected_bytes) for j in tl.static_range(CHUNKS): tlx.async_descriptor_load( x_desc, x_buffer[next_id * CHUNKS + j], [next_row, j * CHUNK_N], producer_bars[next_id]) tlx.barrier_wait(producer_bars[buffer_id], producer_phase) Figure-9: Two-stage TMA ring for N = 384 LayerNorm Fused Normalization and Block-Scaled Quantization The Blackwell MXFP8 APIs fuse normalization and quantization for compatible BF16 N = 384 inputs with default options, and on the general fused route for N ≤ 256 or N ≤ 512 with M ≥ 4096. Other shapes normalize first and quantize in a second kernel. Keeping the normalized values on-chip avoids the intermediate BF16 output write and read when that output is not requested. For dual scale output, one E8M0 scale is computed from each 32×32 block’s maximum absolute value. The square block supports both feature-reduction and row-reduction GEMMs: the same scale is repeated over rows in the MMA scale tensor and over columns in the cuBLAS blocked scale tensor. Both scale buffers are emitted in the packed layouts consumed by block-scaled GEMM, alongside one E4M3 payload. Packed cvt instructions convert the scales to E8M0 (ue8m0x2, new in Blackwell) and the data to E4M3 (e4m3x2). The source Blackwell benchmark records 6.461 µs for MXFP8 LayerNorm at 8192×384, versus 8.653 µs for Quack (1.34x). Figure-10: One 32×32 amax block supplies both scale orientations for the same FP8 payload Benchmarking Results We benchmark TLX.ops across NVIDIA (Hopper/Blackwell) and AMD (MI300x/MI350x) GPUs, using continuously evolving shape sets selected from real workloads. In the demonstrated GEMM kernels, TLX.ops achieve up to 1.15x on Blackwell, 1.22x on Hopper, 1.4x on MI350x, and 1.24x on MI300x over cuBLAS/hipBLASLt. Explore the latest results on our benchmark dashboard. Stock Triton Compatibility with uTLX TLX is developed in fbtriton while µTLX bridges TLX functionality to stock Triton using Triton’s Plugin Extension infrastructure. µTLX is published on PyPI (triton-utlx or triton-utlx-rocm). Stock Triton (3.7 and later) can load out-of-tree plugins at runtime and uTLX uses this to register the TLX dialect, its lowerings, and extra compiler passes from a native library (libutlx.so) without changing the stock Triton compiler. µTLX provides Python frontend changes that bring the same tlx augmentations to @triton.jit code and compiler changes that exist only in fbtriton are ported as plugin passes. To install µTLX and run against tests in fbtriton simply follow these steps: pip install torch # torch 2.15 pulls triton ~=3.9.0 pip install triton-utlx # or triton-utlx-rocm git clone https://github.com/facebookexperimental/triton fbtriton export UTLX_TLX_OPS_ROOT=$PWD/fbtriton/third_party/tlx import torch import utlx_plugin # registers TLX with stock Triton from triton.tlx.ops import mm as tlx_mm # served from the fbtriton checkout a = torch.randn(4096, 4096, device="cuda", dtype=torch.bfloat16) b = torch.randn(4096, 4096, device="cuda", dtype=torch.bfloat16) out = tlx_mm(a, b) Appendix 1: GPU Architecture Primer NVIDIA Hopper features fourth-generation Tensor Cores with asynchronous warp-group matrix multiply-accumulate (WGMMA), alongside the Tensor Memory Accelerator (TMA) for efficient global-to-shared memory transfers. These capabilities enable pipelined GEMM implementations that overlap data movement and computation through warp specialization and asynchronous synchronization. NVIDIA Blackwell features fifth-generation Tensor Cores (tcgen05.mma) and Tensor Memory (TMEM), a dedicated on-chip storage space for matrix accumulators. Together with TMA and asynchronous execution mechanisms, these features enable deeper compute-memory pipelining, reduced register pressure, and cooperative matrix operations across CTAs. AMD MI300x features wavefront-based execution with Matrix Fused Multiply-Add (MFMA) instructions for high-throughput matrix computation and Local Data Share (LDS) for on-chip data exchange. Efficient kernels rely on carefully orchestrating global memory loads, LDS staging, MFMA execution, and software pipelining. AMD MI350x extends MI300x with enhanced Matrix Cores supporting microscaling formats such as MXFP8, MXFP6, and MXFP4, along with increased LDS capacity and bandwidth. These improvements create new opportunities for low-precision GEMM and attention kernels through optimized data movement, operand layouts, and compute scheduling. Appendix 2: Performance Disclosure Performance results were collected at various stages of TLX.ops development. Representative benchmarking configurations as of November 30, 2026, are as follows: NVIDIA B200: CUDA 13.0, PyTorch 2.14.0, cuBLAS/cuBLASLt 13.1.1.3, 750 W power limit, maximum GPU core clock. NVIDIA H100: CUDA 13.0, PyTorch 2.14.0, cuBLAS/cuBLASLt 13.1.1.3, 700 W power limit, maximum GPU core clock. AMD Instinct MI350X: ROCm 7.2, PyTorch 2.14.0, hipBLASLt 1.2.2, 1000 W power limit, 2100 MHz GPU core clock. AMD Instinct MI300X: ROCm 7.2, PyTorch 2.14.0, hipBLASLt 1.2.2, 750 W power limit, 2100 MHz GPU core clock. The benchmark harness targets the above clock and power settings where supported and permitted. Benchmark scripts, workload shapes, reference implementations, and measurement methodology are available in the TLX repository. For the latest performance results, refer to the daily performance dashboard. Unless otherwise specified, aggregate speedups represent the geometric mean of per-shape speedups, and “up to” speedups represent the maximum observed single-shape speedup. Performance may vary with hardware configurations, software versions, and workload characteristics.
AI NEWS JOURNAL
PyTorch BlogAI NEWS / JOURNAL
TLX.ops: Bridging Kernel Research and Real-World Performance
High-performance GPU kernels are rarely one-size-fits-all. Their optimization strategies are impacted by GPU architectures, tensor shapes and evolving real-world workload demand. Even SOTA kernels optimized for specific cases can be... The post TLX.ops: Bridging Kernel Research and Real-World Performance appeared first on PyTorch.
번역 서비스가 일시 중지되어 원문을 표시합니다.