Meta发布TLX:基于Triton的低级GPU控制扩展
Meta TLX Brings Warp-Group GPU Control to Triton on Hopper, Blackwell, AMD
做底层算子优化的同学必看,TLX让Triton能直接调用Warp Group和TMA等黑盒特性,代码量大幅减少且性能逼近cuBLAS,值得跟进压测。
Meta has published a detailed report on TLX (Triton Low-Level Extensions). It is the GPU compiler extension behind Meta’s production ML kernels. Meta TLX is a Triton extension that exposes warp groups, barriers, TMA and clusters to Python kernels. It targets NVIDIA Hopper and Blackwell plus AMD MI300 and MI350-series GPUs. For kernel engineers, the message is CUDA-level control without leaving Triton.
Meta 发布了关于 TLX(Triton 低级扩展)的详细报告。它是 Meta 生产级 ML 内核背后的 GPU 编译器扩展。Meta TLX 是一个 Triton 扩展,向 Python 内核暴露了 warp 组、屏障、TMA 和集群。它面向 NVIDIA Hopper 和 Blackwell,以及 AMD MI300 和 MI350 系列 GPU。对于内核工程师而言,其核心信息是:在不离开 Triton 的情况下实现 CUDA 级别的控制。
TL;DR
TL;DR(太长不看版)
- What it is: an extension to Triton, not a new language. A Blackwell GEMM takes roughly 200 lines of Python-level Triton.
- Runs on: NVIDIA Hopper (H100) and Blackwell (B200, GB200), AMD MI300 and MI350-series. MIT-licensed.
- Performance: within -0.9% to +3.7% of cuBLAS on 6 H100 FP16 GEMM shapes (PyTorch).
- Best: a 4x speedup on an H100 linear compression kernel for ads inference (Meta).
- Worst: dense LLM-style attention forward reaches about 87% of FlashAttention-4 on B200 (PyTorch).
- Bottom line: Best: hand-tuned performance from short Triton code. Worst: all numbers are self-reported, with no independent benchmarks yet.
- 它是什么:Triton 的扩展,而非新语言。一个 Blackwell GEMM 大约需要 200 行 Python 级别的 Triton 代码。
- 运行平台:NVIDIA Hopper (H100) 和 Blackwell (B200, GB200),AMD MI300 和 MI350 系列。采用 MIT 许可证。
- 性能:在 6 种 H100 FP16 GEMM 形状上(PyTorch),性能与 cuBLAS 相比介于 -0.9% 到 +3.7% 之间。
- 最佳表现:在 H100 上的广告推理线性压缩内核中,速度提升 4 倍(Meta)。
- 最差表现:密集 LLM 风格注意力前向传播在 B200 上达到 FlashAttention-4 的约 87%(PyTorch)。
- 结论:最佳情况:通过简短的 Triton 代码实现手工调优的性能。最差情况:所有数据均为自我报告,目前尚无独立基准测试。
What is TLX and what problem does it solve?
什么是 TLX,它解决了什么问题?
Triton programs GPUs at the block level. CUDA programs them at the thread level. Modern GPUs need something in between.
Triton 在块级别对 GPU 进行编程。CUDA 在线程级别对 GPU 进行编程。现代 GPU 需要介于两者之间的方案。
Hopper introduced warp specialization and the Tensor Memory Accelerator (TMA). Blackwell added tensor memory (TMEM), cluster execution and paired-CTA execution. Meta says CUDA could express these patterns, but only with large amounts of architecture-specific code.
Hopper 引入了 warp 专门化和张量内存加速器(TMA)。Blackwell 增加了张量内存(TMEM)、集群执行和配对 CTA 执行。Meta 表示,CUDA 可以表达这些模式,但需要大量特定于架构的代码。
TLX fills that gap with a model the research team calls MIMW (Multi-Instruction, Multi-Warp). The warp group becomes the basic unit of orchestration. Triton still defines what runs. TLX defines how it is orchestrated. Engineers write ordinary Triton and add TLX calls only where control matters.
TLX 填补了这一空白,研究团队将其模型称为 MIMW(多指令、多 Warp)。Warp 组成为编排的基本单元。Triton 仍然定义运行什么,而 TLX 定义如何编排。工程师编写普通的 Triton 代码,仅在控制关键处添加 TLX 调用。
How does TLX work?
TLX 是如何工作的?
TLX adds 5 extension areas on top of Triton:
TLX 在 Triton 之上增加了 5 个扩展领域:
- Warp-group orchestration: warp groups get roles such as producer, consumer and epilogue.
- Synchronization: warp groups sync through hardware mbarriers. Thread-level sync stays with the compiler.
- Memory orchestration: direct access to TMA, asynchronous tensor-core ops and TMEM.
- Cluster execution: multiple CTAs cooperate through distributed shared memory and cluster-wide barriers.
- Optional layouts: the compiler infers layouts. Programmers override them only for speed.
- Warp 组编排:warp 组获得生产者、消费者和尾数处理等角色。
- 同步:warp 组通过硬件 mbarrier 进行同步。线程级同步仍由编译器处理。
- 内存编排:直接访问 TMA、异步张量核操作和 TMEM。
- 集群执行:多个 CTA 通过分布式共享内存和集群级屏障进行协作。
- 可选布局:编译器推断布局。程序员仅在追求速度时覆盖它们。
The API reads like Triton. Meta’s Blackwell matmul example uses tlx.local_alloc, tlx.alloc_barriers, tlx.async_task, tlx.async_dot and tlx.barrier_wait.
API 读起来像 Triton。Meta 的 Blackwell 矩阵乘法示例使用了 tlx.local_alloc、tlx.alloc_barriers、tlx.async_task、tlx.async_dot 和 tlx.barrier_wait。
How fast is TLX? Benchmarks
TLX 有多快?基准测试
All figures below are self-reported by Meta:
以下所有数据均由 Meta 自我报告:
- H100 GEMM: across 6 FP16 shapes, TLX lands between -0.9% and +3.7% of cuBLAS. On 8192x8192x8192 it reaches 577.0 TFLOPS versus 582.3 for cuBLAS (PyTorch).
- MI350 GEMM: TLX beats rocBLAS by 11.8% to 15.2% on square shapes from 256 to 2048.
- B200 attention: On production jagged shapes, Meta’s Jagged Flash Attention beats FlashAttention-4 by about 13% forward. Backward runs about 50% faster. On dense LLM-style shapes, forward reaches about 87% of FA4 (PyTorch).
- Code size: that attention kernel is about 3.2K lines. Meta estimates FA4 at 10K lines of CuTe DSL.
- H100 GEMM:在 6 种 FP16 形状上,TLX 的性能介于 cuBLAS 的 -0.9% 到 +3.7% 之间。在 8192x8192x8192 形状下,其达到 577.0 TFLOPS,而 cuBLAS(PyTorch)为 582.3。
- MI350 GEMM:在 256 到 2048 的正方形形状上,TLX 比 rocBLAS 高出 11.8% 至 15.2%。
- B200 attention:在生产环境的锯齿状形状上,Meta 的 Jagged Flash Attention 前向传播比 FlashAttention-4 快约 13%。后向传播速度提升约 50%。在密集的 LLM 风格形状上,前向传播性能约为 FA4(PyTorch)的 87%。
- 代码规模:该注意力内核代码量约为 3.2K 行。Meta 估计 FA4 需要 10K 行的 CuTe DSL 代码。
The research team adds that TLX trails state-of-the-art attention most on the smallest causal-forward cases. The gap narrows as sequence length grows.
研究团队补充称,TLX 在最小的因果前向案例中与最先进的注意力机制差距最大。随着序列长度的增加,这一差距会缩小。
Where is TLX used in production at Meta?
TLX 在 Meta 的生产环境中有哪些应用?
Meta’s engineering post lists 3 case studies:
Meta 的工程博客列出了 3 个案例研究:
- Generative Ads Model (GEM) training: 20% to 25% end-to-end MFU on thousands of GPUs. TLX delivered up to 2x forward speedup for Generalized Dot Product Attention.
- In-Kernel Broadcast Optimization (IKBO): a warp-specialized linear compression kernel hit 4x speedup on H100. FlashAttention under IKBO cut compute-intensive net latency by up to two-thirds.
- Distributed grouped GEMM: fuses mixture-of-experts matmuls with communication for LLM pretraining on Blackwell. Meta gives no speedup figure.
- 生成式广告模型(GEM)训练:在数千块 GPU 上实现了 20% 到 25% 的端到端 MFU。TLX 为广义点积注意力(Generalized Dot Product Attention)提供了高达 2 倍的前向加速。
- 内核内广播优化(IKBO):一个线程束专用线性压缩内核在 H100 上实现了 4 倍加速。在 IKBO 下的 FlashAttention 将计算密集型网络延迟降低了多达三分之二。
- 分布式分组 GEMM:在 Blackwell 上进行 LLM 预训练时,将混合专家(MoE)矩阵乘法与通信融合。Meta 未提供具体的加速数据。
Meta also compared CUTLASS, CuTe DSL and TLX on Blackwell for GEM. It says TLX gave the best productivity-performance balance for most kernels, but shares no numbers.
Meta 还在 Blackwell 上对 GEM 任务比较了 CUTLASS、CuTe DSL 和 TLX。它表示 TLX 为大多数内核提供了最佳的生产力-性能平衡,但未分享具体数字。
How do developers install and use TLX?
开发者如何安装和使用 TLX?
TLX lives in Meta’s MIT-licensed Triton fork, facebookexperimental/triton, under third_party/tlx/. It also ships as triton-utlx on PyPI, a plugin for upstream Triton. The PyTorch-Triton 3.7 plugin system loads TLX without forking Triton. AMD has also published a GEMM plus activation guide for CDNA4 with TLX.
TLX 位于 Meta 的 MIT 许可证 Triton 分支 facebookexperimental/triton 的 third_party/tlx/ 目录下。它也作为 triton-utlx 在 PyPI 上发布,是上游 Triton 的插件。PyTorch-Triton 3.7 插件系统无需 fork Triton 即可加载 TLX。AMD 还发布了针对 CDNA4 架构使用 TLX 的 GEMM 加激活指南。
TLX vs Gluon vs CuTe DSL vs TileLang
| Feature | Meta TLX | Gluon | CuTe DSL | TileLang |
|---|---|---|---|---|
| Maintainer | Meta with UC San Diego (paper) | Triton project | NVIDIA | tile-ai open source project |
| Approach | Extension on top of Triton; warp-group orchestration; layouts optional | Lower-level Triton dialect; tensors carry explicit layouts (AMD) | Python DSL isomorphic with CuTe C++ (FAQ) | Tile-level DSL with layout and pipeline control |
| Hardware | Hopper, Blackwell, AMD MI300 and MI350 (Meta) | NVIDIA Hopper+ for warp specialization (docs); AMD MI350/MI355 (AMD) | NVIDIA Ampere, Hopper, Blackwell | CUDA, ROCm, Metal, CPU, Ascend (SourceForge mirror) |
| License | MIT (repo) | MIT (part of Triton) | NVIDIA EULA for CuTe DSL files (license) | MIT (mirror) |
| Headline published result | -0.9% to +3.7% vs cuBLAS, H100 FP16 GEMM | Not disclosed | Used for FlashAttention-4 kernels, ~10K lines per Meta’s estimate (PyTorch) | Not disclosed |
| Known production use | Meta ads training, ads inference, LLM pretraining | Not disclosed | FlashAttention-4 | DeepSeek TileKernels (repo) |
| 特性 | Meta TLX | Gluon | CuTe DSL | TileLang |
|---|---|---|---|---|
| 维护者 | Meta 与加州大学圣地亚哥分校(论文) | Triton 项目 | NVIDIA | tile-ai 开源项目 |
| 方法 | 基于 Triton 的扩展;warp-group 编排;布局可选 | 底层 Triton 方言;张量携带显式布局(AMD) | 与 CuTe C++ 同构的 Python DSL(常见问题解答) | 具有布局和流水线控制的 Tile 级 DSL |
| 硬件 | Hopper、Blackwell、AMD MI300 和 MI350(Meta) | NVIDIA Hopper+ 用于 warp 专业化(文档);AMD MI350/MI355(AMD) | NVIDIA Ampere、Hopper、Blackwell | CUDA、ROCm、Metal、CPU、Ascend(SourceForge 镜像) |
| 许可证 | MIT(仓库) | MIT(Triton 的一部分) | NVIDIA CuTe DSL 文件 EULA(许可证) | MIT(镜像) |
| headline 发布结果 | 与 cuBLAS 相比,H100 FP16 GEMM 为 -0.9% 至 +3.7% | 未披露 | 用于 FlashAttention-4 内核,据 Meta 估计每个约 10K 行(PyTorch) | 未披露 |
| 已知生产用途 | Meta 广告训练、广告推理、LLM 预训练 | 未披露 | FlashAttention-4 | DeepSeek TileKernels(仓库) |
Key Takeaways
关键要点
- TLX adds warp-group, barrier, TMA and cluster control to ordinary Triton code.
- It lands within -0.9% to +3.7% of cuBLAS on H100 FP16 GEMM.
- Production wins include 4x on an H100 ads kernel and 20% to 25% MFU on GEM.
- Dense attention forward still trails FA4 at about 87% on B200.
- It is MIT-licensed and loads into upstream Triton as a plugin.
- TLX 向普通 Triton 代码添加了 warp-group、barrier、TMA 和 cluster 控制。
- 在 H100 FP16 GEMM 上,其性能落在 cuBLAS 的 -0.9% 到 +3.7% 范围内。
- 生产环境中的收益包括:在 H100 广告内核上实现 4 倍加速,以及在 GEM 上实现 20% 至 25% 的 MFU。
- 密集注意力前向传播在 B200 上仍落后于 FA4,约为 87%。
- 它采用 MIT 许可证,并作为插件加载到上游 Triton 中。
Check out the paper on arXiv, the Meta engineering post and the GitHub repo. You can check the deployment options and specs here through our GPULeaderboard.com chrome extension.
请查阅 arXiv 上的论文、Meta 的工程博客以及 GitHub 仓库。您可以通过我们的 GPULeaderboard.com Chrome 扩展程序在此处查看部署选项和规格。
Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
此外,欢迎在 Twitter 上关注我们,别忘了加入我们有 15 万+成员的 ML SubReddit 并订阅我们的新闻通讯。等等!你在 Telegram 上吗?现在你也可以加入我们的 Telegram 群组。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力