无需硬件训练,通用编码代理通过多阶段协作实现高效硬件优化。
Agent Factories for High Level Synthesis: How Far Can General-Purpose Coding Agents Go in Hardware Optimization?
- 构建双阶段代理工厂,分步优化子核并全局求解约束配置。
- 10个代理时平均提速8.27倍,部分难题超20倍,优于传统方法。
- 适合对硬件加速感兴趣的开发者,无需领域知识即可生成优质设计。
我们开展实证研究,探讨通用编码代理(无硬件专项训练)从高层算法描述中优化硬件设计的能力。提出一种代理工厂,采用两阶段流程:第一阶段将设计分解为子核,独立进行指令和代码级变换优化,并构建整数线性规划(ILP)问题,在面积约束下组合出全局有潜力的配置;第二阶段在最优的ILP解上启动N个专家代理,探索跨功能优化如指令重组、循环融合与内存重构等,这些未被子核分解捕获。在HLS-Eval和Rodinia-HLS的12个核上使用Claude Code(Opus 4.5/4.6)与AMD Vitis HLS评估,代理数量从1增至10时,平均速度提升8.27倍,更难任务中表现更优:streamcluster超过20倍,kmeans约10倍。各基准上代理均能复现已知优化模式,且最佳设计常来自非顶级的ILP候选,说明全局搜索可发现子核优化遗漏的改进。结果表明代理规模扩展是硬件综合优化的有效路径。
原文摘要 · Abstract (English)
We present an empirical study of how far general-purpose coding agents -- without hardware-specific training -- can optimize hardware designs from high-level algorithmic specifications. We introduce an agent factory, a two-stage pipeline that constructs and coordinates multiple autonomous optimization agents. In Stage~1, the pipeline decomposes a design into sub-kernels, independently optimizes each using pragma and code-level transformations, and formulates an Integer Linear Program (ILP) to assemble globally promising configurations under an area constraint. In Stage~2, it launches $N$ expert agents over the top ILP solutions, each exploring cross-function optimizations such as pragma recombination, loop fusion, and memory restructuring that are not captured by sub-kernel decomposition. We evaluate the approach on 12 kernels from HLS-Eval and Rodinia-HLS using Claude Code (Opus~4.5/4.6) with AMD Vitis HLS. Scaling from 1 to 10 agents yields a mean $8.27\times$ speedup over baseline, with larger gains on harder benchmarks: streamcluster exceeds $20\times$ and kmeans reaches approximately $10\times$. Across benchmarks, agents consistently rediscover known hardware optimization patterns without domain-specific training, and the best designs often do not originate from top-ranked ILP candidates, indicating that global optimization exposes improvements missed by sub-kernel search. These results establish agent scaling as a practical and effective axis for HLS optimization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。