Application profiling is an indispensable technique for many software development tasks, such as code and memory layout optimizations, where optimization decisions are tailored to specific program profiles. Unfortunately, modern application codebases exhibit highly variant behavior across different inputs, creating challenges for conventional profiling approaches that rely on a single representative execution instance. In this paper, we propose \textbf{Phaedrus}, a new \textit{compiler-assisted deep learning framework} designed to predict dynamic program behaviors across varied execution instances, specifically focusing on dynamic function call prediction.Such predicted call sequences are then used for producing optimized code pertinent to a given input. Traditional profile-guided optimization methods struggle with the input-dependent variability of modern applications, where profiling on different inputs yields divergent application behaviors. To address this, Phaedrus proposes two new approaches: \textit{Application Behavior Synthesis}, a profile-less approach where Large Language Models (LLMs) directly infer dynamic functions based on source code \& static compiler analysis, bypassing the need for traditional profiling, and \textit{Application Profile Generalization}, which uses generative models trained on compressed and augmented \textit{Whole Program Path} (WPP) based function profiles to predict application behavior under unseen inputs. Our experiments show that \textit{Phaedrus} can achieve upto $10^7X$ reduction in WPP function profile sizes, can predict most frequently executed functions that cover upto 85-99\% of the execution time, along with an average of 13.19\% (upto 65\%) reduction in application binary size, and an average of 6.08\% (upto 20\%) performance improvement over the traditional profile-guided optimization, without any execution.


翻译:应用程序剖析是许多软件开发任务(如代码与内存布局优化)中不可或缺的技术,其中优化决策需根据特定程序剖析结果进行定制。然而,现代应用程序代码库在不同输入下表现出高度可变的行为,这对依赖单一代表性执行实例的传统剖析方法构成了挑战。本文提出**Phaedrus**——一种新型的**编译器辅助深度学习框架**,旨在预测不同执行实例间的动态程序行为,特别聚焦于动态函数调用预测。此类预测得到的调用序列随后将用于生成与给定输入相关的优化代码。传统的基于剖析的优化方法难以应对现代应用程序依赖于输入的变异性,即在不同输入上进行剖析会产生截然不同的应用程序行为。为解决此问题,Phaedrus提出两种新方法:**应用程序行为合成**(一种无需剖析的方法,通过大型语言模型直接基于源代码和静态编译器分析推断动态函数,绕过了传统剖析的需求)以及**应用程序剖析泛化**(该方法利用基于压缩和增强的**全程序路径**函数剖析训练的生成模型,预测未见输入下的应用程序行为)。实验表明,**Phaedrus**能实现高达$10^7$倍的全程序路径函数剖析规模缩减,可预测覆盖高达85-99%执行时间的最频繁执行函数,同时相比传统基于剖析的优化方法,在无需任何执行的情况下平均减少13.19%(最高65%)的应用程序二进制文件大小,并实现平均6.08%(最高20%)的性能提升。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
Top
微信扫码咨询专知VIP会员