Skip to main content
QUICK REVIEW

[论文解读] 8 Steps to 3.7 TFLOP/s on NVIDIA V100 GPU: Roofline Analysis and Other Tricks

Charlene Yang|arXiv (Cornell University)|Aug 26, 2020
Parallel Computing and Optimization Techniques参考文献 15被引用 8
一句话总结

本文通过分层Roofline分析和Nsight Compute,提出八个优化步骤,在NVIDIA V100 GPU上实现了3.7 TFLOP/s的双精度性能。通过解决高寄存器使用、低占用率、复杂数据访问和长延迟指令等问题——特别是通过限制寄存器使用、循环重排、缓存分块和FMA比率感知调优——该方法实现了基于58% FMA比率的定制峰值的70%,展示了面向HPC内核优化的实用框架。

ABSTRACT

Performance optimization can be a daunting task especially as the hardware architecture becomes more and more complex. This paper takes a kernel from the Materials Science code BerkeleyGW, and demonstrates a few performance analysis and optimization techniques. Despite challenges such as high register usage, low occupancy, complex data access patterns, and the existence of several long-latency instructions, we have achieved 3.7 TFLOP/s of double-precision performance on an NVIDIA V100 GPU, with 8 optimization steps. This is 55% of the theoretical peak, 6.7 TFLOP/s, at nominal frequency 1312 MHz, and 70% of the more customized peak based on our 58% FMA ratio, 5.3 TFLOP/s. An array of techniques used to analyze this OpenACC kernel and optimize its performance are shown, including the use of hierarchical Roofline performance model and the performance tool Nsight Compute. This kernel exhibits computational characteristics that are commonly seen in many high-performance computing (HPC) applications, and are expected to be very helpful to a general audience of HPC developers and computational scientists, as they pursue more performance on NVIDIA GPUs.

研究动机与目标

  • 解决运行在NVIDIA V100 GPU上的BerkeleyGW代码中双精度HPC内核的性能瓶颈。
  • 展示一种系统化、多步骤的优化流程,适用于面临高寄存器压力、复杂内存访问和长延迟指令的科学内核。
  • 验证分层Roofline分析和Nsight Compute在识别和解决性能瓶颈方面的有效性。
  • 基于FMA比率建立更现实的性能上限,改进双精度工作负载的理论峰值估算。
  • 提供一种可迁移的方法论,适用于具有类似计算特性的其他HPC应用。

提出的方法

  • 应用分层Roofline分析,识别与算术强度和内存带宽相关的性能瓶颈。
  • 使用Nsight Compute收集详细的性能指标,包括指令级统计信息和缓存命中率。
  • 通过编译器标志(-Mcuda=maxregcount:128)或OpenACC从句(vector_length(512))减少寄存器使用,以提高占用率。
  • 通过循环重排提高算术强度,更好地利用内存层次结构。
  • 实施缓存分块(分块)以增强数据重用性,提高L1/L2缓存命中率。
  • 用延迟更短的替代指令(如倒数)替换长延迟指令,以降低指令级延迟。

实验结果

研究问题

  • RQ1如何有效应用分层Roofline分析,识别具有复杂数据访问和高精度算术的GPU内核中的性能瓶颈?
  • RQ2寄存器压力对GPU占用率和性能有何影响?如何在避免过度寄存器溢出惩罚的前提下加以缓解?
  • RQ3在具有不规则内存访问模式的内核中,通过循环重排和缓存分块能实现多大程度的性能提升?
  • RQ4FMA比率如何影响双精度GPU内核的现实性能上限?如何利用它来校准理论峰值估算?
  • RQ5结合编译器级调优、算法重构和Nsight Compute等分析工具,是否能持续在真实HPC工作负载中实现显著的性能提升?

主要发现

  • 优化后的内核在单个NVIDIA V100 GPU上实现了3.7 TFLOP/s的双精度性能,相比原始的2.3 TFLOP/s提升了3倍。
  • 最终性能达到理论FP64峰值(6.7 TFLOP/s,频率1312 MHz)的55%。
  • 性能达到基于实测58% FMA比率的更现实峰值5.3 TFLOP/s的70%。
  • 缓存分块和循环重排显著提高了L1和L2缓存命中率,经Nsight Compute分析验证。
  • 寄存器限制将每个SM的占用率从16个warp提升至32个warp,尽管引入了寄存器溢出,但其带来的延迟隐藏优势仍占主导。
  • 结合架构认知(如FMA利用率)与迭代式Nsight Compute分析,被证明是实现复杂科学内核高性能的关键。

更好的研究,从现在开始

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

无需绑定信用卡

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