AgRefactor: Self-Evolving Agentic Workflow for HLS Compatibility and Performance
The core contribution of "AgRefactor: Self-Evolving Agentic Workflow for HLS Compatibility and Performance," authored by Yang Zou, Zijian Ding, Yizhou Sun, and Jason Cong, is an LLM-based multi-agent system designed to automate the challenging process of refactoring general software into High-Level Synthesis (HLS) compatible code. This work addresses the significant gap between the rapid development cycle enabled by HLS and the difficulties in translating complex, real-world software, which often relies on programming idioms not directly supported by hardware design constraints. Existing automated HLS conversion and earlier LLM approaches often suffer from a lack of flexibility, scalability issues, and prohibitive computational costs. AgRefactor aims to overcome these limitations for software engineers and hardware researchers engaged in HLS design.
Key technical advancements include a self-evolving memory system, which allows the agents to accumulate and effectively retrieve factual and strategic knowledge gained from previous refactoring tasks. This mechanism enhances robustness and efficiency when applied to novel or unseen programs. Furthermore, AgRefactor incorporates a hybrid approach that integrates automated refactoring tools alongside LLM-driven transformations. This allows the agents to intelligently balance the precision and flexibility of LLM-based rewrites with the scalability and computational efficiency of established tool-based transformations, thereby reducing overall costs. The paper demonstrates AgRefactor's effectiveness on nine out of eleven challenging, real-world benchmarks, some of which are significantly larger than those previously studied. Notably, it achieves competitive or superior performance compared to state-of-the-art automated refactoring tools and a strong LLM baseline. Beyond functional compatibility, AgRefactor's agentic performance optimization yielded a 6.51x geometric mean speedup over a leading pragma tuning tool and a 1.20x speedup over optimized open-source designs, with a modest increase in resource utilization. This research, presented on arXiv in the computer science category of Artificial Intelligence and Hardware Architecture, suggests a future where complex software can be more readily deployed on hardware accelerators through automated, intelligent refactoring, potentially accelerating the adoption of HLS for a wider range of applications. This analysis is based on the abstract provided.