Elamur Research

Can Large Language Models Predict Parallel Code Performance?

Paper · 2025 · Gregory Bolet, Giorgis Georgakoudis, Harshitha Menon et al.

Summary

When a GPU program runs slowly, the first question is often where to look. Does the processor spend its time doing arithmetic, or does it struggle to move data fast enough to keep the arithmetic units busy? The answer helps a programmer decide which changes to investigate, and it can change when the same code runs on a different device. Profiling a program on the intended GPU can supply the measurements needed to answer that question. Bolet and colleagues ask how much of the answer a language system can recover from source code and hardware specifications when those measurements are unavailable.

The paper uses the Roofline framework to turn this into a classification problem. A kernel, the portion of a program dispatched to the GPU, has an arithmetic intensity that expresses how much arithmetic it performs per byte of memory traffic. The device has a balance point that marks the transition from a bandwidth ceiling to a compute ceiling. The authors profile HeCBench programs on an NVIDIA RTX 3080, use those measurements to assign reference labels, and select a balanced set of 340 kernels covering CUDA and OpenMP. At prediction time, the source-based experiments give the system the program files, identify the target kernel, and specify the device and launch configuration. The measured arithmetic intensity stays out of the prompt.

With arithmetic intensity supplied, the reasoning-capable systems tested on the numerical task reached 100% classification accuracy with worked examples. On the balanced source-code benchmark, the best zero-shot accuracy was 64.12%, shared by o3-mini-high and o1. Replacing pseudocode illustrations with labeled examples in the same programming language produced small changes, with gains for some systems and losses for others. The fine-tuning trial ended with the adapted system assigning a single class to every validation item at each evaluated checkpoint.

The experiments establish a difference between applying a Roofline threshold and inferring where a program falls relative to it. The latter is possible to a degree on the authors’ benchmark, especially with the better-performing reasoning systems. The source-based results cover selected kernels and launch configurations on the profiled GPU, and the prediction is a bottleneck category. Runtime, speedup from an optimization, and accuracy on other devices are separate questions.

Deep dive: Can Large Language Models Predict Parallel Code Performance?

Bolet and colleagues test whether GPU source code and hardware specs can reveal if computation or memory bandwidth limits a parallel kernel. · about 32 minutes to read

The problem and its context

Why a bottleneck label matters

A GPU can carry out arithmetic very quickly when it has enough data to work on. Moving that data has a cost of its own. A kernel can spend substantial time transferring values for relatively little arithmetic, or it can perform extensive arithmetic on values it has already brought into use. These cases give the programmer different places to look for an improvement. If data movement is the limiting resource, reducing memory traffic can change the amount of useful work the GPU sustains. If the arithmetic ceiling is the relevant one, the way the program performs its operations becomes a more direct concern. This is the performance question the paper selects from the broader field of GPU and parallel computing.

The device matters because its arithmetic capacity and memory bandwidth can vary independently. A machine with greater computing throughput needs more arithmetic per byte to reach its arithmetic ceiling at a given bandwidth. Changing the balance between those capacities can move the same workload to a different part of a Roofline plot. The paper connects this possibility to performance portability, the practical problem of getting good performance across platforms. A source program can execute on different machines while the resource that constrains it changes from one machine to another.

The authors place this problem in the setting of high-performance computing, where systems can contain GPUs from different vendors. Code tuned for one architecture may need changes to run efficiently on another. An early indication of the likely bottleneck could give a developer a starting point before a device is available. There is still a difference between deciding what to investigate and demonstrating an improvement. A class label can suggest what to measure next. Achieved performance depends on how the program actually runs.

What a Roofline plot expresses

A Roofline plot relates arithmetic intensity to a ceiling on arithmetic throughput. The horizontal coordinate, arithmetic intensity, measures operations per byte of memory traffic. The vertical coordinate measures operations per unit of time. At low arithmetic intensity, each byte moved yields relatively little arithmetic. The ceiling in that region rises with intensity because each byte delivered can support more operations. At sufficiently high intensity, the hardware’s peak arithmetic throughput sets the ceiling, and the line becomes horizontal. The paper’s classification turns on the point where those parts of the roof meet. Roofline

A measured kernel can be plotted using both its arithmetic intensity and its achieved throughput. Each coordinate answers a different question. The horizontal coordinate indicates the part of the roof that applies. The vertical coordinate shows how much throughput the kernel achieves under that ceiling. Classification uses the horizontal relationship to the balance point. A point can lie well below the roof and still have a clear position on one side of the balance point. Finding a kernel in the compute region therefore supplies information about the relevant theoretical ceiling. Its distance below that ceiling remains a distinct observation.

The paper uses this distinction to define a narrower question than performance prediction in general. A precise runtime estimate would require an account of achieved throughput or elapsed time. The proposed task instead asks for a category: bandwidth-bound, abbreviated BB, or compute-bound, abbreviated CB. Those terms refer to Roofline placement under the paper’s measurement and labeling procedure. They make the problem concrete enough to test on a collection of programs with reference answers.

The narrower question still poses a substantial challenge if the input is code. A reader may see an obvious loop and still need to know which version of it is compiled, how many threads execute it, which branch is taken, and what the surrounding program supplies. Memory accesses written in a source file are evidence about data movement. To obtain the arithmetic intensity used as the reference, the authors measure the amount of work and traffic during execution. Their experiment asks whether the available static evidence is strong enough to support a useful judgment in the absence of those measurements.

