Large Language Models (LLM) show strong abilities in code generation, but their skill in creating efficient parallel programs is less studied. This paper explores how LLMs generate task-based parallel code from three kinds of input prompts: natural language problem descriptions, sequential reference implementations, and parallel pseudo code. We focus on three programming frameworks: OpenMP Tasking, C++ standard parallelism, and the asynchronous many-task runtime HPX. Each framework offers different levels of abstraction and control for task execution. We evaluate LLM-generated solutions for correctness and scalability. Our results reveal both strengths and weaknesses of LLMs with regard to problem complexity and framework. Finally, we discuss what these findings mean for future LLM-assisted development in high-performance and scientific computing.
翻译:大型语言模型(LLM)在代码生成方面展现出强大的能力,但其在创建高效并行程序方面的技能研究较少。本文探讨了LLMs如何从三种输入提示生成基于任务的并行代码:自然语言问题描述、顺序参考实现和并行伪代码。我们聚焦于三种编程框架:OpenMP任务化、C++标准并行以及异步多任务运行时HPX。每种框架为任务执行提供了不同层次的抽象和控制。我们评估了LLM生成解决方案的正确性和可扩展性。我们的结果揭示了LLMs在问题复杂性和框架方面存在的优势与不足。最后,我们讨论了这些发现对未来高性能计算和科学计算中LLM辅助开发的意义。