NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

HPC-Coder-v2: Studying Code LLMs Across Low-Resource Parallel Languages

Aman Chaturvedi, Daniel Nichols, Siddharth Singh, Abhinav Bhatele

TL;DR

General-purpose code LLMs frequently stumble when tasked with writing complex parallel code for High-Performance Computing (HPC). To bridge this gap, the authors introduce HPC-INSTRUCT, a dataset of 122k synthetic parallel code pairs, and conduct a systematic study of fine-tuning configurations. Their resulting model, HPC-Coder-V2, sets a new state-of-the-art for open-source parallel code generation, rivaling GPT-4 performance while remaining small enough to run efficiently on standard hardware.

What Problem Does This Paper Address?

While AI coding assistants have supercharged general software development, specialized domains like High-Performance Computing (HPC) have been left behind. Writing correct parallel code (using frameworks like MPI, OpenMP, and CUDA) is notoriously difficult for humans and AI alike.

The root cause is twofold: parallel code is severely underrepresented in standard web-scraped training datasets (a low-resource data problem), and parallel programming requires complex algorithmic reasoning. Simply scraping more data doesn't help; recent massive models trained on nearly all permissive online code show stagnant performance in parallel tasks. This paper tackles the data scarcity issue by figuring out how to generate better synthetic data and determining the optimal recipe for fine-tuning models on it.

Methods

The authors developed a structured pipeline to generate high-quality training data and optimize model performance:

  1. Seed-Based Synthetic Generation: To prevent the repetitive outputs common to commercial LLMs, the authors gathered 125k open-source "seed" snippets from HPC codebases. They fed these seeds into four state-of-the-art frontier models (Llama-3-70B, Gemini-Pro, DBRX, and Mixtral-8x7B) along with four distinct prompt templates: programming, translation, optimization, and parallelization.
  2. Ablation Studies: Before training their final model, they ran extensive controlled experiments to isolate what actually drives fine-tuning success. They tested the choice of base vs. instruct models, the impact of instruction masking, data volume, and data source quality.
  3. Model Training: Using the insights from their ablations, they fine-tuned DeepSeek-Coder models (1.3B, 6.7B, and a 16B Mixture-of-Experts model) using the AxoNN framework for efficient multi-node parallel training.
Overview of the proposed methodology

Datasets

The study leverages a mix of newly introduced and established datasets:

  • HPC-INSTRUCT: The authors' newly introduced dataset containing roughly 122k high-quality synthetic parallel code instruction-response pairs spanning languages like C, C++, Fortran, Python, CUDA, Chapel, and OpenCL.
  • General Code Datasets: Magicoder-OSS-Instruct-75K and Evol-Instruct-Code-80k-v1 were mixed into the training data (totaling 277k samples) to ensure the models maintained strong general coding and generalization capabilities.
  • ParEval: A state-of-the-art parallel code generation benchmark consisting of 420 problems across 12 problem types and 7 execution models, used exclusively to evaluate code correctness.
Synthetic data generation process

Key Insights and Ideas

The paper's ablation studies revealed several counter-intuitive findings that challenge standard LLM fine-tuning wisdom:

  • Base Models Beat Instruct Variants: Fine-tuning a raw base model yields significantly better parallel code generation than fine-tuning an already-aligned instruct model. Pre-aligned instruct models appear to lose some of their distributional generality, making them harder to adapt to niche tasks.
  • Instruction Masking is Unnecessary: Standard practice dictates masking out the prompt's tokens so the model only learns from the response. The authors found that instruction masking has virtually no positive impact on parallel code generation, and sometimes even hurts performance.
  • Quality Over Quantity: For larger models (6.7B+), simply adding more data for a specific execution model (like MPI) yielded flat returns. However, changing the source of the data (e.g., using Llama-3-70B instead of DBRX as the synthetic generator) swung performance by up to 6 percentage points, proving that data quality is the true bottleneck.
  • Diminishing Returns on Scale: Moving from a 1.3B to a 6.7B parameter model provides a massive performance leap, but scaling further to 16B yields much smaller marginal gains, suggesting a performance ceiling imposed by knowledge distillation.

Key Results

Evaluated on the rigorous ParEval benchmark, HPC-Coder-V2 achieved standout results:

  • Top Open-Source Performance: HPC-Coder-V2 is the highest-performing open-source model for parallel code generation to date.
  • Punching Above Its Weight Class: The HPC-Coder-V2-6.7B model outperformed the much larger 34B Phind-V2 model on parallel tasks while delivering significantly higher token throughput and requiring a fraction of the memory footprint.
  • Rivaling Frontier Models: The HPC-Coder-V2-16B model approached the parallel code generation capabilities of commercial giants like GPT-3.5 and GPT-4.

Limitations and Future Work

Despite its success, the authors highlight clear boundaries for current models:

  • The Structural Blindspot: While HPC-Coder-V2 excels at dense, structured problems (like dense linear algebra and stencils), it still struggles with sparse, unstructured problems (like graphs and sparse linear algebra).
  • The MPI Hurdle: Across the board, models still find distributed memory models (MPI) significantly harder to generate accurately than shared memory models (OpenMP).
  • Distillation Ceilings: Because the dataset is synthetically generated by frontier models, the student models are inherently bounded by the capabilities of their "teachers."

Future work will focus on defining what structurally makes a synthetic sample "high quality" and developing advanced reasoning mechanisms so LLMs can better plan through complex parallel logic.

Summary updated

BibTeX
@inproceedings{chaturvedi2025hpc,
  author = {Aman Chaturvedi and Daniel Nichols and Siddharth Singh and Abhinav Bhatele},
  title = {{HPC-Coder-v2: Studying Code LLMs Across Low-Resource Parallel Languages}},
  booktitle = {ISC},
  year = {2025},
}
Figure