Where this fits among earlier approaches

As the authors describe the field, the established route to a Roofline analysis is to profile a running program on the target hardware. Profiling yields measurements of work and memory transfers, frequently through performance counters. Those measurements make it possible to characterize the particular execution the developer cares about. It is a practical route when the desired device is accessible and the program can be run there. The paper identifies access to high-end GPUs and the effort of collecting profiles as recurring obstacles.

The paper also discusses GPU performance-prediction approaches that use counter measurements and static approaches aimed at execution time or power. The latter can analyze program information ahead of the full run, while still relying on hardware for micro-benchmarks, small tests used to characterize relevant behavior. The paper’s contrast is between the information required for a fresh prediction and the information needed to establish a trustworthy reference for evaluation. Its source-based setting takes hardware specifications as inputs and uses executions to check the answers after the predictions are made. The authors include prior work on portable estimation in their account of this area. Portable prediction of GPU kernel execution time and power

The other line of prior work concerns language systems that read and generate code. The paper points to capabilities such as summarization, translation, repair, and optimization. In its account of high-performance computing applications, it also mentions automatic parallelization, execution-time and slowdown prediction, and work on generating faster code. Together, these motivate asking whether a system that can describe or transform code can also recognize execution patterns relevant to performance. The cited evaluations of code capabilities are part of that background. Evaluating Large Language Models Trained on Code

Understanding that a loop reads an array or carries out a reduction is a step towards performance analysis. Estimating how much arithmetic and traffic those operations produce on a specified run is a further step. A system can also recognize the vocabulary of Roofline analysis and explain it fluently while making mistakes in either step. The authors therefore separate an exercise with the relevant numerical quantities already specified from a benchmark where source and launch information must stand in for measurements. That separation lets the experiments investigate where the difficulty enters.

The method, step by step

Separate the threshold calculation from reading the code

The authors set up paired views of the task. In the numerical exercise, a question states the hardware’s memory bandwidth and peak arithmetic throughput and gives the program’s arithmetic intensity. The immediate job is to locate the balance point and identify the side on which the stated intensity falls. The question also includes achieved throughput in the example shown in the paper. That information allows a point to be placed vertically on a plot. The classification itself follows from the intensity and the location of the balance point.

For the source-based task, the authors build a set of programs with measured labels. They give the system code and execution specifications and ask it to infer the class. They then change how the source-based prompt conveys examples, and separately try adapting one system using labeled programs. Across these variants, the reference label comes from the same profiling procedure. An explanation that sounds plausible does not change that reference and is not part of the score.

From HeCBench profiling to source-based classification

The steps in order.

From HeCBench profiling to source-based classificationStep 1: Build CUDA and OpenMP programs1. Build CUDA and OpenMP programsStep 2: Profile initial kernel executions on the GPU2. Profile initial kernel executions on the GPUStep 3: Assign labels from arithmetic intensity and hardware ceilings3. Assign labels from arithmetic intensity and hardware ceilingsStep 4: Select a balanced set of shorter programs4. Select a balanced set of shorter programsStep 5: Present source, target kernel, hardware, and launch details5. Present source, target kernel, hardware, and launch detailsStep 6: Compare returned labels with the profiled labels6. Compare returned labels with the profiled labels

Turn a measurement into a class

Arithmetic intensity divides the amount of arithmetic by the volume of memory traffic. In the study, the arithmetic can belong to a single-precision floating-point, double-precision floating-point, or integer category. Each category has its own count and its own peak arithmetic rate. The memory quantity represents global memory traffic as used in the labeling procedure.

I = O ÷ D

Here I is arithmetic intensity for the operation category under consideration, O is the corresponding count of operations, and D is the volume of global memory traffic in bytes. The division sign ÷ makes I an operation count per byte, and the equals sign = defines the quantity on the left. For floating-point work, the usual unit in the paper’s examples is FLOP/Byte, meaning floating-point operations per byte. In this use, a FLOP is an operation. A throughput unit such as GFLOP/s describes a rate.

To find the balance point, the framework relates that intensity to hardware limits. At a fixed intensity, multiplying the maximum number of bytes the memory system can move per unit of time by the number of operations associated with each byte yields the throughput ceiling imposed by bandwidth. The arithmetic hardware supplies another ceiling. The framework uses the lower of these bounds as the roof.

R = min(P, B × I)

Here R is the Roofline throughput ceiling at intensity I, P is peak throughput for the arithmetic category, and B is maximum memory bandwidth in bytes per unit of time. The multiplication sign × combines bytes per unit of time with operations per byte. The function min takes the smaller of its arguments, which are separated by a comma inside parentheses. The equals sign = defines the ceiling. The product and the hardware peak have compatible units, so the comparison is between two possible limits on the same throughput.

The balance point is where those two limits coincide. A program below that point falls in the region where the bandwidth ceiling is lower. A program above it falls in the region where peak arithmetic throughput is the lower ceiling. The hardware ratio expresses the dividing intensity directly.

Iᵦ = P ÷ B

