PyTorch介绍可复用的TLX.ops GPU内核目录
PyTorch Blog的一篇文章将TLX.ops介绍为一个目录,把针对特定架构优化的TLX GPU内核整理为可复用实现,覆盖GEMM、attention、MoE、归一化和融合算子。文章称,该目录会根据源自真实工作负载的形状列表验证正确性、性能和编译质量;文中演示的GEMM内核最高比cuBLAS和hipBLASLt快1.4倍。这是第一方报告的结果,且报告指出性能会因硬件配置、软件版本和工作负载特征而异。
其结构化代码库便于内核工程师复用现有内核、创建变体和贡献实现,ML工程师也可直接导入并调用这些算子。文章中的示例面向NVIDIA Hopper和Blackwell GPU,以及AMD Instinct MI300X和MI350X GPU。
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.
#PyTorch#TLX.ops#NVIDIA Blackwell#NVIDIA Hopper#AMD Instinct MI300X#AMD Instinct MI350X#cuBLAS#hipBLASLt