arXiv:2611.02752cs.PFNov 2026

Manuscript Offprint

arXiv:2611.02752

HPC-Bench: A Comprehensive Benchmark for High Performance Computing Codes

Bowen Cui, Junyu Yin, Tejas Ramesh, Leo Lim, Oscar Hernandez, Keren Zhou

Bowen Cui

George Mason University bcui2@gmu.edu

Junyu Yin

George Mason University jyin7@gmu.edu

Tejas Ramesh

George Mason University tramesh2@gmu.edu

Leo Lim

TJHSS reverileo@gmail.com

Oscar Hernandez

Oak Ridge National Lab oscar@ornl.gov

Keren Zhou

George Mason University kzhou6@gmu.edu

Abstract

Large Language Models (LLMs) have shown strong capabilities in code generation and reasoning, motivating extensive benchmarks for evaluating functional correctness. However, performance optimization in High-Performance Computing (HPC) poses fundamentally different challenges that are not captured by existing evaluations: HPC performance depends on low-level code, intricate memory access patterns, and computational kernels embedded within sophisticated execution contexts. We introduce HPC-Bench, a performance-grounded benchmark for evaluating LLMs as optimizers of computational kernels in realistic HPC workloads, including 114 workloads across 16 HPC computational motifs. HPC-Bench provides a fully automated, end-to-end evaluation pipeline that combines program-level correctness verification with two correctness-gated metrics, Fast@k and Speedup@k, to characterize reliability and speedup under a fixed sampling budget. Our evaluation of three representative LLMs across serial CPU, OpenMP, and CUDA settings shows that stricter speedup requirements substantially reduce the probability of finding a correct and fast optimization. HPC-Bench is available at https://github.com/Deep-Learning-Profiling-Tools/HPC-Bench.

1 Introduction

Large Language Models (LLMs) have become widely used for code generation, completion, and reasoning, motivating extensive benchmarks for evaluating their programming capabilities [1–4]. Existing benchmarks span tasks from single-function code generation, such as HumanEval [5], to repository-scale development tasks, such as CoderEval [6], HumanEvo [7], and RepoEval [8]. However, these evaluations primarily measure functional correctness, while runtime efficiency is often treated as secondary or omitted entirely.

While recent code benchmarks have begun to target efficiency, they are limited either in scale (e.g., EffiBench [9] and EvalPerf [10]) or to narrowly defined, well-structured problems (e.g., Kernel-Bench [11] and TritonBench [12]). Performance optimization in High-Performance Computing (HPC) code is a different challenge compared to these tasks. HPC efficiency is shaped by a complex interplay of low-level code (e.g., C/C++, FORTRAN), various programming models (e.g., OpenMP, CUDA), memory access patterns, and sophisticated execution contexts, where the main computational kernels are deeply embedded within their surrounding code context. Even minor code modifications, such as loop reordering [13], can induce substantial runtime differences.

There have been some preliminary studies on benchmarking LLMs for HPC tasks, such as evaluations of DeepSeek and GPT-4 on classic solvers [14], assessments of OpenAI Codex on GEMM and

Preprint.

SpMV kernels [15], and studies on MPI+OpenMP code generation [16]. However, these studies typically focus on only a narrow set of HPC codes and lack a standardized, performance-grounded benchmarking pipeline.

To fill this gap, we introduce HPC-Bench, a performance-grounded benchmark for evaluating LLMs as local optimizers of profiling-identified computational kernels in realistic HPC programs. We focus on local kernel rewriting rather than whole application rewriting, with the goal of evaluating standalone LLMs' optimization capability under a fixed sampling budget rather than evaluating agent-based workflows.

Challenges and Solutions. Building HPC-Bench involves four main challenges: (i) Hotspots are deeply embedded in large HPC applications and are context- and input-dependent; (ii) HPC applications span diverse computational motifs; (iii) Optimization effectiveness depends on both the programming model and hardware; (iv) Correctness and performance are coupled.

To address the above challenges, we make the following contributions in this paper:

  • Evaluation Framework. We identify computation hotspots through profiler-guided selection and manual filtering, and we recover the inputs and context necessary to reproduce performance hotspots in real HPC applications.
  • Suite. We curate a comprehensive benchmark of 114 workloads across 16 computational motifs with standardized inputs, builds, and automated program-level correctness checking.
  • Experiments. We benchmark representative LLMs under serial CPU, OpenMP, and CUDA optimization settings and analyze their strengths and failure modes across motifs, structural complexity stratum, and sampling budgets.
  • Metrics and Reporting. We report sampling-aware, correctness-gated metrics (e.g., Fast@k and Speedup@k) to capture the reliability-speedup tradeoff under a fixed sampling budget.

In our experiments, we identified that LLM-based HPC optimization is limited by the rapidly diminishing probability of producing correct optimizations as task structural complexity and speedup requirements increase. This trend manifests consistently across CPUs and GPUs, while its severity varies with computational motifs and benchmark structural complexity.

References (36)