Search NASA⌕ Search

SEARCH · Search NASA

Results for “code optimization”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

Reductive Analysis with Compiler-Guided Large Language Models for Input-Centric Code Optimizations

Input-centric program optimization aims to optimize code by considering the relations between program inputs and program behaviors. Despite its promise, a long-standing barrier for its adoption is the difficulty of automatically identifying critical features of complex inputs. This paper introduces a novel technique, reductive analysis through compiler-guided Large Language Models (LLMs), to solve the problem through a synergy between compilers and LLMs. It uses a reductive approach to overcome the scalability and other limitations of LLMs in program code analysis. The solution, for the first time, automates the identification of critical input features without heavy instrumentation or profiling, cutting the time needed for input identification by 44× (or 450× for local LLMs), reduced from 9.6 hours to 13 minutes (with remote LLMs) or 77 seconds (with local LLMs) on average, making input characterization possible to be integrated into the workflow of program compilations. Optimizations on those identified input features show similar or even better results than those identified by previous profiling-based methods, leading to optimizations that yield 92.6% accuracy in selecting the appropriate adaptive OpenMP parallelization decisions, and 20-30% performance improvement of serverless computing while reducing resource usage by 50-60%.

Input-Centric Optimization↗

Performance-Aligned LLMs for Generating Fast HPC Code

Optimizing scientific software is a difficult task because codebases are often large and complex, and performance can depend upon several factors including the algorithm, its implementation, and hardware among others. Causes of poor performance can originate from disparate sources and be difficult to diagnose. Recent years have seen a multitude of work that use large language models (LLMs) to assist in software development tasks. However, these tools are trained to model the distribution of code as text, and are not specifically designed to understand performance aspects of code. In this work, we introduce a reinforcement learning based methodology to align the outputs of code LLMs with performance. This allows us to build upon the current code modeling capabilities of LLMs and extend them to generate better performing code. Here, we demonstrate that our fine-tuned model improves the expected speedup of generated code over base models for a set of benchmark tasks from 0.9 to 1.6 for serial code and 1.9 to 4.5 for OpenMP parallel code.

Computer science↗

Toward Energy-Efficient HPC: Insights from Power Profiling a Cloud-Resolving Earth System Model

Power is a fundamental constraint as supercomputing advances to exascale. Efficient operation within strict power budgets requires application-aware power management based on a detailed understanding of application-level power behavior. This work analyzes the Energy Exascale Earth System Model (E3SM) atmosphere component, SCREAM, on Perlmutter (NERSC) and Frontier (OLCF). We characterize power variation across inputs, concurrency levels, and power caps, evaluate the energy impact of code optimizations, and attribute energy within the code using a newly developed GPU energy model. Results show that SCREAM’s peak power remains stable during its core execution phase and decreases gradually as concurrency increases. Power capping experiments reveal a performance–energy "sweet spot". On Perlmutter, limiting GPU power to 50% of thermal design power (TDP) achieves up to 15% energy savings with a 7% performance penalty. On Frontier, a 40% TDP cap yields up to 10% energy savings with less than 10% performance loss. Code optimizations reduce SCREAM energy by shortening run time without increasing power. Modeling reveals a critical insight: data movement accounts for approximately 70% of SCREAM’s GPU energy. This fundamentally shifts the optimization focus from FLOPS to data transfer reduction for this class of applications, offering the most impactful strategy for improving energy efficiency. This work establishes a foundation for practical, application-aware power management at exascale.