Here Iᵦ is arithmetic intensity at the balance point, with the subscript ᵦ marking that point. P denotes peak arithmetic throughput and B denotes maximum global memory bandwidth. The division sign ÷ yields operations per byte because both rates use the same unit of time. The equals sign = gives the relationship used in the numerical classification. The paper describes the regions on either side of the balance point and leaves the exact equality convention unspecified.

The worked prompt supplies a device bandwidth of 45.9 GB/s and a peak throughput of 52.22 GFLOP/s. It gives the balance point as 1.14 FLOP/Byte. The program in that example has a stated intensity of 0.6 FLOP/Byte, so its position is on the bandwidth side. Its achieved throughput, 19.4 GFLOP/s, is also included in the question. The comparison that decides the label is the one between the two intensity values. The demonstration shows both how to select the relevant inputs and how to express the final category.

The paper shows a separate question from the same numerical setup with a maximum bandwidth of 99.9 GB/s, a peak of 73.45 GFLOP/s, an intensity of 1.55 FLOP/Byte, and achieved throughput of 32.8 GFLOP/s. In that case, the balance point is something the respondent must derive. The changing quantities matter to the design. A fixed cutoff memorized from an example would fail to reflect the new relationship between memory bandwidth and peak throughput.

Profile the programs and combine the arithmetic categories

The authors chose GPU code partly because the performance measures could be gathered without inserting instrumentation by hand into the GPU sources. They built and profiled 446 CUDA codes and 303 OpenMP offload codes from HeCBench. The authors chose an NVIDIA RTX 3080 equipped with 10GB of RAM because they had access to it. These counts describe codes at the profiling stage. A program can contain multiple kernels, and the final inference set uses a later selection rule.

For the kernels inside a program, the authors collected single-precision floating-point operation counts, double-precision floating-point operation counts, and integer operation counts. They also captured execution time and global memory read and write activity. They profiled the first execution of each kernel in the program to reduce the expense of repeatedly collecting measurements. The reference thus describes an observed invocation and its arithmetic and memory behavior under the benchmark run.

The Roofline calculation gives a category for each of the arithmetic types tracked by the authors. They still need a single label for each prediction. They call the kernel bandwidth-bound when it lands on the bandwidth side for all the arithmetic types. A compute-bound result for any of the arithmetic types is sufficient for the overall compute label. This choice means that a kernel can exhibit a bandwidth-side placement for most of its arithmetic categories and receive the compute label because of its position for another category.

CB ⇔ CBₛₚ ∨ CBᴅₚ ∨ CBᵢₙₜ

Here CB means that the kernel receives the aggregate compute-bound label. CBₛₚ, CBᴅₚ, and CBᵢₙₜ mean that it is classified as compute-bound under the single-precision floating-point, double-precision floating-point, and integer Rooflines, respectively. The subscripts identify the operation categories. The symbol ∨ means that any of the conditions can make the right-hand side true, and ⇔ connects that condition to the overall label. When all the category classifications are bandwidth-bound, the kernel receives the aggregate bandwidth-bound label.

The distinction matters because the operation categories have different ceilings. An intensity meaningful for single-precision arithmetic and one meaningful for double-precision arithmetic have to be judged in relation to their respective peaks. The paper’s plot for the RTX 3080 gives a graphical view of the different roofs, their balance points, and the measured kernels. Execution time helps locate the measured throughput on that plot. The final class follows from the side of the appropriate balance point and the rule that combines the categories.

Decide how much source to show

The authors originally considered extracting the text of each target kernel. In real benchmark programs, identifying the relevant text proved difficult. A kernel may use a template whose concrete form depends on its invocation. Preprocessor definitions can alter the code being built. The execution path may depend on pieces of a program that a simple extraction would omit. The authors chose to concatenate the source files for a program into a single input and append that input to the prompt.

This design gives the prediction system access to surrounding code and forces it to identify the portions relevant to the named kernel. It can see host-side setup or definitions that help interpret the workload. It also receives material that belongs to other kernels or other paths. The target kernel name is consequently important. It gives the query a specific subject even when multiple pieces of the supplied program could plausibly be analyzed.

The full-program approach produces substantially different input lengths across programs. Prompt length matters to the authors because relevant information can become harder to use amid long inputs. They cite earlier work on the use of long contexts in motivating a cutoff. They inspected the distribution of source lengths with the gpt-4o-mini tokenizer, which divides text into the units counted for input length. The study’s cutoff was 8e3 tokens. The purpose was to keep prompt lengths more comparable while retaining a usable collection of samples. Lost in the Middle

After length filtering, the authors report a pool of 297 CUDA-based and 242 OpenMP-based programs. They say the cutoff retained a little more than 50% of the profiled kernels. Program counts describe the available sources at that intermediate stage, while the retention description concerns kernels. The distinction matters because profiling can record several kernels from a single source program. The final dataset uses a single target from each retained program.

Select and balance the evaluation cases

Since the same program files would be attached for any kernel drawn from that program, querying several kernels could give that source disproportionate influence on the results. The authors chose the first kernel in each program’s object dump, the listing they used to identify the compiled kernels. This selection is distinct from the profiling decision about first invocations. The object-dump rule chooses which kernel to ask about. The profiling rule identifies which execution of a kernel supplies measurements.

