arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.17345cs.MScs.LG
收藏

机器学习中伪随机数生成器的可复现性、能效与性能:Python、NumPy、TensorFlow和PyTorch实现的比较研究

Reproducibility, energy efficiency and performance of pseudorandom number generators in machine learning: a comparative study of python, numpy, tensorflow, and pytorch implementations

CNRS(法国国家科学研究中心);Clermont Auvergne INP(克莱蒙奥弗涅国立高等学院);Université Clermont Auvergne(克莱蒙奥弗涅大学);Mines St-Etienne(圣埃蒂安国立矿业学校)

Benjamin Antunes, David R. C Hill

AI总结:

本研究比较了Python、NumPy、TensorFlow和PyTorch中主流伪随机数生成器(PRNGs)在可复现性、能效与性能上的表现,发现其时间与能耗接近C实现,统计质量可比,但跨平台数值可复现性未能实现。

摘要:

伪随机数生成器(PRNGs)在机器学习技术中已变得无处不在,因为它们对众多方法都具有重要意义。正如大语言模型(LLMs)最近的突破所例证的那样,机器学习领域在各个领域都拥有取得实质性进展的潜力。然而,尽管人们的兴趣日益浓厚,但持续存在的担忧包括与可复现性和能耗相关的问题。可复现性对于稳健的科学探究和可解释性至关重要,而能效则强调节约有限全球资源的必要性。本研究深入调查了机器学习语言、库和框架中采用的领先伪随机数生成器(PRNGs)在与各自PRNG算法的原始C实现相比时,是否保持了统计质量和数值可复现性。此外,我们还旨在评估各种实现的时间效率和能耗。我们的实验涵盖了Python、NumPy、TensorFlow和PyTorch,使用了Mersenne Twister、PCG和Philox算法。值得注意的是,我们验证了机器学习技术的时间性能与基于C的实现密切吻合,在某些情况下甚至取得了更优的性能。另一方面,值得注意的是,机器学习技术仅比其C实现对应版本多消耗了10%的能量。然而,虽然发现统计质量具有可比性,但在不同平台上针对相同种子和算法实现数值可复现性却未能达成。

英文摘要:

Pseudo-Random Number Generators (PRNGs) have become ubiquitous in machine learning technologies because they are interesting for numerous methods. The field of machine learning holds the potential for substantial advancements across various domains, as exemplified by recent breakthroughs in Large Language Models (LLMs). However, despite the growing interest, persistent concerns include issues related to reproducibility and energy consumption. Reproducibility is crucial for robust scientific inquiry and explainability, while energy efficiency underscores the imperative to conserve finite global resources. This study delves into the investigation of whether the leading Pseudo-Random Number Generators (PRNGs) employed in machine learning languages, libraries, and frameworks uphold statistical quality and numerical reproducibility when compared to the original C implementation of the respective PRNG algorithms. Additionally, we aim to evaluate the time efficiency and energy consumption of various implementations. Our experiments encompass Python, NumPy, TensorFlow, and PyTorch, utilizing the Mersenne Twister, PCG, and Philox algorithms. Remarkably, we verified that the temporal performance of machine learning technologies closely aligns with that of C-based implementations, with instances of achieving even superior performances. On the other hand, it is noteworthy that ML technologies consumed only 10% more energy than their C-implementation counterparts. However, while statistical quality was found to be comparable, achieving numerical reproducibility across different platforms for identical seeds and algorithms was not achieved.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