LOOPRAG: Enhancing Loop Transformation Optimization with Retrieval-Augmented Large Language Models
Yijie Zhi, Yayu Cao, Jianhua Dai, Xiaoyang Han, Jingwen Pu, Qingran Wu, Sheng Cheng, Ming Cai

TL;DR
LOOPRAG introduces a retrieval-augmented framework leveraging large language models to optimize loop transformations effectively, achieving significant performance speedups on benchmark suites.
Contribution
The paper presents a novel retrieval-augmented approach with a loop-aware algorithm and feedback mechanism to improve LLM-based loop optimization.
Findings
Achieves up to 14.34× speedup over base compilers.
Outperforms baseline LLMs with up to 11.97× speedup.
Demonstrates effectiveness on multiple benchmark suites.
Abstract
Loop transformations are semantics-preserving optimization techniques, widely used to maximize objectives such as parallelism. Despite decades of research, applying the optimal composition of loop transformations remains challenging due to inherent complexities, including cost modeling for optimization objectives. Recent studies have explored the potential of Large Language Models (LLMs) for code optimization. However, our key observation is that LLMs often struggle with effective loop transformation optimization, frequently leading to errors or suboptimal optimization, thereby missing opportunities for performance improvements. To bridge this gap, we propose LOOPRAG, a novel retrieval-augmented generation framework designed to guide LLMs in performing effective loop optimization on Static Control Part. We introduce a parameter-driven method to harness loop properties, which trigger…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Embedded Systems Design Techniques · Logic, programming, and type systems