The authors then crossed the programming language with the bandwidth or compute label and matched all combinations to the size of the smallest one. The smallest combination contained 85 samples. The result was 340 samples with equal representation of CUDA bandwidth-bound kernels, CUDA compute-bound kernels, OpenMP bandwidth-bound kernels, and OpenMP compute-bound kernels. The procedure keeps a heavily represented language or class from dominating the aggregate score simply because it supplied more eligible examples.

The paper shows the lengths in the balanced set using box-and-whisker plots. OpenMP prompts generally contain fewer tokens than CUDA prompts, while the central portions of the distributions are broadly aligned. The ranges in the validation set are somewhat different between classes. The authors describe a slightly tighter range for the compute-bound samples and note the difficulty of keeping the set balanced without discarding too many items. Equal class counts address class frequency. The length plots describe a separate property of the examples.

For the adaptation experiment, the authors used an 80/20 split. Each language-and-class combination contributed 68 training samples and 17 validation samples. The split gives the training procedure examples from each combination and the validation procedure a balanced set of each. The direct-prompting experiments use the complete benchmark. The held-out portion has a different role specifically in the fine-tuning experiment.

Construct the prediction prompts

In the numerical experiment, the authors generated 240 artificial Rooflines. For each, they selected an arithmetic intensity in the bandwidth region and an intensity in the compute region for classification. The prompts demonstrated the expected response with 2, 4, or 8 examples. Some versions gave a worked explanation and others supplied examples without the intermediate reasoning. This use of worked text is the paper’s implementation of chain-of-thought prompting. The example makes the division and subsequent comparison visible before the system is asked to solve a new case. Chain-of-thought prompting

For the source task, the prompt first defines the two classes and asks for a single word, Compute or Bandwidth. It then identifies the programming language, the kernel name, and the GPU. It supplies peak throughput for the arithmetic categories, maximum bandwidth, block and grid dimensions for the kernel launch, and command-line arguments for the executable. The dimensions describe the size and organization of the GPU launch. The arguments help identify the execution configuration the prediction is about. Finally, the program files appear together as the source input.

The starter version contains pseudocode examples. One is a simplified loop that adds array elements, and another depicts loading, processing, and storing a large array. The authors report that these illustrations help smaller systems produce answers in the requested format. The paper calls this zero-shot classification. In this usage, zero-shot is relative to the use of real labeled CUDA or OpenMP programs as demonstrations. The prompt still supplies definitions, an output convention, and illustrative pseudocode.

The few-shot version replaces the pseudocode with real, labeled programs from outside the 340-sample evaluation set. A CUDA query receives CUDA examples, and an OpenMP query receives OpenMP examples. The authors report that going beyond two demonstrations made the prompts unwieldy and made it easier to lose relevant context in preliminary testing. The reported evaluation therefore uses two real examples. In this setting, few-shot learning refers to showing examples at prediction time. The system’s trained parameters stay fixed during this prompting experiment.

The adaptation experiment uses fine-tuning, which updates a pretrained system using task-specific examples. The authors used the Microsoft Azure OpenAI service to adapt gpt-4o-mini-2024-07-18. The inputs followed the zero-shot prompt format, paired with the benchmark’s measured labels for the training examples. The validation cases were reserved to check performance as training progressed. The study evaluates the adapted system at the end of each of two epochs, where an epoch is a pass through the training data.

Most of the evaluated systems came from OpenAI, with Gemini Flash 2.0 included as a comparison. The paper groups systems into reasoning and non-reasoning categories. For systems with adjustable generation settings, the authors set temperature to 0.1 and top_p to 0.2 after checking sensitivity to those settings. Temperature affects variation in the response distribution. Top_p restricts sampling to a set of candidate tokens with sufficient cumulative probability. The reasoning systems used their defaults because the study could not set those controls for them.

The authors make their code and datasets available under the name ParallelCodeEstimation. The repository also contains the real examples used in the few-shot prompts. Those examples play a different role from the measured labels of evaluation items, which are used to score the classifications.

Experiments and results

How to read the scores

Accuracy is the share of queried items with the right label. On the balanced HeCBench set, a predictor that always chooses the same class has an accuracy of 50%. The balance makes that reference easy to interpret: the predictor gets the class it always names correct and entirely misses the other class. A score above that reference signals some ability to separate the classes on this set, with the extent of the improvement depending on the score.

The paper also reports macro F1. F1 combines precision, how often a predicted label is correct, with recall, how frequently items with that label are recovered. Macro F1 gives the classes equal influence by calculating a score for each class and averaging them. It can be lower than accuracy when a system identifies one class much more successfully than the other. The scores can therefore show different features of a classification pattern even though both start with the same predictions.

The Matthews correlation coefficient, abbreviated MCC, measures how closely the predicted labels align with the reference labels using the full pattern of correct and incorrect classifications. The paper describes +1 as perfect agreement, -1 as completely inverted classifications, and 0 as the average reference for random prediction. It multiplies the metrics by 100 for display. An MCC of 31.36 in the results below is on that displayed scale. It is a coefficient, separate from the percentage of labels classified correctly.

The principal comparisons are between systems receiving the same kind of prompt, and between the zero-shot and few-shot prompts on the same HeCBench set. The numerical exercise is a baseline for applying the Roofline rule when the inputs are supplied. The balanced-set reference provides another baseline for the source task. The experiments reported here give relative results for the tested systems and prompting conditions. The benchmark evaluation contains no competing analytical source-code classifier with which to compare their accuracy directly.

