# 内存带宽

**内存带宽**是计算机内存系统向处理器传输数据或从处理器接收数据的速率，通常以字节每秒（GB/s或TB/s）表示。它衡量吞吐量，即在给定时间内能移动多少数据，并且不同于内存延迟，即完成一次对新地址的单次访问所需的时间。<sup>[1](https://www.cs.cornell.edu/courses/cs4787/2026fa/lectures/lecture16.html)</sup> 对于许多科学计算、图形和AI工作负载而言，带宽是性能的一阶决定因素，这些工作负载每移动一字节数据往往只做很少的计算。

| 关键事实 | 详情 |
|---|---|
| 定义 | 内存与处理器之间的数据传输速率，以字节每秒计；不同于延迟，即一次访问所需时间<sup>[1](https://www.cs.cornell.edu/courses/cs4787/2026fa/lectures/lecture16.html)</sup> |
| 理论计算 | 内存频率（减半计算，因为DDR在时钟两个边沿都传输数据）× 以字节计的总线宽度 × 通道数<sup>[2](https://www.intel.com/content/www/us/en/support/articles/000056722/processors/intel-core-processors.html)</sup> |
| 标准测量 | STREAM基准测试报告Copy、Scale、Add和Triad向量内核的持续带宽<sup>[3](https://www.ccs.tsukuba.ac.jp/wp-content/uploads/sites/14/2019/12/WeilandTsukuba2019.pdf)</sup> |
| HBM2 | 8个独立通道，每引脚3.6 Gbps，每堆叠最高410 GB/s<sup>[4](https://www.micron.com/products/memory/hbm/hbm3e)</sup> |
| HBM3E | 每个封装位置超过1.2 TB/s，1024个IO引脚，引脚速度超过9.2 Gb/s<sup>[4](https://www.micron.com/products/memory/hbm/hbm3e)</sup> |
| 延迟趋势 | 在数十年的工艺缩放中，DRAM延迟几乎保持不变，仅降至原来的1/1.3，而容量和带宽增长得多得多<sup>[5](https://arxiv.org/abs/1712.08304)</sup> |

## 带宽如何计算和测量

内存系统的理论最大带宽由三个量决定。英特尔（Intel）的文档给出了其酷睿X系列（Core X-Series）处理器的公式：将内存频率（只计一次，因为双倍数据速率在时钟的两个边沿都传输数据，所以标称频率要取一半）乘以以字节计的总线宽度，再乘以处理器支持的内存通道数。<sup>[2](https://www.intel.com/content/www/us/en/support/articles/000056722/processors/intel-core-processors.html)</sup>

理论数值是上限，而不是软件实际看到的值。STREAM基准测试是一个用于测量可持续内存带宽的合成程序，它运行四个简单的向量内核——Copy、Scale、Add和Triad——并报告每个内核达到的最大持续速率。<sup>[3](https://www.ccs.tsukuba.ac.jp/wp-content/uploads/sites/14/2019/12/WeilandTsukuba2019.pdf)</sup> 由于内存系统本身的开销，持续带宽通常低于理论峰值。<sup>[6](https://indico.cern.ch/event/397113/papers/1837780/files/3954-Paper_final.pdf)</sup> 伯克利实验室（Berkeley Lab）的经验Roofline工具（Empirical Roofline Tool）采用类似的经验方法，测量CPU或GPU实际提供的机器特性，而不是依赖数据手册数字。<sup>[7](https://amcr.lbl.gov/departments/computer-science-department/ppan/roofline-performance-model/empirical-roofline-tool-ert/)</sup>

## 带宽与延迟

带宽和延迟是相关但不同的属性。延迟是访问新地址数据所需的时间；吞吐量，也就是带宽，是在给定时间内总共能访问多少数据。<sup>[1](https://www.cs.cornell.edu/courses/cs4787/2026fa/lectures/lecture16.html)</sup> DRAM单次访问的延迟很长，但页模式访问及类似技术使得一旦数据流开始流动，带宽就相当不错。<sup>[8](https://heather.cs.ucdavis.edu/matloff/public_html/154A/PattHenn.html)</sup>

两者走上了非常不同的轨迹。DRAM一直针对每位成本而非访问延迟进行优化；在容量和带宽持续提升的同时，DRAM延迟在同样的技术缩放时期内仅降至原来的1/1.3。<sup>[5](https://arxiv.org/abs/1712.08304)</sup>

不同的内存技术做出不同的权衡。

## 内存层次结构与数据所在位置

带宽在很大程度上取决于数据相对于访问它的处理器存放在哪里。在现代多核和GPU加速系统中，内存带宽随数据位置而变化：寄存器提供最快访问，其次是片上缓存和共享内存，然后是片外DRAM。<sup>[9](https://amcr.lbl.gov/departments/computer-science-department/ppan/roofline-performance-model/)</sup><sup> • </sup><sup>[10](https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/2024-0/optimize-memory-bound-applications-with-gpu.html)</sup> 在AMD GPU上，内存受限内核受限于数据在[高带宽内存](https://www.edgepedia.org/zh/high-bandwidth-memory)（High Bandwidth Memory，HBM）与片上缓存或本地数据共享（Local Data Share）之间移动的速度。<sup>[11](https://rocm.docs.amd.com/projects/HIP/en/latest/understand/performance_optimization.html)</sup>

在多处理器系统中，物理位置在插槽层面也很重要。在48核AMD Opteron系统和32核英特尔至强（Intel Xeon）系统上，测试发现，当每个并行线程从自己处理器封装内的内存读取，而不是从属于远处处理器的内存读取时，总内存带宽会达到更高水平；这正是典型的NUMA（非统一内存访问）行为。<sup>[12](https://arxiv.org/abs/1103.3225)</sup>

## Roofline模型：当带宽成为瓶颈

Roofline模型由伯克利实验室的塞缪尔·威廉姆斯（Samuel Williams）提出，是一种性能模型，它把内存带宽和计算吞吐量结合在单张图中，从而界定应用性能的上界。其核心量是算术强度，即执行的总浮点运算数与移动的总数据字节数之比。<sup>[9](https://amcr.lbl.gov/departments/computer-science-department/ppan/roofline-performance-model/)</sup>

该模型将工作负载分为两类：受峰值计算限制，或受内存带宽限制。<sup>[13](https://roofline.computer/about/methodology)</sup> 如果应用的算术强度低于带宽上限与峰值计算相交的脊点，它就是带宽受限，受限于数据在内存系统中移动的速度，而不是CPU核心或GPU流式多处理器计算的速度。<sup>[14](https://docs.nersc.gov/tools/performance/roofline/)</sup> 维持目标吞吐量所需的带宽可直接推出：对于算术强度为 \( I \)（FLOP/byte）的工作负载，要维持运算吞吐量 \( R \)（FLOP/s），内存子系统必须以如下速率传输数据：

\[ B_{\mathrm{req}} = \frac{R}{I} \; \text{bytes/s}. \]

<sup>[15](https://harvard-edge.github.io/cs249r_book_dev/vol1/11_hw_acceleration/11_hw_acceleration.html)</sup>

该模型也指导优化。对于本质上受内存限制的代码，最有效的改进可能来自减少或隐藏内存延迟的变换，例如预取或利用应用级数据复用，实际上消除内存访问。<sup>[16](https://www.sciencedirect.com/topics/computer-science/roofline-model)</sup> 一个实际注意事项是，单核往往无法饱和芯片的内存带宽，因此该模型最好在全芯片层面应用，峰值性能和带宽数字都取整个芯片的数值。<sup>[17](https://hpc-wiki.info/hpc/Performance_model)</sup>

## 高带宽内存与AI加速器

JEDEC于2013年发布了高带宽内存（HBM），这是一种DRAM变体，其中多个裸片堆叠并通过硅通孔连接；由于该内存紧邻处理器裸片放置，它达到标准DDR模组约十倍的带宽。<sup>[18](https://technav.ieee.org/topic/sdram/)</sup> 各代产品稳步提升：HBM2提供8个独立通道，每引脚3.6 Gbps，最高410 GB/s；而美光（Micron）的HBM3E采用16个独立通道和32个伪通道，引脚速度超过9.2 Gb/s，并具有1024个IO引脚，使每个封装位置的带宽超过1.2 TB/s，采用24 GB 8层堆叠和36 GB 12层堆叠。<sup>[4](https://www.micron.com/products/memory/hbm/hbm3e)</sup>

这种带宽对AI工作直接重要。美光报告称，与H100平台相比，HBM3E的带宽将大语言模型（LLM）训练时间缩短30%以上，并使推理的每日查询量增加50%以上。<sup>[19](https://www.micron.com/markets-industries/ai/ai-data-center)</sup> 系统级比较显示出相同模式：在本地LLM推理中，解码吞吐量随内存带宽变化，M4 Max的546 GB/s和M3 Ultra的819 GB/s统一内存带宽，在很大程度上解释了它们相对于273 GB/s和256 GB/s等低带宽竞品的性能。<sup>[20](https://www.tomshardware.com/desktops/exploring-apple-silicons-local-ai-performance-with-the-mac-studio-and-m4-max-m4-max-beats-gb10-and-strix-halo-in-decode-throughput-but-memory-bandwidth-isnt-everything)</sup>

共享内存设计面临自身约束：当CPU和GPU共享一个内存池时，如掌上游戏APU中那样，可分配的带宽只有这么多，而将数据通道加倍会使两者可用的带宽都加倍。<sup>[21](https://www.pcgamer.com/hardware/handheld-gaming-pcs/the-first-gaming-benchmarks-for-amds-ryzen-z2-extreme-show-memory-bandwidth-is-hobbling-the-full-potential-the-new-handheld-chip/)</sup>

## References

1. [Lecture 16, CS4787, Cornell University](https://www.cs.cornell.edu/courses/cs4787/2026fa/lectures/lecture16.html)
2. [Theoretical Maximum Memory Bandwidth for Intel Core X-Series Processors, Intel](https://www.intel.com/content/www/us/en/support/articles/000056722/processors/intel-core-processors.html)
3. [STREAM benchmark, Weiland, Tsukuba 2019](https://www.ccs.tsukuba.ac.jp/wp-content/uploads/sites/14/2019/12/WeilandTsukuba2019.pdf)
4. [Micron HBM3E product page](https://www.micron.com/products/memory/hbm/hbm3e)
5. [Understanding and Improving the Latency of DRAM-Based Memory Systems, arXiv](https://arxiv.org/abs/1712.08304)
6. [CERN paper on STREAM and achievable bandwidth](https://indico.cern.ch/event/397113/papers/1837780/files/3954-Paper_final.pdf)
7. [Empirical Roofline Tool (ERT), Berkeley Lab AMCR](https://amcr.lbl.gov/departments/computer-science-department/ppan/roofline-performance-model/empirical-roofline-tool-ert/)
8. [Patterson and Hennessy course notes, UC Davis](https://heather.cs.ucdavis.edu/matloff/public_html/154A/PattHenn.html)
9. [The Roofline Model: Visualizing and Optimizing Performance, Berkeley Lab AMCR](https://amcr.lbl.gov/departments/computer-science-department/ppan/roofline-performance-model/)
10. [Optimize Memory-bound Applications with GPU Roofline, Intel](https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/2024-0/optimize-memory-bound-applications-with-gpu.html)
11. [Understanding GPU performance, AMD ROCm HIP documentation](https://rocm.docs.amd.com/projects/HIP/en/latest/understand/performance_optimization.html)
12. [Measuring NUMA effects with the STREAM benchmark, arXiv](https://arxiv.org/abs/1103.3225)
13. [Roofline methodology, roofline.computer](https://roofline.computer/about/methodology)
14. [Roofline Performance Model, NERSC Documentation](https://docs.nersc.gov/tools/performance/roofline/)
15. [Introduction to Machine Learning Systems, Harvard CS249r book](https://harvard-edge.github.io/cs249r_book_dev/vol1/11_hw_acceleration/11_hw_acceleration.html)
16. [Roofline Model overview, ScienceDirect Topics](https://www.sciencedirect.com/topics/computer-science/roofline-model)
17. [Performance model, HPC Wiki](https://hpc-wiki.info/hpc/Performance_model)
18. [SDRAM topic, IEEE Technology Navigator](https://technav.ieee.org/topic/sdram/)
19. [AI data center, Micron Technology](https://www.micron.com/markets-industries/ai/ai-data-center)
20. [Exploring Apple Silicon's local AI performance with the Mac Studio and M4 Max, Tom's Hardware](https://www.tomshardware.com/desktops/exploring-apple-silicons-local-ai-performance-with-the-mac-studio-and-m4-max-m4-max-beats-gb10-and-strix-halo-in-decode-throughput-but-memory-bandwidth-isnt-everything)
21. [Ryzen Z2 Extreme gaming benchmarks, PC Gamer](https://www.pcgamer.com/hardware/handheld-gaming-pcs/the-first-gaming-benchmarks-for-amds-ryzen-z2-extreme-show-memory-bandwidth-is-hobbling-the-full-potential-the-new-handheld-chip/)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Storage devices & memory

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/memory-bandwidth

English original: https://www.edgepedia.org/memory-bandwidth
