学习在 Meta 的生产环境中学习预测性能回归
Learning to Learn to Predict Performance Regressions in Production at Meta
AI总结:
本文总结了在 Meta 生产环境中预测代码变更引起的性能回归的经验,对比了四种复杂度递增的机器学习模型,发现定制的 SuperPerforator 架构虽初期表现一般,但在下游应用中能有效过滤变更空间达43%,并通过反事实解释验证了模型。
摘要:
捕获和归因生产环境中由代码变更引起的性能回归很困难;而事先预测它们则更加困难。作为自动学习预测软件中性能回归的入门介绍,本文记述了我们在 Meta 研究和部署基于机器学习的回归预测流水线时所获得的经验。在本文中,我们报告了一项包含四个复杂度递增的机器学习模型的对比研究,从 (1) 代码不透明模型,到 (2) Bag of Words,(3) 现成的基于 Transformer 的模型,再到 (4) 定制的基于 Transformer 的模型,命名为 SuperPerforator。我们的调查表明了性能预测问题的固有困难,其特征是良性变更与回归变更之间存在巨大的不平衡。我们的结果也对基于 Transformer 的架构在性能预测中的普遍适用性提出了质疑:基于现成 CodeBERT 的方法表现惊人地差;我们高度定制的 SuperPerforator 架构最初取得的预测性能仅与更简单的 Bag of Words 模型持平,并且仅在下游用例中才优于它们。SuperPerforator 迁移到只有少量学习样本的应用上的能力,使其有机会在 Meta 的实际部署中得到应用:它可以作为预过滤器,筛选出不太可能引入回归的变更,将搜索回归的变更空间缩减多达 43%,比随机基线提高了 45 倍。为了进一步深入了解 SuperPerforator,我们通过一系列计算反事实解释的实验对其进行了探索。这些解释突出了模型认为代码变更中哪些部分是重要的,从而验证了所学习的黑盒模型。
英文摘要:
Catching and attributing code change-induced performance regressions in production is hard; predicting them beforehand, even harder. A primer on automatically learning to predict performance regressions in software, this article gives an account of the experiences we gained when researching and deploying an ML-based regression prediction pipeline at Meta. In this paper, we report on a comparative study with four ML models of increasing complexity, from (1) code-opaque, over (2) Bag of Words, (3) off-the-shelve Transformer-based, to (4) a bespoke Transformer-based model, coined SuperPerforator. Our investigation shows the inherent difficulty of the performance prediction problem, which is characterized by a large imbalance of benign onto regressing changes. Our results also call into question the general applicability of Transformer-based architectures for performance prediction: an off-the-shelve CodeBERT-based approach had surprisingly poor performance; our highly customized SuperPerforator architecture initially achieved prediction performance that was just on par with simpler Bag of Words models, and only outperformed them for down-stream use cases. This ability of SuperPerforator to transfer to an application with few learning examples afforded an opportunity to deploy it in practice at Meta: it can act as a pre-filter to sort out changes that are unlikely to introduce a regression, truncating the space of changes to search a regression in by up to 43%, a 45x improvement over a random baseline. To gain further insight into SuperPerforator, we explored it via a series of experiments computing counterfactual explanations. These highlight which parts of a code change the model deems important, thereby validating the learned black-box model.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。