理解最新机器学习工作负载中非GEMM工作负载的性能边界
Understanding the Performance Horizon of the Latest ML Workloads with NonGEMM Workloads
AI总结:
针对非GEMM算子在机器学习推理中因GEMM加速而凸显的性能瓶颈问题,通过分析17个模型在多平台的表现,揭示其占总延迟11.3%-73.6%,量化会加剧该问题,且现有优化未完全解决,为非GEMM优化提供指导。
摘要:
在当前的机器学习算子中,基于通用矩阵乘法(GEMM)的算子是构建机器学习模型主骨干的关键算子。由于其计算开销主导了整体执行时间(例如,在我们的结果中占42.8%-96.6%),GEMM算子一直是快速机器学习推理的主要优化目标。这促成了如今先进GPU和加速器的出现,与阿姆达尔定律的经验一致,它们相比CPU显著提升了GEMM性能。然而,加速GEMM显著改变了机器学习推理的阿姆达尔定律格局;由于GEMM执行时间减少,非GEMM算子的相对执行时间现在变得显著。尽管非GEMM性能的重要性日益增加,但我们对最新硬件平台和模型中的非GEMM性能边界知之甚少。因此,为了指导面向非GEMM的优化,我们在带/不带GPU的工作站和数据中心平台上,对Hugging Face和Torchvision中17个广泛采用的机器学习模型进行了全面的性能分析。我们发现,非GEMM性能瓶颈是所有平台和模型中一个相当大的问题,平均占总延迟的11.3%-73.6%。当我们应用量化(一种常见的模型压缩技术)时,由于GEMM性能提升以及反量化和重量化所需的额外非GEMM算子,这一挑战显著加剧。为了提供非GEMM优化目标的见解,我们揭示了每个模型和部署软件中最主要的非GEMM算子。我们还表明,算子融合等广泛采用的优化并未完全解决非GEMM性能瓶颈,非GEMM算子仍占总延迟的15%-48%。
英文摘要:
Among ML operators today, GEneralMatrix Multiplication (GEMM)-based operators are known to be key operators that build the main backbone of ML models. As their computational overhead dominates the overall execution time (e.g., 42.8% - 96.6% in our results), GEMM operators have been the prime optimization targets for fast ML inference. This led to advanced GPUs and accelerators available today, which provided significant boost in the GEMM performance compared to CPUs, aligned with the lesson from Amdahl's law. However, accelerating GEMM has significantly shifted the Amdahl's law's landscape for ML inference; due to the decreased GEMM execution time, the relative execution time of non-GEMM operators is now significant. Although the importance of non-GEMM performance is increasing, we have little knowledge about the non-GEMM performance horizon in the latest hardware platforms and models. Therefore, to guide non-GEMM-oriented optimizations, we conduct a thorough performance analysis of 17 widely adopted ML models in Hugging Face and Torchvision on workstation and data center platforms with/without GPUs. We discover that non-GEMM performance bottleneck is a considerable issue across all the platforms and models, accounting for 11.3% to 73.6% of total latency, on average. The challenge significantly aggravates when we apply quantization, which is a common model compression technique, due to the boosted GEMM performance and extra non-GEMM operators for dequantization and requantization. To provide insights into non-GEMM optimization targets, we demystify the most dominant non-GEMM operators for each model and deployment software. We also show that widely adopted optimizations such as operator fusion do not completely address the non-GEMM performance bottleneck, where non-GEMM operators still account for 15% to 48% of total latency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。