现代 GPU 中的控制流管理
Control Flow Management in Modern GPUs
AI总结:
针对 GPU 控制流实现不透明的问题,本文基于 Turing 原生 ISA 实验定义控制流指令语义,并提出低成本 Hanoi 机制,其轨迹与 IPC 平均差异分别仅为 1.03% 和 0.19%。
摘要:
在 GPU 中,控制流管理机制决定一个 warp 中哪些线程在任意时刻处于活动状态。该机制监视 warp 内标量线程的控制流,以优化线程调度,并在执行资源利用方面发挥关键作用。控制流管理机制可由软件通过指令进行控制或辅助。然而,GPU 供应商并不披露其编译器、ISA 或硬件实现的细节。这种透明度的缺失使研究人员难以理解控制流管理机制如何运作、如何实现,或如何由软件提供辅助;而当该机制显著影响其研究时,这种理解至关重要。这对 GPU 性能建模也构成问题,因为人们只能依赖来自真实硬件的控制流轨迹,无法对该机制的功能进行建模或修改,更无法改变它。本文通过基于使用多种基准测试从实验数据中获得的洞见,为 Turing 原生 ISA 中的控制流指令定义一种合理的语义,从而解决这一问题。基于这些定义,我们提出了一种用于高效控制流管理的低成本机制,名为 Hanoi。Hanoi 可确保正确性,并生成与真实硬件非常接近的控制流。我们的评估表明,真实硬件与我们机制的控制流轨迹之间的差异平均仅为 1.03%。此外,将采用 Hanoi 的 GPU 的每周期指令数(IPC)与实际硬件的原生控制流管理进行比较时,平均差异仅为 0.19%。
英文摘要:
In GPUs, the control flow management mechanism determines which threads in a warp are active at any point in time. This mechanism monitors the control flow of scalar threads within a warp to optimize thread scheduling and plays a critical role in the utilization of execution resources. The control flow management mechanism can be controlled or assisted by software through instructions. However, GPU vendors do not disclose details about their compiler, ISA, or hardware implementations. This lack of transparency makes it challenging for researchers to understand how the control flow management mechanism functions, is implemented, or is assisted by software, which is crucial when it significantly affects their research. It is also problematic for performance modeling of GPUs, as one can only rely on traces from real hardware for control flow and cannot model or modify the functionality of the mechanism altering it. This paper addresses this issue by defining a plausible semantic for control flow instructions in the Turing native ISA based on insights gleaned from experimental data using various benchmarks. Based on these definitions, we propose a low-cost mechanism for efficient control flow management named Hanoi. Hanoi ensures correctness and generates a control flow that is very close to real hardware. Our evaluation shows that the discrepancy between the control flow trace of real hardware and our mechanism is only 1.03% on average. Furthermore, when comparing the Instructions Per Cycle (IPC) of GPUs employing Hanoi with the native control flow management of actual hardware, the average difference is just 0.19%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。