arXiv:2409.12878cs.LGcs.SE2024-09被引 5

优化技术让大模型更省电,动态量化最有效。

Impact of ML Optimization Tactics on Greener Pre-Trained ML Models

  • 对比42个模型,用动态量化等技术降低能耗
  • 动态量化使推理耗时和能耗大幅下降
  • 适合关注可持续性的开发者参考

背景:随着机器学习在图像分类、视觉推理和英文理解等任务上超越人类表现,评估其对能源消耗的影响变得至关重要。传统上,ML项目侧重准确率而忽视能耗,导致推理阶段能效低下。目标:本研究旨在(i)分析图像分类数据集与预训练模型,(ii)通过对比优化与未优化模型提升推理效率,(iii)评估优化的经济影响。方法:对42个Hugging Face图像分类模型,系统评估PyTorch中的动态量化、torch.compile、局部剪枝和全局剪枝等优化技术。考察指标包括GPU利用率、功耗与能耗、准确率、时间、计算复杂度及经济成本。通过重复测试量化软件工程策略的影响。结果:动态量化显著降低推理时间和能耗,适用于大规模系统;torch.compile在准确率与能耗间取得平衡;局部剪枝未带来性能提升,全局剪枝因优化时间过长推高成本。结论:本研究凸显了软件工程策略在实现绿色机器学习中的作用,为从业者提供契合可持续发展目标的优化决策指南。

原文摘要 · Abstract (English)

Background: Given the fast-paced nature of today's technology, which has surpassed human performance in tasks like image classification, visual reasoning, and English understanding, assessing the impact of Machine Learning (ML) on energy consumption is crucial. Traditionally, ML projects have prioritized accuracy over energy, creating a gap in energy consumption during model inference. Aims: This study aims to (i) analyze image classification datasets and pre-trained models, (ii) improve inference efficiency by comparing optimized and non-optimized models, and (iii) assess the economic impact of the optimizations. Method: We conduct a controlled experiment to evaluate the impact of various PyTorch optimization techniques (dynamic quantization, torch.compile, local pruning, and global pruning) to 42 Hugging Face models for image classification. The metrics examined include GPU utilization, power and energy consumption, accuracy, time, computational complexity, and economic costs. The models are repeatedly evaluated to quantify the effects of these software engineering tactics. Results: Dynamic quantization demonstrates significant reductions in inference time and energy consumption, making it highly suitable for large-scale systems. Additionally, torch.compile balances accuracy and energy. In contrast, local pruning shows no positive impact on performance, and global pruning's longer optimization times significantly impact costs. Conclusions: This study highlights the role of software engineering tactics in achieving greener ML models, offering guidelines for practitioners to make informed decisions on optimization methods that align with sustainability goals.

模型优化节能量化推理效率

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