Engineering PapersSearch

DOE OSTI · 3014267

ChatMPI: LLM-Driven MPI Code Generation for HPC Workloads

Abstract

The Message Passing Interface (MPI) standard plays a crucial role in enabling scientific applications for parallel computing and is an essential component in high-performance computing (HPC). However, implementing MPI code manually—especially applying a proper domain decomposition and communication pattern—is a challenging and error-prone task. We present ChatMPI, an AI assistant for MPI parallelization of sequential C codes. In our analysis, we focus on testing six essential HPC workloads, which are based on Basic Linear Algebra Subprograms levels 1, 2, and 3 as well as sparse, stencil, and iterative operations. We analyze the process of creating ChatMPI by using the ChatHPC library. This lightweight large language model (LLM)–based infrastructure enables HPC experts to efficiently create and supervise trustworthy AI capabilities for critical HPC software tasks. We study the data required for training (fine-tuning) ChatMPI to generate parallel codes that not only use MPI syntax correctly but also apply HPC techniques to reduce memory communication and maximize performance by using proper work decomposition. With a relatively small training dataset composed of a few dozen prompts and fewer than 15 minutes of fine-tuning on one node equipped with two NVIDIA H100 GPUs, ChatMPI elevates trustworthiness for MPI code generation of current LLMs (e.g., Code Llama, ChatGPT-4o and ChatGPT 5). Additionally, we evaluate the performance of the MPI codes generated by ChatMPI in comparison with the ones generated by ChatGPT-4o and ChatGPT-5. The codes generated by ChatMPI provide up to a 4 × boost in performance by using better problem decomposition, communication patterns, and HPC techniques (e.g., communication avoiding).

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Valero Lara, Pedro [ORNL] (ORCID:0000000214794310), Young, Aaron [ORNL] (ORCID:0000000254484667), Naughton III, Thomas [ORNL] (ORCID:0000000235462382), Engelmann, Christian [ORNL] (ORCID:0000000343656416), Geist II, Al [ORNL] (ORCID:0000000193501688), Vetter, Jeffrey [ORNL] (ORCID:0000000224496720), Teranishi, Keita [ORNL] (ORCID:0000000166472690), Godoy, William [ORNL] (ORCID:0000000225905178). 2026-01-01. ChatMPI: LLM-Driven MPI Code Generation for HPC Workloads. https://doi.org/10.1145/3773656.3773659

Cite the original work for its findings. Save a collection to share your selection of sources.