Zhao, Zhengji [Lawrence Berkeley National Laborato↗

Architecture for fast implementation of quantum low-density parity-check codes with optimized Rydberg gates

Here, we propose an implementation of bivariate bicycle codes [S. Bravyi et al., Nature (London) 627, 778 (2024)] based on long-range Rydberg gates between stationary neutral atom qubits. An optimized layout of data and ancilla qubits reduces the maximum Euclidean communication distance needed for nonlocal parity-check operators. An optimized Rydberg gate pulse design enables 𝖢𝖹 entangling operations with fidelity $\mathscr{F}$ >0.999 at a distance greater than 12 µ⁢m. The combination of optimized layout and gate design leads to a quantum error correction cycle time of ∼1.2⁢8 ms for a [[144,12,12]] code, which is nearly a factor-of-two improvement over previous designs.

Poole, C. [Univ. of Wisconsin, Madison, WI (United↗

ARCS: Agentic Retrieval-Augmented Code Synthesis with Iterative Refinement

Agentic Retrieval-Augmented Code Synthesis with Iterative RefinementIn supercomputing, efficient and optimized code generation is essential to leverage high-performance systems effectively. We have developed Agentic Retrieval-Augmented Code Synthesis (ARCS), an advanced framework for accurate, robust, and efficient code generation, completion, and translation. ARCS integrates Retrieval-Augmented Generation (RAG) with Chain-of-Thought (CoT) reasoning to systematically break down and iteratively refine complex programming tasks. An agent-based RAG mechanism retrieves relevant code snippets, while real-time execution feedback drives the synthesis of candidate solutions. This process is formalized as a state-action search tree optimization, balancing code correctness with editing efficiency. Evaluations on the Geeks4Geeks and HumanEval benchmarks demonstrate that ARCS significantly outperforms traditional prompting methods in translation and generation quality. By enabling scalable and precise code synthesis, ARCS offers transformative potential for automating and optimizing code development in supercomputing applications, enhancing computational resource utilization

Bhattarai, Manish [Los Alamos National Labs]↗

Using Likwid and Byfl to Benchmark Hardware Performance

This paper outlines a benchmarking study conducted during my internship at LANL, focusing on CPU (Computer Processing Unit) and program performance assessment. The primary goal was to gather memory access data using three methods across five polybench kernels The data gathered would then be used to compare and contrast to one another and calculate operational intensity for performance comparisons. Benchmarking tools like Byfl and Likwid were employed, with Byfl offering hardware-independent data through LLVM compiler communication and Likwid directly interacting with computer hardware. The study considered various benchmarking factors, including optimization levels, Big O notation ((n)), CPU diversity and specific kernel equations. Big O notation was utilized to simplify code complexity, with detailed breakdwons of operations and memory components for each polybench application. Specific O(n) equations enabled nuanced kernel compariosns, facilitating the identification of performance variations. CPU efficiency assessments were conducted using Likwid tests on two CPUs. The central focus on code optimization aimed at achieving higher speeds and reduced memory usage through streamlined code. Future work propsoes creating a roofline model, synthesizing benchmarking data into a comprehensive data graph to assist in optimizing code and improving hardware performance. The potential impact on the laboratory or national mission was underscored, emphasizing the importance of optimizing applications and hardware to conserve resources and accelerate program execution. The specific relevance to LANL’s operations in math-intensive fields such as Nuclear Fission, Space Exploration, and Nanotechnology highlights the necessity of efficient benchmarking for resource conservation and proram speed. Overall, this study contributes to the understanding of CPU and program performance, providing insights for future optimization efforts in a laboratory setting

97 MATHEMATICS AND COMPUTING↗

autoGEMM: Pushing the Limits of Irregular Matrix Multiplication on Arm Architectures

This paper presents an open-source library that pushes the limits of performance portability for irregular General Matrix Multiplication (GEMM) on the widely-used Arm architectures. Our library, autoGEMM, is designed to support a wide range of Arm processors: from edge devices to HPC-grade CPUs. autoGEMM generates optimized kernels for various hardware configurations by auto-combining fragments of autogenerated micro-kernels that employ hand-written optimizations to maximize computational efficiency. We optimize the kernel pipeline by tuning the register reuse and the data load/store overlapping. In addition, we use a dynamic tiling scheme to generate balanced tile shapes. Finally, we position autoGEMM on top of the TVM framework where our dynamic tiling scheme prunes the search space for TVM to identify the optimal combination of parameters for code optimization. Evaluations on five different classes of Arm chips demonstrate the advantages of autoGEMM. For small matrices, autoGEMM achieves 98% of peak and up to 2.0x speedup over state-of-the-art libraries such as LIBXSMM and LibShalom. For irregular matrices (i.e. tall skinny and long rectangles), autoGEMM is 1.3-2.0x faster than widely-used libraries such as OpenBLAS and Eigen. autoGEMM is publicly available at: https://github.com/wudu98/autoGEMM.

Wu, Du↗

Agentic AI vs ML-Based Autotuning: A Comparative Study for Loop Reordering Optimization

High Performance Computing (HPC) applications rely heavily on code optimizations to achieve good performance on modern CPU and GPU architectures. Traditional Machine Learning auto-tuning approaches have demonstrated success in exploring high-dimensional spaces, but they often require expensive compile-run evaluations and lack adaptability for large HPC applications. The recent advances in Large Language Models (LLMs) and Agentic AI systems raise intriguing questions about the potential of these approaches to address specific optimization methodologies. This work aims to answer an essential question for the HPC community: “How Agentic AI Systems Compare to Traditional ML Autotuning Techniques?” To address this question, we present a comparative analysis between a traditional ML-based optimization approach and an Agentic AI system, evaluating their respective capabilities and limitations for loop-level optimization. In addition, we introduced a new Agentic AI system named LoopGen-AI using three different Large Language Models: GPT-4.1, Claude 4.0, and Gemini 2.5. A key finding is that LoopGen-AI achieves competitive per-formance with only a few program runs, the reasoning logs from the agents revealed that their decisions rely heavily on the combination of semantic understanding of the target kernel with dynamic feedback from the environment, highlighting a promising new dimension in performance tuning. In contrast, ML-based autotuners focus on statistical exploration, and require orders of magnitude more runs to reach peak performance. Additionally, our analysis shows that prompt engineering, particularly using Persona + Context Manager patterns, significantly impacts the effectiveness of Agentic AI. Our results indicate that while Agentic AI systems are not yet a complete replacement for ML-based autotuners, it can effectively complement traditional methods.

Rosas, Miguel Romero↗

MONKES: a fast neoclassical code for the evaluation of monoenergetic transport coefficients in stellarator plasmas

Abstract MONKES is a new neoclassical code for the evaluation of monoenergetic transport coefficients in stellarators. By means of a convergence study and benchmarks with other codes, it is shown that MONKES is accurate and efficient. The combination of spectral discretization in spatial and velocity coordinates with block sparsity allows MONKES to compute monoenergetic coefficients at low collisionality, in a single core, in approximately one minute. MONKES is sufficiently fast to be integrated into stellarator optimization codes for direct optimization of the bootstrap current and to be included in predictive transport suites. The code and data from this paper are available at https://github.com/JavierEscoto/MONKES/ .

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

A Performance-Portable MultiGPU Implementation of 3D Euler Equations using ProtoX and IRIS

Computational scientists often face challenges when developing and optimizing code for high-performance computing (HPC), especially when trying to leverage GPUs. Given the heterogeneity of the nodes that comprise many modern HPC facilities, considerable demand exists for performance portable solutions for the core computational kernels used in many scientific computing libraries. In this work, we demonstrate a fourth-order finite volume method–based implementation of the Euler equations, which are an integral part of computational fluid dynamics. Our performance-portable multiGPU implementation for Euler equations uses ProtoX to generate kernels and IRIS for portability. ProtoX is a domain-specific language that uses a structured-grid partial differential equation library called Proto as its front end and the SPIRAL code generation system as its back end to generate optimized kernels for different architectures. Optimized kernels generated by ProtoX are orchestrated through the IRIS intelligent runtime system to provide portability. Two levels of optimizations within the IRIS runtime— directed acyclic graph fusion and task fusion—are explored to efficiently utilize computing resources in a multiGPU environment. Performance improvement through these optimizations is showcased by comparing the base ProtoX-IRIS implementation on AMD GPUs (Frontier node) and on NVIDIA GPUs (NVIDIA DGX-1).

Mankad, Het↗

GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

Large language models (LLMs) are increasingly adapted to downstream tasks via reinforcement learning (RL) methods like Group Relative Policy Optimization (GRPO), which often require thousands of rollouts to learn new tasks. We argue that the interpretable nature of language often provides a much richer learning medium for LLMs, compared to policy gradients derived from sparse, scalar rewards. To test this, we introduce GEPA (Genetic-Pareto), a prompt optimizer that thoroughly incorporates natural language reflection to learn high-level rules from trial and error. Given any AI system containing one or more LLM prompts, GEPA samples trajectories (e.g., reasoning, tool calls, and tool outputs) and reflects on them in natural language to diagnose problems, propose and test prompt updates, and combine complementary lessons from the Pareto frontier of its own attempts. As a result of GEPA's design, it can often turn even just a few rollouts into a large quality gain. Across six tasks, GEPA outperforms GRPO by 6% on average and by up to 20%, while using up to 35x fewer rollouts. GEPA also outperforms the leading prompt optimizer, MIPROv2, by over 10% (e.g., +12% accuracy on AIME-2025), and demonstrates promising results as an inference-time search strategy for code optimization. We release our code at https://github.com/gepa-ai/gepa.

97 MATHEMATICS AND COMPUTING↗

A Computational Tool Compatible with NEAMS Code Packages for Optimizing the Shape of Nuclear Reactor Components and of Whole Core Performance

We designed and implemented a shape optimization tool that functions with NEAMS codes, and that nuclear scientists and engineers can employ to optimize the shape of individual components and the whole core under the applicable single- or multi-physics model comprising the employed code(s). The shape-optimization tool enables varying the geometric shape itself as well as its dimensions to yield, potentially, new component designs that are not limited by the designer’s intuition and previous experience. In cases where the optimal-shape object is an individual component, we provide the capability for additional verification that the whole-core performance using the optimized component performs better, under the prescribed optimization criteria, than the initial design. Our shape-optimization tool couples to NEAMS codes via a flexible input- composer interface and enables the user to constrain the shape’s evolution to ensure the component’s manufacturability. Finally, we demonstrate our shape-optimization tool with single- and multi-physics NEAMS codes. This objective is motivated by the recent advances in manufacturing technology that, combined with rising interest in novel reactor concepts, are creating new opportunities for innovation in the design of individual components that affect the performance of the full reactor system. In particular, Additive Manufacturing (AM) enables mass production of highly precise, intricate and complex component shapes that are not feasible with traditional manufacturing techniques. To accomplish this goal we developed and implemented in MOOSE: (1) discrete shape optimization capability based on a state-space search that uses Artificial Intelligence strategies to find the optimal state/shape; (2) smooth shape optimization tool that employs PETSc’s toolkit for advanced optimization (TAO) to optimize node-displacement of the components’ model sidesets; (3) hierarchical core optimization workflow that recognizes the repeating patterns typical in a nuclear reactor and performs the optimization one level at a time with increasing length scale. Each of these tools is equipped with user-specified constraints to avoid optimal shapes that are not manufacturable. The developed shape optimization tool is verified and demonstrated on various nuclear reactor core components and models. The optimization process accounts for tightly coupled physics that govern the behavior of these target reactors, and exercises several NEAMS codes in a coupled multiphysics fashion. The impact of the delivered shape optimization tool will materialize in the optimal design, from the outset, of advanced reactors currently contemplated to regain the US’s leadership in nuclear energy R&D. Novel reactor concepts, e.g. Molten Salt Reactors, and sizes/capacities, e.g. micro- reactors, provide a unique opportunity to optimize performance from the early stages of development, before the investment in components’ production lines, validation experiments, and licensing regimes make future improvements in performance prohibitively expensive and force sub-optimal performance on the affected reactor concept in perpetuity. This benefit will be realized by the delivered shape optimization tool regardless of the applicable manufacturing process whether traditional or AM, thereby broadening the impact of this project on current and future reactor concepts and technologies

11 - NUCLEAR FUEL CYCLE AND FUEL MATERIALS↗

A flexible and differentiable coil proxy for stellarator equilibrium optimization

Balancing plasma performance and coil cost is a significant challenge when designing a stellarator power plant. Most current stellarator designs are produced through two-stage optimization: stage-1 for the equilibrium and stage-2 for a coil design that reproduces its magnetic configuration. Because few proxies connect both stages, two-stage optimization can produce plasmas that have high-quality physical properties but overly complex coils. In recent years, single-stage optimization has increasingly been used to optimize the plasma and coils simultaneously in order to improve the plasma–coil balance. However, all existing single-stage tools are specialized for filament coils, cannot model coil systems containing permanent magnets or dipole arrays, and continue to be challenged by numerical problems. The quasi-single-stage optimization finds a middle ground by integrating a coil optimization subproblem into stage-1 optimization. We present a flexible, differentiable coil complexity proxy based on the newly developed QUADCOIL coil optimization code. QUADCOIL is fast and can target realistic coil metrics and constraints that are unavailable to codes with comparable speed. We demonstrate the effectiveness and flexibility of the QUADCOIL proxy by presenting two QSS optimization studies. The first study produces a permanent magnet solution for the MUSE stellarator with 34% fewer magnets than previous solutions. The second study produces a coil solution for the ARIES-CS stellarator with 30% reductions in both peak and root-mean-square force.

Fu, Lanke [Princeton Plasma Physics Laboratory (PP↗

Global stellarator coil optimization with quadratic constraints and objectives

Most present stellarator designs are produced by costly two-stage optimization: the first for an optimized equilibrium, and the second for a coil design reproducing its magnetic configuration. Few proxies for coil complexity and forces exist at the equilibrium stage. Rapid initial state finding for both stages is a topic of active research. Most present convex coil optimization codes use the least square winding surface method by Merkel (NESCOIL), with recent improvements in conditioning, regularization, sparsity, and physics objectives. While elegant, the method is limited to modeling the norms of linear functions in coil current. We present QUADCOIL, a global coil optimization method that targets combinations of linear and quadratic functions of the current. It can directly constrain and/or minimize a wide range of physics objectives unavailable in NESCOIL and REGCOIL, including the Lorentz force, magnetic energy, curvature, field-current alignment, and the maximum density of a dipole array. QUADCOIL requires no initial guess and runs nearly $10$ 2 x faster than filament optimization. Integrating it in the equilibrium optimization stage can potentially exclude equilibria with difficult-to-design coils, without significantly increasing the computation time per iteration. QUADCOIL finds the exact, global minimum in a large parameter space when possible, and otherwise finds a well-performing approximate global minimum. It supports most regularization techniques developed for NESCOIL and REGCOIL. We demonstrate QUADCOIL’s effectiveness in coil topology control, minimizing non-convex penalties, and predicting filament coil complexity with three numerical examples.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Optimizing inference of segmentation on high-resolution images in MLExchange

MLExchange is a machine learning (ML) operations platform providing web user-interfaces (UIs) for data visualization and analysis pipelines at synchrotron facilities. Among these UIs is the segmentation app which helps synchrotron users utilize ML algorithms to automatically segment high-resolution scientific images with minimal manual annotation effort. In this work, we share code optimizations that significantly speed up the segmentation inference workflow of large data in short time. By optimizing the sequence of CPU-GPU data transfers and introducing CPU parallelization to key operations, we improve the per-device, per-image frame computational efficiency and observe close to 3×$$\times$$ speedup over the original segmentation inference workflow run time when utilizing a single GPU. Further adaptations enabling multi-GPU inference yield more than 40×$$\times$$ speedup with 100 GPUs compared to the optimized single GPU inference workflow. This acceleration of the segmentation inference workflow will provide MLExchange users with easy access to segmentation results with little wait time.

Lu, Shizhao↗

Accelerated Constrained Sparse Tensor Factorization on Massively Parallel Architectures

This study presents the first constrained sparse tensor factorization (cSTF) framework that optimizes and fully offloads computation to massively parallel GPU architectures, and the first performance characterization of cSTF on GPU architectures. In contrast to prior work on tensor factorization, where the matricized tensor times Khatri-Rao product (MTTKRP) is the primary performance bottleneck, our systematic analysis of the cSTF algorithm on GPUs reveals that adding constraints creates an additional bottleneck in the update operation for many real-world sparse tensors. While executing the update operation on the GPU brings significant speedup over its CPU counterpart, it remains a significant bottleneck. To further accelerate the update operation, we propose cuADMM, a new update algorithm that leverages algorithmic and code optimization strategies to minimize both computation and data movement on GPUs. As a result, our framework delivers significantly improved performance compared to prior state-of-the-art. On 10 real-world sparse tensors, our framework achieves geometric mean speedup of 5.1 × (max 41.59 ×) and 7.01 × (max 58.05 ×) on the NIVIDA A100 and H100 GPUs, respectively, over the state-of-the-art SPLATT library running on a 26-core Intel Ice Lake Xeon CPU.

Soh, Yongseok↗

Integrating quantum computing resources into scientific HPC ecosystems

Quantum Computing (QC) offers significant potential to enhance scientific discovery in fields such as quantum chemistry, optimization, and artificial intelligence. Yet QC faces challenges due to the noisy intermediate-scale quantum era’s inherent external noise issues. Here, this paper discusses the integration of QC as a computational accelerator within classical scientific high-performance computing (HPC) systems. By leveraging a broad spectrum of simulators and hardware technologies, we propose a hardware-agnostic framework for augmenting classical HPC with QC capabilities. Drawing on the HPC expertise of the Oak Ridge National Laboratory (ORNL) and the HPC lifecycle management of the Department of Energy (DOE), our approach focuses on the strategic incorporation of QC capabilities and acceleration into existing scientific HPC workflows. This includes detailed analyses, benchmarks, and code optimization driven by the needs of the DOE and ORNL missions. Our comprehensive framework integrates hardware, software, workflows, and user interfaces to foster a synergistic environment for quantum and classical computing research. This paper outlines plans to unlock new computational possibilities, driving forward scientific inquiry and innovation in a wide array of research domains.

75 CONDENSED MATTER PHYSICS, SUPERCONDUCTIVITY AND↗

Field Harmonic Measurement of High-Gradient Permanent Magnet Quadrupoles for NSLS- II Upgrade

The National Synchrotron Light Source II (NSLS-II) is preparing for a major upgrade based on a new lattice concept, known as “Complex Bend,” to replace its existing double bend achromat (DBA) lattice. Here, this novel lattice will use high-gradient permanent magnet quadrupoles (PMQs) with small apertures in the range of 16–22 mm. A prototype complex bend branch with PMQs has been installed in the NSLS-II linac to evaluate the lattice's performance. An accurate and precise magnetic measurement system is required for field harmonic characterization and magnetic tuning of these PMQs. As part of this project a Rotating-Coil bench, based on a Printed Circuit Board (PCB) coil with a 12 mm diameter, has been configured to measure nine PMQs with bore diameter of 12.7 mm. This PCB coil has an active length of 270 mm, and is able to measure fields up to the 15th harmonic of the main field at a reference radius of 5 mm, while maintaining field quality levels within 10 ppm of the main field. This article presents the PCB coil setup, the harmonic measurement results and their temperature dependencies and repeatability. Simulation results on compensation of undesired multipoles using “IDBuilder”, a genetic algorithm-based optimizer code for magnetic tuning is included for field harmonic corrections.

36 MATERIALS SCIENCE↗