The numerical Roofline exercise

With the arithmetic intensity in the question, the tested systems performed well. The paper describes best accuracies between 90-100% across the reported numerical conditions. Its main results table gives the best score over the 2, 4, and 8-example versions for each prompt style. This matters when comparing the displayed numbers. They show what each system achieved with its best reported demonstration count, and a row does not necessarily correspond to the same count as another row.

With worked reasoning in the prompt, o3-mini-high, o3-mini, and o1-mini-2024-09-12 each obtained 100% accuracy on the numerical exercise. Their best reported scores without the worked text were also 100%. The authors state that the reasoning systems obtained 100% across the few-shot versions with worked explanations. The paper leaves out numerical results for o1 and gpt-4.5-preview because, in the authors’ account, their smaller counterparts had already done well enough to answer this part of the study.

Worked explanations made a clearer difference for the tested non-reasoning systems. The best numerical accuracy for gpt-4o-2024-11-20 was 91.25% without the worked reasoning and 96.25% with it. Gemini’s gemini-2.0-flash-001 row shows 91.25% and 92.50% in the same reported conditions. Both the gpt-4o-mini and gpt-4o-mini-2024-07-18 rows give 90.00% for the best numerical prompt without worked reasoning and 100% with worked reasoning.

Best numerical Roofline accuracy for gpt-4o-mini across prompt styles

Showing the threshold calculation raises accuracy for both reported versions.

Best numerical Roofline accuracy for gpt-4o-mini across prompt stylesgpt-4o-mini, examples without worked reasoning: 90.00gpt-4o-mini, examples without workedreasoning90.00gpt-4o-mini-2024-07-18, examples without worked reasoning: 90.00gpt-4o-mini-2024-07-18, examples withoutworked reasoning90.00gpt-4o-mini, examples with worked reasoning (this paper): 100gpt-4o-mini, examples with workedreasoning (this paper)100gpt-4o-mini-2024-07-18, examples with worked reasoning: 100gpt-4o-mini-2024-07-18, examples withworked reasoning100
The numbers
System or settingaccuracy %
gpt-4o-mini, examples without worked reasoning90.00
gpt-4o-mini-2024-07-18, examples without worked reasoning90.00
gpt-4o-mini, examples with worked reasoning (this paper)100
gpt-4o-mini-2024-07-18, examples with worked reasoning100

These are results about reading a stated intensity and a stated device specification, then applying a decision rule. The use of artificial specifications means the question varies the balance point. The exercise gives evidence that the systems can use the relationship across numerical cases with different parameters. The supplied intensity also removes the central uncertainty of the source task. There is no need to estimate traffic from arrays and access patterns or to determine the arithmetic performed by a compiled kernel.

The zero-shot source benchmark

The source-only wording in the paper refers to the absence of measured performance data from the prediction prompt. The prompt still carries the hardware and execution specifications, along with pseudocode demonstrations. Under this condition, the authors queried the systems about all 340 benchmark programs. The human-independent reference for each item is the label derived from the measured run and the aggregation across Rooflines.

The best joint accuracy was 64.12% for both o3-mini-high and o1 on the balanced CUDA and OpenMP set. The tie in accuracy conceals different scores on the other metrics. O3-mini-high had macro F1 of 62.33 and MCC of 31.36. O1 had macro F1 of 61.67 and MCC of 32.73. Even among the leaders, choosing a metric changes which result is highest. A reader interested in how evenly the system handles the two classes has reason to inspect macro F1 alongside the share of correct decisions.

O3-mini reached 62.06% accuracy, with macro F1 of 60.80 and MCC of 25.84. Gpt-4.5-preview reached 59.71% accuracy, with macro F1 of 59.45 and MCC of 19.66. The best reasoning systems occupy the top of the accuracy ranking, and comparisons between particular rows also show overlap in the broader groups. For instance, gpt-4.5-preview’s accuracy is close to the 59.64% for o1-mini-2024-09-12. The paper’s reasoning advantage is clearest for the leading systems and in the overall pattern across the systems tested.

Zero-shot accuracy on the balanced HeCBench kernel benchmark

O3-mini-high and o1 share the highest accuracy, while the compact non-reasoning comparisons are near the balanced-set reference.

Zero-shot accuracy on the balanced HeCBench kernel benchmarko3-mini-high (this paper): 64.12o3-mini-high (this paper)64.12o1: 64.12o164.12o3-mini: 62.06o3-mini62.06gpt-4.5-preview: 59.71gpt-4.5-preview59.71o1-mini-2024-09-12: 59.64o1-mini-2024-09-1259.64gemini-2.0-flash-001: 55.59gemini-2.0-flash-00155.59gpt-4o-2024-11-20: 52.06gpt-4o-2024-11-2052.06gpt-4o-mini: 50.59gpt-4o-mini50.59gpt-4o-mini-2024-07-18: 50.29gpt-4o-mini-2024-07-1850.29
The numbers
System or settingaccuracy %
o3-mini-high (this paper)64.12
o164.12
o3-mini62.06
gpt-4.5-preview59.71
o1-mini-2024-09-1259.64
gemini-2.0-flash-00155.59
gpt-4o-2024-11-2052.06
gpt-4o-mini50.59
gpt-4o-mini-2024-07-1850.29

