论文阅读:Benchmarking and Dissecting the Nvidia Hopper GPU Architecture
原文链接:https://arxiv.org/pdf/2402.13499.pdf
Notes
- Firstly, we conduct conventional latency and throughput comparison benchmarks across the three most recent GPU architectures, namely Hopper, Ada, and Ampere.
- 我们深入研究了最新 Hopper 功能的全面讨论和基准测试,包括 Hopper DPX 动态编程 (DP) 指令集、分布式共享内存以及 FP8 张量核心的可用性
- 张量核心性能和编程指令集
- the tensor core performance and programming instruction sets
- tensor cores and high-bandwidth memory
- 张量核心(TC)单元最初随 Volta 架构引入,专注于以 FP16 和 FP32 精度运算加速深度神经网络
- 后续的 Ampere 架构扩展了 TC 功能,包括稀疏性和更广泛的数据精度,例如 INT8、INT4、FP64、BF16 和 TF32
- Hopper 架构进一步扩展了这一点,引入了对 FP8 精度的支持,显着增强了 LLM 训练和推理加速。
- Hopper introduces innovative features:
- Dynamic Programming X (DPX) instructions:DPX 指令可加速各种动态编程算法,通常涉及大量最小/最大运算来比较先前计算的解决方案
- distributed shared memory (DSM):DSM 支持 SM 到 SM 的直接通信,包括跨多个 SM 共享内存块的加载、存储和原子操作
- an enhanced asynchronous execution mechanism (Tensor Memory Accelerator) for diverse scenarios:Hopper支持集群内线程块之间的异步复制,提高效率
1 本文贡献
- We conduct detailed instruction-level testing and analysis on memory architecture and tensor cores across three GPU generations with different architectures.
- Our analysis highlights the unique advantages and potential of the Hopper architecture
- We compare AI performance across recent GPU generations, examining latency and throughput of tensor cores at the instruction level, transformer engines at the library level, and real LLM generation at the application level
- 我们的研究代表了对 Hopper 架构独特功能的首次探索,包括 DPX、异步内存操作和分布式共享内存。
2 相关工作
- 融合矩阵乘法累加 (MMA) 是人工智能中的一项关键运算,自 Volta 架构以来主要由 Nvidia GPU 中的张量核心 (TC) 加速
-
- 应用方面:
- GPU 动态电压和频率调节 (DVFS) 对深度学习期间能耗和性能的影响测试各种 GPU 架构,DVFS 设置,和 DNN 配置。
- 应用方面:
- 必要性:
- 尽管张量核和AI很流行,但另一个趋势是DPX的支持、异步操作支持和分布式共享内存。
3 METHODOLOGY
3.1 内存单元访问:延迟和吞吐量
-
如何测试这两个指标:
- L1 Cache:
- 延迟:我们首先使用 ca 修饰符将数据从全局内存加载到 L1 缓存。然后我们使用一个线程来访问这个L1缓存以获得延迟。
- 吞吐量:首先使用 ca 修饰符将内存加载到 L1 缓存中。我们只发出一个具有 1024 个线程的块来重复访问 L1 缓存。我们记录消耗的时间和访问的数据量来计算L1缓存的带宽。
- Shared memory:
- Testing the shared memory is similar to testing the L1 cache
- 唯一的区别是不需要指定修饰符来显式预热共享内存。
- 我们使用一个线程来测试延迟,并使用一个具有 1024 个线程的块来测试带宽,就像测试 L1 缓存一样。
- L2 Cache:
- For the latency test, we use the same method as for L1 cache testing
- L1 Cache: