arXiv:2610.34907cs.DCOct 2026

Manuscript Offprint

arXiv:2610.34907

When and Why to Use TMA: A Workload-Grounded Characterization of Tensor Memory Acceleration on NVIDIA Hopper GPUs

Christin David Bose, Cesar Avalos, Junrui Pan, Timothy Rogers

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

The Tensor Memory Accelerator (TMA), introduced on NVIDIA Hopper, is used pervasively in production GPU kernels yet its usage is conspicuously selective: expert kernel developers in CUTLASS, FlashAttention-3, and FlashInfer apply TMA to some tensor operands within a kernel but fall back to cp.async, direct global loads, or distributed shared memory (DSM) for others. Vendor documentation describes the API, and recent microbenchmarking work characterizes TMA throughput in isolation, but neither answers the question practitioners actually face: given a memory operand in a kernel, should it use TMA, and if so, with or without cluster multicast? We address this gap with a workload-grounded characterization study on H100. We catalog the TMA, multicast, DSM, and cp.async choices made inside FlashAttention-3 forward, isolate the discriminating features through targeted microbenchmarks (transfer-size crossover, multicast scaling), and produce rules of thumb for the load-mechanism choice on Hopper. We further compare TMA multicast against DSM as competing cluster-broadcast primitives, and isolate the FlashAttention-3 paged-key-value (KV) TMA-vs-cp.async dispatch on H100 across page size, datatype, model shape, and execution phase. Our results yield concrete, predictive guidance on when TMA pays off and when multicast helps or hurts on Hopper, and we extend the analysis to server Blackwell (SM100) via a CUTLASS GEMM study on B200 that shows the qualitative dispatch rules carry across generations while absolute crossovers shift with tensor-core and bandwidth scaling.

1. Introduction

The Tensor Memory Accelerator (TMA) is the headline memory-system addition of NVIDIA's Hopper architecture [16]. By issuing a single hardware-managed bulk asynchronous copy from global to shared memory, indexed through a precomputed tensor descriptor, TMA frees warps from generating per-thread addresses and overlaps data movement with tensor-core compute (Figure 1). It also exposes two features that have no equivalent in the prior cp.async path: hardware-supported swizzling for bank-conflict-free SMEM layouts feeding tensor cores, and a multicast mode that broadcasts the same tile to multiple SMs in a thread-block cluster with a single issue and a single L2 read.

TMA is used heavily in production. CUTLASS [28] dispatches its SM90 GEMM mainloops through TMA for

Figure

Figure 1: High-level view of the cp.async and TMA paths on Hopper

the operand matrices; FlashAttention-3 [27] routes Q, K, and V through TMA on its prefill path; FlashInfer [32] uses TMA for contiguous KV. Public write-ups attribute much of the resulting SM90 uplift to TMA [2, 5].

And yet TMA is not used for everything. Expert kernel code selectively avoids TMA in regimes where one might naively expect it to win. Three concrete examples motivate this paper.

First, FlashAttention-3 contains an in-tree dispatch heuristic that disables the TMA-paged-KV path when per-tile work falls below a compute-bound threshold [31]. The heuristic was shipped on empirical grounds alone, without an articulated mechanism. A companion issue [29] reports a related TMA overhead pattern in deployed batch decode.