The weaker accuracy results show why the paper uses multiple metrics. Gpt-4o-2024-11-20 obtained 52.06% accuracy on the combined set, with macro F1 of 41.04 and MCC of 8.20. Gpt-4o-mini reached 50.59% accuracy, with macro F1 of 50.03 and MCC of 1.20. The dated gpt-4o-mini variant reached 50.29% accuracy and MCC of 0.60. These values describe weak alignment with the reference labels, though the different F1 and MCC results leave room for different patterns of mistakes.

The authors describe the reasoning systems as achieving about a 10% accuracy advantage over the non-reasoning systems. That is their characterization of the group pattern. The row scores offer a more direct measure of what happened for a particular system. They show a clear leading group and a range of outcomes among the lower-ranked comparisons. The results are pooled across programming languages. The authors report an average accuracy difference of 5% when predicting CUDA or OpenMP cases alone and omit the language-by-language metric breakdown.

Labeled code examples in the prompt

The few-shot experiment again covers the full balanced benchmark. The change is in what precedes the target code. The system sees two real labeled examples written in the same language as the target. Those examples give it a chance to connect the classification terms to actual program text. Because the examples are external to the evaluation set, the authors can evaluate the effect of a demonstration without deliberately showing the benchmark item’s own answer.

O3-mini-high had the highest few-shot accuracy, 63.53%, as well as the highest displayed macro F1, 60.91, and MCC, 31.63. O3-mini followed closely with 62.94% accuracy, macro F1 of 60.88, and MCC of 29.13. O1 obtained 61.47% accuracy, with macro F1 of 58.77 and MCC of 26.70. The prose discussion groups o3-mini-high and o1 at the top. The joint scores in the table place o3-mini ahead of o1 on the reported few-shot metrics.

The metric changes also depend on the system. O3-mini-high gives a slightly lower accuracy and F1 with real examples, while its MCC is slightly higher. O3-mini improves on all the displayed metrics, and o1 scores lower on each. Gpt-4.5-preview moves from 59.71% accuracy in the zero-shot run to 60.88% in the few-shot run. Gemini’s gemini-2.0-flash-001 goes from 55.59% to 53.82%. These are comparisons on the same set with the same requested classifications.

Zero-shot and few-shot accuracy for selected systems on HeCBench

Real code demonstrations produce small changes whose direction varies across systems.

Zero-shot and few-shot accuracy for selected systems on HeCBencho3-mini-high, zero-shot (this paper): 64.12o3-mini-high, zero-shot (this paper)64.12o3-mini-high, few-shot: 63.53o3-mini-high, few-shot63.53o1, zero-shot: 64.12o1, zero-shot64.12o1, few-shot: 61.47o1, few-shot61.47o3-mini, zero-shot: 62.06o3-mini, zero-shot62.06o3-mini, few-shot: 62.94o3-mini, few-shot62.94gpt-4o-mini, zero-shot: 50.59gpt-4o-mini, zero-shot50.59gpt-4o-mini, few-shot: 52.35gpt-4o-mini, few-shot52.35
The numbers
System or settingaccuracy %
o3-mini-high, zero-shot (this paper)64.12
o3-mini-high, few-shot63.53
o1, zero-shot64.12
o1, few-shot61.47
o3-mini, zero-shot62.06
o3-mini, few-shot62.94
gpt-4o-mini, zero-shot50.59
gpt-4o-mini, few-shot52.35

The small non-reasoning gpt-4o-mini variants gained modestly in accuracy. The dated variant, for example, obtained 52.06% few-shot accuracy, with macro F1 of 50.46 and MCC of 4.41. The authors characterize the gains for the small non-reasoning systems as a 2% accuracy improvement. Their absolute scores remain close to the balanced-set reference. For the strongest tested systems, the gains are too inconsistent to make real examples an obvious part of the prompt. The authors favor the shorter zero-shot format for reasoning systems, taking the cost of the extra input into account.

Fine-tuning on the benchmark split

The adaptation trial tested whether gpt-4o-mini-2024-07-18 could learn a better source-based decision rule from the labeled training portion of the dataset. The authors used the zero-shot input format for training. This holds the intended input structure constant and changes the system through supervised examples, each of which pairs a program query with its reference class. The validation split checks whether the resulting behavior extends to programs reserved from training.

At the end of both epochs, the adapted system predicted a single class across the entire validation set. The paper describes the chosen label as either compute or bandwidth, with the constant behavior applying across validation items. The authors also observed the same kind of collapse when they fine-tuned on CUDA or OpenMP programs separately. The defining result is therefore the absence of discrimination across validation cases. A balanced evaluation makes the problem visible even when one reports only accuracy, and the constant outputs explain directly what happened.

The authors suspect the training collection was too small for the system to generalize. That interpretation is a hypothesis drawn from the available experiment. The study leaves the size of a sufficient dataset open, along with the behavior of other systems or adaptation settings. It supplies a negative result for the adaptation procedure that was actually used, while the prompt-based runs give a separate measure of performance without task-specific parameter updates.

What the ablations show

Showing the arithmetic helps when the quantities are given

The closest controlled comparison in the numerical experiment changes whether the prompt includes worked reasoning. Both prompt styles give examples of the same task. The worked version demonstrates the step that divides the arithmetic peak by bandwidth and compares the resulting threshold with the supplied intensity. The improvements for the mini non-reasoning systems show that the way an example presents the rule can affect classification, even when the necessary values already appear in the question.

