Tuesday 25 March 2025
A team of researchers has made a significant breakthrough in the field of computer science, developing a way to seamlessly accelerate Fortran code on AMD’s Ryzen AI CPU without requiring any modifications to the original programming language.
Fortran is a popular language used by scientists and engineers to write complex codes for simulations, data analysis, and other tasks. However, as computational demands increase, traditional CPUs are struggling to keep up with the pace. To address this issue, researchers have been exploring alternative architectures, such as Field-Programmable Gate Arrays (FPGAs) and Graphics Processing Units (GPUs), to accelerate computations.
AMD’s Ryzen AI CPU is a unique device that combines traditional CPU processing cores with a dedicated Accelerated Processing Unit (APU) designed specifically for machine learning and artificial intelligence workloads. The APU, known as the Neural Processing Unit (NPU), is capable of performing complex matrix multiplications and other operations at incredible speeds.
The challenge lies in making it easy for programmers to harness the power of the NPU without needing extensive knowledge of its architecture or programming languages. To overcome this hurdle, researchers have developed an innovative approach that uses the open-source Flang compiler and MLIR ecosystem to automatically accelerate Fortran intrinsics on the NPU.
Fortran intrinsics are pre-defined functions within the language that perform specific tasks, such as matrix multiplication, data reduction, and array transposition. By leveraging these intrinsics, programmers can write efficient and portable code without needing to worry about low-level optimizations or hardware-specific details.
The researchers’ approach involves developing a set of templates for common Fortran intrinsics, which are then used to generate Intermediate Representation (IR) code that can be executed on the NPU. This IR code is generated using AMD’s MLIR AIE support and is specialized by the compiler for each instantiation.
In experiments, the team demonstrated significant performance gains when accelerating reduction-based Fortran intrinsics, such as sum and product, on the NPU. They also showed that the NPU outperformed traditional CPUs for larger data sets and matrix multiplication operations.
While this breakthrough may seem like a minor victory to some, it has far-reaching implications for scientific computing and machine learning. By allowing programmers to easily harness the power of specialized hardware without needing extensive expertise, researchers can focus on developing more complex and sophisticated algorithms rather than wrestling with low-level implementation details.
Cite this article: “Seamless Acceleration of Fortran Code on AMDs Ryzen AI CPU”, The Science Archive, 2025.
Fortran, Amd Ryzen Ai Cpu, Accelerated Processing Unit, Neural Processing Unit, Mlir, Flang Compiler, Intermediate Representation, Matrix Multiplication, Machine Learning, Artificial Intelligence