Second, FlashInfer [32] explicitly states that TMA is used only for contiguous KV on Hopper, and falls back to cp.async for paged KV. PagedAttention [7] and vAttention [26] treat the KV page-size knob as a purely allocator-level tradeoff (small pages waste fewer tokens at the tail; large pages amortize lookup cost), but the choice of page size also dictates whether TMA is even usable for the KV load (FA3 requires the page size to be a multiple of the kernel's K-tile), and operators of vLLM [30] and TensorRT-LLM [23] currently guess the page size without quantitative guidance on how much TMA bandwidth they leave on the cp.async fallback.

Third, the choice between TMA multicast and distributed shared memory (DSM), the two hardware mechanisms Hopper provides for cluster-wide tile sharing, is unsettled even among expert codebases. CUTLASS GEMMs broadcast operand tiles across cluster CTAs via TMA multicast [28], while community reports [24, 25] flag regimes in which multicast underperforms independent unicast TMAs from the same cluster. Both hardware paths solve the same logical problem (get one Global Memory (GMEM) tile to N SMs in a cluster), but no published work characterizes when one beats the other, and DSM as an alternative cluster-broadcast primitive has received no systematic comparison at all.

These three observations are not independent oddities; they share a common cause. TMA optimizes for a specific access regime (large, multi-dimensional, well-aligned tiles whose descriptor cost amortizes over many issues) and degrades, sometimes sharply, outside that regime. Production code encodes this fact in dispatch heuristics written by experts, but the heuristics are workload-specific, underdocumented, and not always articulated by their authors. NVIDIA's Hopper Tuning Guide [20] describes the API but does not provide crossover points; recent academic microbenchmarking work characterizes TMA throughput and latency in isolation, or the cp.async path in isolation, but does not address the comparative question [6, 9–13].

The questions this paper answers. We frame the gap as three concrete questions a kernel developer can act on:

  1. When does TMA outperform cp.async, and by how much? What are the crossover points in transfer size and bytes-in-flight per SM, and how do they manifest in production attention across page size, datatype, model shape, and execution phase?

  2. When does TMA multicast pay off, and when does it hurt? How does the answer depend on cluster size and tile size, and is the L2 Request Coalescer (LRC)-deduplicated redundant-unicast path a better choice in the streaming regime?

  3. Which cluster-broadcast primitive should one pick? How does TMA multicast compare head-to-head against distributed-shared-memory (DSM) broadcast when the DRAM cost is matched?

Approach. We answer these questions through a workload-grounded characterization study. We first catalog the memory-mechanism choice (TMA, TMA multicast, DSM, cp.async) for every operand of one production kernel: FlashAttention-3 forward, on prefill, chunked prefill, and decode paths across dense multi-head attention (MHA), grouped-query attention (GQA), and multi-head latent attention (MLA) shapes. From the catalog we form hypotheses for the discriminating features (dimensionality, transfer size, reuse, multicast applicability, multicast-vs-DSM preconditions). We then test these hypotheses with targeted microbenchmarks on H100 (SM90) that sweep the relevant axes in isolation and measure both wall-clock time and the underlying GPU metrics with NVIDIA Nsight Compute (NCU) [18].

A cross-cutting case study runs through the research questions: the FlashAttention-3 [27] paged-KV TMA-vs-cp.async dispatch on H100. FA3's modular dispatch means the TMA-paged path engages only at page sizes that are multiples of the kernel's K-tile, while every other commonly deployed page size falls back to cp.async, a configuration whose performance impact operator-facing tools have not yet measured. Sweeping page size across dense MHA (Llama-3-8B [14]), GQA (Llama-3-70B), and MLA (DeepSeek-V2 [4], with FlashMLA [8] as the production reference) directly answers a question vLLM/SGLang/TensorRT-LLM operators currently guess at, and isolates whether FA3's compute-bound gate is empirically necessary across the deployed model.

Contributions. We make three contributions, mapped one-to-one to the research questions above:

  • (Q1) A workload-grounded characterization of when TMA outperforms cp.async on Hopper, combining a microbench crossover study with a controlled sweep comparing TMA-paged against forced cp.async-paged on FA3 across page size, datatype, model shape, and execution phase.

  • (Q2) A characterization of TMA multicast against the LRC-deduplicated redundant-unicast path as competing intra-cluster fan-out primitives, swept across cluster size and tile size, identifying the regime in which redundant unicast is faster end-to-end and the regime in which multicast's L2 cleanliness is essential.

  • (Q3) A head-to-head comparison of TMA multicast against DSM broadcast at matched DRAM cost, across cluster size and tile size on H100, showing when each primitive is the right choice for the regular broadcast pattern.

The remainder of the paper is organized as follows. Section II provides background on TMA, cp.async, thread-block clusters, multicast, and DSM on Hopper. Section III describes the experimental methodology and workload corpus. Section IV reports the characterization results, including the FA3 paged-KV TMA-vs-cp.async case study and the multicast-vs-redundant-unicast comparison. Section V extends the characterization to server Blackwell (SM100) via a CUTLASS GEMM study on B200. Section VI discusses related work. Section VII concludes.

References (34)