Phaedrus:利用轻量级生成模型和大语言模型预测动态应用程序行为
Phaedrus: Predicting Dynamic Application Behavior with Lightweight Generative Models and LLMs
AI总结:
Phaedrus通过轻量级生成模型和大语言模型预测动态应用程序行为,实现无需执行的高效编译器优化。
摘要:
应用程序分析对于软件优化任务如代码布局和内存放置至关重要,其中优化决策依赖于程序行为。然而,现代应用程序表现出显著的输入依赖性变化,限制了传统分析方法的有效性,这些方法依赖于单一代表性执行。我们提出了Phaedrus,一种编译器辅助的深度学习框架,能够预测跨多样执行实例的动态程序行为,重点在于动态函数调用预测。这些预测的调用序列用于指导输入特定的编译器优化,使代码专门化而无需程序执行。Phaedrus引入了两种互补技术。应用程序行为合成(Dynamis)是一种无分析方法,其中大语言模型直接从源代码和静态编译器分析推断动态行为,绕过传统分析。应用程序配置文件泛化(Morpheus)利用在压缩和增强的整个程序路径(WPP)函数配置文件上训练的生成模型,以预测未见过的输入的应用程序行为。实验结果表明,Phaedrus能够准确识别频繁执行和运行时主导的热点函数,覆盖总执行时间的85-99%。利用这些预测,Phaedrus实现了更优的配置文件引导优化,平均性能提高了6%(最高25%),二进制大小减少了5.19%(最高19%),而无需执行目标程序。此外,Phaedrus将WPP函数配置文件大小减少了高达10^7倍。
英文摘要:
Application profiling is essential for software optimization tasks such as code layout and memory placement, where optimization decisions depend on program behavior. However, modern applications exhibit significant input-dependent variability, limiting the effectiveness of conventional profiling approaches that rely on a single representative execution. We present Phaedrus, a compiler-assisted deep learning framework that predicts dynamic program behavior across diverse execution instances, with a focus on dynamic function call prediction. These predicted call sequences are used to guide input-specific compiler optimizations, enabling code specialization without requiring program execution. Phaedrus introduces two complementary techniques. Application Behavior Synthesis (Dynamis) is a profile-less approach in which large language models infer dynamic behavior directly from source code and static compiler analysis, bypassing traditional profiling. Application Profile Generalization (Morpheus) employs generative models trained on compressed and augmented Whole Program Path (WPP) function profiles to predict application behavior for unseen inputs. Experimental results show that Phaedrus accurately identifies frequently executed and runtime-dominated hotspot functions, covering up to 85-99% of total execution time. Using these predictions, Phaedrus enables superior profile-guided optimizations, achieving an average performance improvement of 6% (upto 25%) and a binary size reduction of 5.19% (upto 19%), without executing the target program. Additionally, Phaedrus reduces WPP function profile sizes by up to $10^{7} \times $.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。