🤖 AI Summary
To address the low code quality and poor adaptability of high-performance computing (HPC) code generated by large language models (LLMs), this paper proposes a multi-agent collaborative iterative prompt tuning framework. The framework comprises four specialized agents—Project Management, Systems Engineering, Programming, and Continuous Delivery—integrated with dynamic resource scheduling and runtime behavioral monitoring to enable automated prompt refinement and defect identification. Evaluated on a matrix multiplication case study, the method achieves fully automated CPU-to-CUDA code translation, outperforming single-agent baselines in both execution performance and quality-per-unit-time. It also effectively detects requirement deviations and implementation defects. The core contributions are: (1) a role-specialized multi-agent architecture tailored for HPC domains, and (2) a closed-loop prompt optimization mechanism that iteratively improves LLM-generated code through real-time feedback and constraint-aware refinement.
📝 Abstract
We propose VibeCodeHPC, an automatic tuning system for HPC programs based on multi-agent LLMs for code generation. VibeCodeHPC tunes programs through multi-agent role allocation and iterative prompt refinement. We describe the system configuration with four roles: Project Manager (PM), System Engineer (SE), Programmer (PG), and Continuous Delivery (CD). We introduce dynamic agent deployment and activity monitoring functions to facilitate effective multi-agent collaboration. In our case study, we convert and optimize CPU-based matrix-matrix multiplication code written in C to GPU code using CUDA. The multi-agent configuration of VibeCodeHPC achieved higher-quality code generation per unit time compared to a solo-agent configuration. Additionally, the dynamic agent deployment and activity monitoring capabilities facilitated more effective identification of requirement violations and other issues.