性能

SM 利用率SM utilization

SM 利用率衡量 流式多处理器 (SM) 执行指令的时间百分比。

SM 利用率类似于 `nvidia-smi` 报告中更为人熟知的 内核利用率,但粒度更细。它并非报告 内核 在 GPU 任意位置执行的时间占比,而是报告所有 SM 执行 内核 的时间比例。如果一个 内核 仅使用一个 SM(例如,因为它只有一个 线程块),那么在其活动期间,GPU 利用率可达到 100%,但 SM 利用率最多仅为 SM 总数的倒数——在 H100 GPU 中这一比例不足 1 %。

与 GPU 利用率类似但不同于 CPU 利用率,SM 利用率应保持较高水平,甚至达到 100%。

但尽管 SM 利用率比 GPU 利用率粒度更细,它仍不足以精确反映 GPU 计算资源的使用效率。如果 SM 利用率很高,但性能仍不理想,程序员应检查 流水线利用率,该指标衡量每个 SM 使用其内部功能单元的利用效率。高 SM 利用率伴随低 流水线利用率 表明您的 内核 正在许多 SM 上运行,但未能充分利用每个 SM 内的计算资源。

英文原文(Modal GPU Glossary)

SM utilization measures the percentage of time that Streaming Multiprocessors (SMs) are executing instructions.

SM utilization is akin to the more familiar kernel utilization reported by `nvidia-smi`, but more fine-grained. Instead of reporting the fraction of time that a kernel is executing anywhere on the GPU, it reports the fraction of time all SMs spend executing kernels. If a kernel uses only one SM, e.g. because it only has one thread block, then it will achieve 100% GPU utilization while it is active, but the SM utilization will be at most one over the number of SMs — under 1% in an H100 GPU.

As with GPU utilization but unlike CPU utilization, SM utilization should be high, even up to 100%.

But even though SM utilization is finer-grained than GPU utilization, it still isn't fine-grained enough to capture how well the GPU's compute resources are being used. If SM utilization is high, but performance is still inadequate, programmers should check pipe utilization, which measures how effectively each SM uses its internal functional units. High SM utilization with low pipe utilization indicates that your kernel is running on many SMs but not fully utilizing the computational resources within each one.

相关词条

本词条改编自 Modal GPU Glossary(CC BY 4.0)· 中文翻译 miter6/gpu-glossary-zh,MAE 整理排版。