There are several plausible contributions from the worked text. It can identify which values matter to the category, illustrate the proper comparison, and reinforce how to format the answer. The experiment varies these features together. The reported results do not allocate the gain between improved arithmetic, better selection of relevant inputs, and greater compliance with the output convention. The strongest numerical systems already reach 100% in the best prompt without worked reasoning, leaving those rows at the top of the score range before the extra demonstration text is added.

The table collapses over demonstration count by reporting best results. It establishes that some prompt variants with or without worked text reach the displayed accuracies. A curve showing the effect of adding demonstrations would need results for each count. The paper’s account that the tested reasoning systems achieved 100% across the worked variants provides evidence of stability within those variants. The other headline rows support conclusions about the best tested prompt for each style.

Replacing pseudocode with real examples changes several things

The zero-shot and few-shot source queries share the same target programs, hardware specifications, execution information, and output labels. The edited part supplies real examples in place of simplified illustrations. This is a direct comparison of two practical prompt designs. It shows little overall benefit for the leading systems and some modest gains for the compact non-reasoning systems. The different directions across rows are part of the result.

The real examples vary from the pseudocode in more than their authenticity. They are longer, carry more programming-language detail, and convey labels in the context of an actual source program. The benchmark compares the resulting prompts as packages. It does not isolate the effect of length from the effect of seeing realistic code, or the value of matching the demonstration language from the choice of examples themselves. The authors’ preliminary observation about overly long prompts explains why the reported comparison stops at two real demonstrations. It is not a measured dose response for the number of examples.

The practical boundary is also important when interpreting the zero-shot label. Some support is already present in the shorter condition through definitions and response illustrations. The comparison asks whether real labeled code improves that starting point. It does not compare demonstrations to a prompt with every illustrative example removed. Accordingly, small gains from the replacement do not tell us how much the existing illustrations contribute to the shorter prompt’s behavior.

Reasoning system comparisons and generation controls

The difference between numerical and source-based performance makes a useful task comparison. When the intensity is supplied, the system can work with explicit quantities and a threshold. When the intensity is withheld, it has to extract or infer evidence from code, launch details, and hardware specifications. The substantially lower source scores indicate that applying the numerical rule is easier in the tested setup than reaching a correct class from program evidence. These experiments present different inputs and examples, so they are best read as a comparison of task settings. They do not measure the isolated effect of removing a single scalar from an otherwise identical prompt.

The system comparisons give a related observation. Reasoning systems lead the source benchmark, and the authors interpret this as evidence that additional reasoning helps. The tested systems also differ in their training, implementation, and defaults. The paper compares the deployed choices a user could query. A comparison that switched reasoning on or off while holding all those other properties fixed would be needed to isolate its causal contribution. Here the results establish an association between the paper’s system grouping and higher benchmark scores, with a particularly clear advantage in the leading rows.

The authors also checked whether temperature and top_p changed predicted outcomes. Their chi-squared test found no statistically significant effect in the tested comparisons. That result motivates holding the adjustable settings fixed for the subsequent experiments. It concerns the comparisons performed in the study. Reasoning systems were queried with their defaults, and the available results do not give a temperature-by-temperature account for those systems.

What the supporting analyses reveal about the dataset

The Roofline plot helps explain why the authors deliberately balanced the final set. On the profiled device, most of the plotted single-precision and integer samples are on the bandwidth side of their respective roofs. Those placements concern individual operation categories. The aggregate label is formed from the categories before the final dataset is balanced. The plot illustrates the structure of the measured workloads, and the balanced evaluation deliberately gives less influence to naturally abundant class and language combinations.

The plot also shows that measured performance usually falls below the theoretical peaks. A correct side-of-threshold prediction can coexist with a wide gap between actual and peak throughput. As a result, the evaluation’s successful classifications are evidence about the coarse category defined by the label, while the vertical distances in the plot remain outside the scoring task. This matters when judging how much help a label can provide during optimization.

The token-length plots supply another check on benchmark design. They show broad alignment in central input lengths alongside differences in the OpenMP and CUDA sources and in the validation ranges. The reported joint accuracy can be read in light of that balance and those differences. The study does not break accuracy down by input length or by position of the relevant kernel in the concatenated program, so the plots describe the inputs rather than explain which programs were easier to classify.

Finally, the language-specific fine-tuning trials help narrow the description of the failure. Constant labeling persisted when the training collection was limited to CUDA or to OpenMP. The issue therefore appeared in the language-restricted runs as well as in the pooled one. This observation leaves data volume, adaptation choices, and other causes unresolved. Restricting a collection to one language changes the data available for training at the same time that it removes a source of variation.

Limitations

Limits the authors identify

The authors identify hardware coverage as a central limit. All HeCBench reference labels come from the NVIDIA RTX 3080 used for profiling. The broad question concerns whether hardware specifications can support prediction for an intended target. The benchmark directly tests that idea at only one hardware configuration. The authors propose re-profiling the programs on other devices. That would supply a way to examine both how reference labels change and whether the predictions track those changes.

