Skip to main content
QUICK REVIEW

[论文解读] cuTT: A High-Performance Tensor Transpose Library for CUDA Compatible GPUs

Antti‐Pekka Hynninen, Dmitry I. Lyakh|arXiv (Cornell University)|May 3, 2017
Parallel Computing and Optimization Techniques被引用 13
一句话总结

cuTT 是一个针对 NVIDIA GPU(Kepler 及之后架构)的高性能 CUDA 库,用于张量转置操作。它通过两种优化共享内存的转置算法以及一种线程并行内存索引方案,实现了与张量秩无关的性能,将集成工作负载中的张量收缩开销降低至最低 1%。

ABSTRACT

We introduce the CUDA Tensor Transpose (cuTT) library that implements high-performance tensor transposes for NVIDIA GPUs with Kepler and above architectures. cuTT achieves high performance by (a) utilizing two GPU-optimized transpose algorithms that both use a shared memory buffer in order to reduce global memory access scatter, and by (b) computing memory positions of tensor elements using a thread-parallel algorithm. We evaluate the performance of cuTT on a variety of benchmarks with tensor ranks ranging from 2 to 12 and show that cuTT performance is independent of the tensor rank and that it performs no worse than an approach based on code generation. We develop a heuristic scheme for choosing the optimal parameters for tensor transpose algorithms by implementing an analytical GPU performance model that can be used at runtime without need for performance measurements or profiling. Finally, by integrating cuTT into the tensor algebra library TAL-SH, we significantly reduce the tensor transpose overhead in tensor contractions, achieving as low as just one percent overhead for arithmetically intensive tensor contractions.

研究动机与目标

  • 解决 GPU 加速张量代数工作负载中张量转置操作的性能瓶颈。
  • 设计一个库,使其在张量秩从 2 到 12 的范围内均保持高性能,且无需依赖基于性能分析的调优。
  • 开发一种运行时启发式方法,基于分析型 GPU 性能模型选择最优转置算法参数。
  • 通过将高度优化的转置核集成到 TAL-SH 张量代数库中,最小化张量收缩中的开销。

提出的方法

  • 该库采用两种针对 GPU 优化的转置算法,均利用共享内存以减少全局内存访问的分散性。
  • 通过一种线程并行算法并行计算张量元素的内存地址,以最小化线程发散并最大化内存访问合并。
  • 基于分析型 GPU 性能模型构建启发式参数选择方案,该模型可估计延迟和占用率,而无需性能分析。
  • 性能模型使运行时能够根据张量秩和形状动态选择最优的块大小和 tile 尺寸。
  • 将该库集成到 TAL-SH 张量代数库中,以评估在张量收缩中的端到端性能。
  • cuTT 支持从 2 到 12 的张量秩,由于算法优化,其性能与张量秩无关。

实验结果

研究问题

  • RQ1一个张量转置库是否能在不依赖基于性能分析的调优的情况下,实现对广泛张量秩范围的高性能?
  • RQ2如何在无需性能测量的情况下,在运行时选择张量转置的最优算法参数?
  • RQ3通过使用优化的核函数,张量转置在张量收缩工作负载中的开销可以降低到何种程度?
  • RQ4共享内存和线程并行索引是否显著改善了张量转置中的内存访问模式?
  • RQ5分析型性能模型是否能准确指导现代 GPU 上张量转置核的参数选择?

主要发现

  • cuTT 实现了与张量秩无关的性能,在 2 到 12 的张量秩范围内均保持高效率。
  • 该库的性能不低于基于代码生成的方法,证明了其优化能力具有竞争力。
  • 分析型性能模型使无需性能分析或基准测试即可实现有效的运行时参数选择。
  • 将 cuTT 集成到 TAL-SH 后,张量转置在计算密集型收缩中的开销降低至最低 1%。
  • 使用共享内存和线程并行内存索引显著减少了全局内存访问的分散性,并提高了带宽利用率。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。