比较Python与R在机器学习中的能耗,发现语言选择影响能效高达99.8%
Who Wins the Race? (R Vs Python) - An Exploratory Study on Energy Consumption of Machine Learning Algorithms
- 实测5个回归与5个分类任务在Python和R中的能耗与运行时表现
- 95%情况下两语言能耗差异显著,训练/推理能效差达99.16%和99.8%
- 为降低碳排放提供编程语言选型依据,适合关注绿色计算的研究者
机器学习在现代软件系统中广泛应用且持续扩展,但其使用能耗高,加剧碳排放并消耗大量资源。尽管已有研究关注模型性能与准确率,但针对环境影响(尤其是能耗)的探讨仍有限。现有对不同编程语言在特定算法任务中能耗的比较也较少,尤其缺乏对机器学习任务的系统性对比。本文通过实证研究,测量并比较了在五种回归与五种分类任务中,使用Python与R两种主流语言进行模型训练与推理的能耗与运行性能。结果表明,在95%的案例中,两种语言的能耗差异具有统计显著性。分析显示,编程语言的选择可显著影响能源效率:相同任务下,训练阶段能效差距最高达99.16%,推理阶段最高达99.8%。
原文摘要 · Abstract (English)
The utilization of Machine Learning (ML) in contemporary software systems is extensive and continually expanding. However, its usage is energy-intensive, contributing to increased carbon emissions and demanding significant resources. While numerous studies examine the performance and accuracy of ML, only a limited few focus on its environmental aspects, particularly energy consumption. In addition, despite emerging efforts to compare energy consumption across various programming languages for specific algorithms and tasks, there remains a gap specifically in comparing these languages for ML-based tasks. This paper aims to raise awareness of the energy costs associated with employing different programming languages for ML model training and inference. Through this empirical study, we measure and compare the energy consumption along with run-time performance of five regression and five classification tasks implemented in Python and R, the two most popular programming languages in this context. Our study results reveal a statistically significant difference in costs between the two languages in 95% of the cases examined. Furthermore, our analysis demonstrates that the choice of programming language can influence energy efficiency significantly, up to 99.16% during model training and up to 99.8% during inferences, for a given ML task.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。