arXiv:2411.16954cs.DCcs.AI2024-11被引 1

用机器学习预测英伟达显卡矩阵运算性能与功耗,精准度超98%。

Understanding GEMM Performance and Energy on NVIDIA Ada Lovelace: A Machine Learning-Based Analytical Approach

  • 基于随机森林建模,结合自研核函数与CUTLASS库数据
  • 预测运行时误差仅15.57%,功耗中位误差5.42%,准确率高
  • 可指导显卡优化,适合深度学习开发者和硬件研究者

本文提出一种分析框架,用于预测现代GPU上通用矩阵乘法(GEMM)的运行时间、功耗与能效。实验基于NVIDIA RTX 4070显卡,采用自研分块矩阵乘法核与NVIDIA CUTLASS库,覆盖16,128种不同配置下的性能数据。通过构建具备多输出回归能力的随机森林模型,分析了矩阵尺寸、线程块配置与内存访问模式对性能的影响。结果表明,该框架在运行时预测上达到0.98的R²得分(平均误差15.57%),功耗预测中位误差为5.42%(R²=0.78)。最优分块大小(16x16)可使性能提升3.2倍,同时降低22%功耗。共享内存利用率与流多处理器占用率分析显示,16x16分块在并行性与资源使用间取得最佳平衡。完整代码与模型已开源,项目名为GPPerf。

原文摘要 · Abstract (English)

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].

GEMM性能预测能效优化随机森林

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。