基于机器学习的分析方法理解NVIDIA Ada Lovelace上的GEMM性能与能耗
Understanding GEMM Performance and Energy on NVIDIA Ada Lovelace: A Machine Learning-Based Analytical Approach
AI总结:
本研究构建分析框架预测现代GPU上GEMM的运行时间、功耗及能效,通过自定义分块内核与CUTLASS库收集数据,基于RTX 4070开发随机森林多输出预测模型,识别关键性能模式并开源框架。
摘要:
本研究针对现代GPU上通用矩阵乘法(GEMM)的性能预测构建分析框架,聚焦运行时间、功耗及能效。我们采用两种方法:一是自定义实现的分块矩阵乘法内核以开展基础分析,二是利用NVIDIA的CUTLASS库在多种高级配置下全面收集性能数据。以NVIDIA RTX 4070为实验平台,我们开发了具备多输出回归能力的基于随机森林的预测模型。通过分析分块大小为1至32的朴素分块矩阵乘法,以及16128种不同配置下的CUTLASS GEMM运算,我们识别出与矩阵维度、线程块配置及内存访问模式相关的关键性能模式。我们的框架预测精度优异,运行时间预测的R²得分为0.98(平均误差15.57%),功耗预测的R²得分为0.78(中位数误差5.42%)。该系统可成功预测不同矩阵大小下的性能,展现出稳健的缩放行为。结果显示,相比基准配置,选择最优分块大小可将性能提升至多3.2倍,同时降低22%的功耗。对共享内存利用率和SM占用率的分析表明,16x16的分块大小能在并行性与资源使用间实现最佳平衡。我们的框架实现(含预测模型与分析工具)作为开源项目GPPerf发布,地址为https://github.com/pavlyhalim/GPPerf。
英文摘要:
Analytical framework for predicting General Matrix Multiplication (GEMM) performance on modern GPUs, focusing on runtime, power consumption, and energy efficiency. Our study employs two approaches: a custom-implemented tiled matrix multiplication kernel for fundamental analysis, and NVIDIA's CUTLASS library for comprehensive performance data collection across advanced configurations. Using the NVIDIA RTX 4070 as our experimental platform, we developed a Random Forest-based prediction model with multi-output regression capability. Through analysis of both naive tiled matrix multiplication with varying tile sizes (1 to 32) and 16,128 CUTLASS GEMM operations across diverse configurations, we identified critical performance patterns related to matrix dimensions, thread block configurations, and memory access patterns. Our framework achieved exceptional accuracy with an R^2 score of 0.98 for runtime prediction (mean error 15.57%) and 0.78 for power prediction (median error 5.42%). The system successfully predicts performance across matrix sizes, demonstrating robust scaling behavior. Our results show that optimal tile size selection can improve performance by up to 3.2x while reducing power consumption by 22% compared to baseline configurations. Analysis of shared memory utilization and SM occupancy reveals that tile sizes of 16x16 achieve the best balance between parallelism and resource usage. The implementation of our framework, including prediction models and analysis tools, is available as an open-source project at GPPerf [https://github.com/pavlyhalim/GPPerf].
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。