GLARE: Repository-Level Code Optimization Agents for Heterogeneous CPU-GPU Systems

Junfeng Gong, Cheng Liu, Junying Chen, Xiaowei Li, Huawei Li


Abstract
Recent LLM-based GPU code generation methods have shown promising results on CUDA and Triton kernels, but they typically operate on pre-isolated operators. Such a pre-isolated setting falls short in real-world CPU-GPU heterogeneous optimization, where the target computation is embedded in a larger repository and must be discovered, contextualized, selectively offloaded, and integrated. Such optimization requires repository-level context—including data structure definitions, caller patterns, build configurations, and profiling signals—that is largely absent from operator-level tasks and benchmarks. In this work, we propose GLARE, a profiling-guided framework for repository-level CPU-GPU heterogeneous optimization. GLARE anchors repository context in dynamic profiling signals, builds a multi-granular code dependency graph, extracts hotspot-centered active subgraphs, and uses an agentic loop to decide CPU-GPU partitioning and refine heterogeneous patches with execution feedback. On a GPU-acceleration subset of GSO with 63 tasks, GLARE improves OPT@1 from 74.6% to 87.3% over the strongest baseline under GPT-5.2, and achieves an 11.6% average end-to-end speedup. Ablation studies confirm that profiling-guided context construction is the primary driver of these gains.
Anthology ID:
2026.emnlp-main.1870
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
42615–42629
Language:
URL:
https://aclanthology.org/2026.emnlp-main.1870/
DOI:
Bibkey:
Cite (ACL):
Junfeng Gong, Cheng Liu, Junying Chen, Xiaowei Li, and Huawei Li. 2026. GLARE: Repository-Level Code Optimization Agents for Heterogeneous CPU-GPU Systems. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 42615–42629, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
GLARE: Repository-Level Code Optimization Agents for Heterogeneous CPU-GPU Systems (Gong et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.1870.pdf