A change in device has consequences for the label. The classification compares the kernel’s arithmetic intensity with a hardware-specific threshold. Differences in arithmetic peak or bandwidth can alter the position of that threshold. The execution itself may also behave differently on a different target. Since the benchmark keeps the target fixed, the study leaves open how well a system makes use of changed device specifications when the source remains the same. The artificial numerical questions exercise changing specifications with a stated intensity, which is a different setting.

Training data scarcity is another explicit limit. The authors describe the difficulty of enlarging the dataset while preserving balance across language and class. They contrast the scale of their collection with the thousands of examples they consider desirable for a more substantial fine-tuning trial. They suggest profiling more hardware as a route to a larger collection and potentially more robust adaptation. The paper presents the small-data explanation for the observed failure as the authors’ suspicion. A study that varies training size would be needed to examine it directly.

The authors also recognize the modest accuracy of the source-based predictions. Their suggestions include examining strategies that break a complex question into smaller ones. A decomposed prompt could, in principle, ask for intermediate judgments about code or memory behavior before the final classification. The authors point to work on question decomposition, successive prompting, and least-to-most prompting as motivation. Those approaches remain proposed directions for their Roofline task. Successive prompting Least-to-most prompting

Limits that follow from the setup

The balanced dataset gives a clear interpretation to aggregate metrics. Its equal class counts also mean that reported accuracy pertains to the constructed mix of examples. The profiling pool and the final inference set have different class distributions because the authors prune the inputs and remove excess cases from larger groups. For a workload collection with a different prevalence of compute and bandwidth cases, the balance between false compute and false bandwidth predictions could matter more than the joint score. The paper gives aggregate metrics from which the full counts of those errors by language and category cannot be read.

Program selection creates another boundary. The cutoff removes long inputs, and the first-object-dump rule assigns a single target to each program. This design supports consistent evaluation and curbs repeated use of the same source. It leaves open how a system would perform on long programs or on later kernels in a program that often invokes several distinct kernels. Likewise, the first-execution profiling rule measures an initial observed invocation. The labels provide no direct check of subsequent invocations under a different execution state or a different set of arguments.

The class definition is specific to the arithmetic categories and aggregation rule used by the authors. A compute label can reflect crossing the balance point for any of the tracked categories. A system earns credit for that label regardless of whether it recognized the same category that drove the measured result. The single-word answer also gives no intermediate arithmetic intensity estimate to compare with the measured value. The experiment measures the final decision. It cannot tell whether a correct answer came from an accurate accounting of operations and memory traffic, recognition of a familiar pattern, or another route.

This issue also affects how one interprets errors near a Roofline boundary. Accuracy treats each item as right or wrong. As reported, a classification that narrowly misses a threshold has the same consequence for accuracy as a mistake on a kernel far from the balance point. The paper’s plotted placements show the relationship to the roof, but the prediction results are not grouped by distance from the threshold. The study therefore leaves open whether errors concentrate around borderline intensities or also occur where the measured category is far clearer.

Other performance questions lie outside the binary target. The evaluation does not predict runtime, the amount of headroom under a ceiling, or the gain from a particular transformation. It does not follow developers through an optimization and measure whether receiving a label helps them achieve a faster program. The practical value the authors propose is guidance when profiling is difficult. The reported evidence for that proposal is classification accuracy under specified conditions, while the benefit to an optimization workflow remains to be measured.

Finally, the tests of prompting and adaptation have bounded coverage. The source prompts use one full-program representation, fixed instructions, and, in the few-shot version, a short set of real examples. The evaluated systems are a small selection, and the adaptation result concerns a particular system and train-validation procedure. The paper gives exact observed scores for the reported runs. Without an uncertainty analysis for the close source-based comparisons, the small differences are most informative as descriptions of those runs. The larger gap between numerical classification and source-based prediction is the more clearly established feature of the experimental design.

What came after

The later citing work in this area is UniPar, whose stated focus is a unified framework for translating code for parallel and accelerated execution in high-performance computing. That places it downstream of a different immediate task. Bolet and colleagues begin with an existing program and ask for a Roofline label for a specified execution. UniPar’s stated subject is translation, where the object of interest is the code produced for parallel or accelerated execution. UniPar

The connection that can be established is the citation and the shared performance setting. The Roofline study illustrates a question that can arise around translated code: given a kernel and its target, which resource is more likely to constrain it under the chosen classification? UniPar’s description identifies code translation as its focus. It leaves open whether the framework uses the classifier, the benchmark, or the paper’s prompt design. The relationship is therefore documented at the level of the cited performance-prediction study and the later translation task.

Cite

Cite as Gregory Bolet, Giorgis Georgakoudis, Harshitha Menon, Konstantinos Parasyris, Niranjan Hasabnis, Hayden Estes, Kirk W. Cameron and Gal Oren. 2025. Can Large Language Models Predict Parallel Code Performance?. arXiv:2505.03988.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2505.03988 · arXiv 2505.03988

@misc{bolet2025can,
  title = {{Can Large Language Models Predict Parallel Code Performance?}},
  author = {Gregory Bolet, Giorgis Georgakoudis, Harshitha Menon, Konstantinos Parasyris, Niranjan Hasabnis, Hayden Estes, Kirk W. Cameron and Gal Oren},
  year = {2025},
  doi = {10.48550/arxiv.2505.03988},
  eprint = {2505.03988},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2505.03988}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bolet-2025-large-language-models-predict-parallel/