用多智能体LLM自动生成能发现隐藏错误的高性能计算单元测试
HPCAgentTester: A Multi-Agent LLM Approach for Enhanced HPC Unit Test Generation
- 分角色协作的LLM智能体通过迭代优化生成测试用例
- 对OpenMP/MPI代码生成可编译且功能正确的测试,漏检率更低
- 适合需要高可靠性并行软件的开发者和测试团队
高性能计算(HPC)中的单元测试至关重要,但受并行性、复杂算法和多样硬件挑战,传统方法难以处理非确定性行为和同步问题。本文提出HPCAgentTester,一种基于多智能体大型语言模型(LLM)的框架,用于自动化生成使用OpenMP和MPI的HPC软件单元测试。该框架采用独特协作流程,由专用的配方智能体(Recipe Agent)和测试智能体(Test Agent)通过批判循环迭代生成并优化测试用例。此架构可生成针对并行执行结构、复杂通信模式和层次化并行性的上下文感知测试。实验表明,HPCAgentTester能生成可编译且功能正确的测试,有效识别传统技术常遗漏的细微缺陷。评估显示,相比独立使用LLM,其测试编译成功率和正确性显著提升,为确保并行软件系统可靠性提供了更鲁棒、可扩展的解决方案。
原文摘要 · Abstract (English)
Unit testing in High-Performance Computing (HPC) is critical but challenged by parallelism, complex algorithms, and diverse hardware. Traditional methods often fail to address non-deterministic behavior and synchronization issues in HPC applications. This paper introduces HPCAgentTester, a novel multi-agent Large Language Model (LLM) framework designed to automate and enhance unit test generation for HPC software utilizing OpenMP and MPI. HPCAgentTester employs a unique collaborative workflow where specialized LLM agents (Recipe Agent and Test Agent) iteratively generate and refine test cases through a critique loop. This architecture enables the generation of context-aware unit tests that specifically target parallel execution constructs, complex communication patterns, and hierarchical parallelism. We demonstrate HPCAgentTester's ability to produce compilable and functionally correct tests for OpenMP and MPI primitives, effectively identifying subtle bugs that are often missed by conventional techniques. Our evaluation shows that HPCAgentTester significantly improves test compilation rates and correctness compared to standalone LLMs, offering a more robust and scalable solution for ensuring the reliability of parallel software systems.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。