arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.34907cs.DCcs.AR
收藏

何时及为何使用TMA:NVIDIA Hopper GPU上张量内存加速的工作负载导向表征

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

Purdue University(普渡大学)

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

AI总结:

本文针对NVIDIA Hopper GPU的TMA使用问题,开展工作负载导向表征研究,明确TMA、多播等加载机制的选择规则,为从业者提供TMA使用的具体预测性指导。

摘要:

NVIDIA Hopper架构引入的张量内存加速器(Tensor Memory Accelerator, TMA)已在生产级GPU内核中广泛应用,但其使用却呈现明显的选择性:CUTLASS、FlashAttention-3和FlashInfer中的专业内核开发者会将TMA应用于内核内的部分张量操作数,而对其他操作数则采用this http URL、直接全局加载或分布式共享内存(Distributed Shared Memory, DSM)。供应商文档仅描述了TMA的API,近期的微基准测试工作也仅单独表征了TMA的吞吐量,但均未解决从业者实际面临的问题:给定内核中的一个内存操作数,是否应使用TMA?若使用,是否需结合集群多播?本文针对H100开展了基于工作负载的表征研究,填补了这一空白。我们梳理了FlashAttention-3前向传播中对TMA、多播、DSM及this http URL的选择,通过针对性微基准测试(传输大小交叉点、多播可扩展性)分离出区分特征,并为Hopper上的加载机制选择生成了经验法则。我们还将TMA多播与DSM作为竞争的集群广播原语进行了比较,针对H100上的FlashAttention-3分页键值(Key-Value, KV)this http URL调度,在分页大小、数据类型、模型形状及执行阶段维度进行了分析。研究结果为Hopper上何时使用TMA、何时多播有益或有害提供了具体的预测性指导,我们还通过对B200的CUTLASS GEMM研究将分析扩展至服务器级Blackwell(SM100),结果表明定性调度规则可跨代延续,而绝对交叉点则随张量核心和带宽扩展发生变化。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