<p>Machine Learning (ML)-based solutions have currently surpassed human performance in tasks like image classification, visual reasoning, and English understanding. However, this advancement comes at the cost of increasing energy consumption. Traditionally, ML projects have prioritized accuracy over energy, creating a gap in energy consumption during model inference. This study aims to (i) understand image classification datasets and pre-trained models, which is essential for the subsequent analyses, (ii) improve inference efficiency by comparing optimized and non-optimized models, and (iii) assess the economic impact of the optimizations. We conduct a controlled experiment to evaluate the impact of various PyTorch optimization techniques (dynamic quantization, <Emphasis FontCategory="NonProportional">torch.compile</Emphasis>, local pruning, and global pruning) on 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 optimization techniques. Dynamic quantization demonstrates inference time and energy consumption reductions, making it suitable for large-scale systems. <Emphasis FontCategory="NonProportional">Torch.compile</Emphasis> balances accuracy and energy. Local pruning shows no positive impact on accuracy, and global pruning’s longer optimization times impact economic costs. 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.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Impact of ML optimization tactics on greener pre-trained ML models

  • Alexandra González,
  • Joel Castaño,
  • Xavier Franch,
  • Silverio Martínez-Fernández

摘要

Machine Learning (ML)-based solutions have currently surpassed human performance in tasks like image classification, visual reasoning, and English understanding. However, this advancement comes at the cost of increasing energy consumption. Traditionally, ML projects have prioritized accuracy over energy, creating a gap in energy consumption during model inference. This study aims to (i) understand image classification datasets and pre-trained models, which is essential for the subsequent analyses, (ii) improve inference efficiency by comparing optimized and non-optimized models, and (iii) assess the economic impact of the optimizations. We conduct a controlled experiment to evaluate the impact of various PyTorch optimization techniques (dynamic quantization, torch.compile, local pruning, and global pruning) on 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 optimization techniques. Dynamic quantization demonstrates inference time and energy consumption reductions, making it suitable for large-scale systems. Torch.compile balances accuracy and energy. Local pruning shows no positive impact on accuracy, and global pruning’s longer optimization times impact economic costs. 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.