Scientists are increasingly focused on modeling the complex multiphysics within spintronic devices, requiring high-performance computational methods. Andy Nonaka, Yingheng Tang, and Julian C. LePelch, in collaboration with colleagues in the Applied Mathematics and Computational Research Division at Lawrence Berkeley National Laboratory, and with contributions from the Center for Applied Scientific Computing at the University of Texas at El Paso and Lawrence Livermore National Laboratory, present MagneX, a new GPU-enabled data-driven micromagnetic solver. This study details the development of an open-source tool leveraging the AMReX framework and SUNDIALS library, incorporates important magnetic coupling mechanisms, and demonstrates significant performance scalability. Importantly, the team validates MagneX against established benchmarks and introduces a data-driven approach. This replaces computationally intensive demagnetization calculations with neural networks trained on simulation data, providing a path to rapid and comprehensive modeling of advanced spintronic and electronic systems.
Scientists have unveiled MagneX, a new computational tool designed to simulate the complex behavior of magnetism in nanoscale materials with unprecedented efficiency and accuracy. This open-source framework addresses critical limitations of existing micromagnetic modeling software and paves the way for advances in spintronics and magnetic data storage. MagneX combines cutting-edge techniques such as GPU acceleration, multirate time integration, and machine learning to tackle the tough computational challenges inherent in modeling magnetic materials at the nanoscale. This framework accurately captures important magnetic coupling mechanisms such as Zeeman coupling, demagnetizing coupling, crystal anisotropic interactions, exchange coupling, and Jarosinski-Moriya interaction (DMI) coupling. MagneX is distinguished by its ability to handle the heterogeneous spatial and temporal scales present in micromagnetic simulations. Traditional methods often struggle with the computational cost of accurately modeling these phenomena, especially when dealing with hard physical processes. The tool leverages the Exascale Computing Project software framework AMReX with the SUNDIALS temporal integration library and Python-based machine learning workflows to deliver significant performance improvements. AMReX facilitates adaptive mesh refinement and can increase the resolution of regions of interest while maintaining computational efficiency across the simulation domain. Importantly, MagneX incorporates a modular design that allows researchers to seamlessly integrate machine learning surrogates to speed up computationally intensive tasks such as calculating demagnetizing fields. The machine learning module was trained using a dataset generated from 1,000 simulations, producing a total of 20,000 input-output pairs consisting of the magnetizing field input M and the corresponding demagnetizing field output Hdemag created by the forward simulation. A two-dimensional Fourier neural operator (FNO) was trained to approximate the mapping from the normalized magnetic field to the demagnetized field, resulting in a stable and efficient surrogate model. Rigorous validation against established benchmarks such as mumag standard problems and widely accepted DMI tests confirms the reliability of MagneX simulations. By replacing traditional demagnetization field calculations with neural networks, the researchers demonstrated data-driven capabilities that significantly reduce computational costs. The trained model is converted to TorchScript format and can now be deployed within MagneX’s C++ environment without relying on Python. The input magnetization data stored in the AMReX MultiFab structure is converted to a 4D tensor of shape (Nb, C, H, W). Here, Nb is the batch size, C represents the three magnetization components, and (H, W) denote the in-plane spatial dimensions, facilitating seamless integration with the PyTorch framework and GPU-accelerated inference. Initial testing has demonstrated that MagneX can be significantly faster through the implementation of additively partitioned methods. Utilizing a combination of explicit Runge-Kutta (RE), implicit Runge-Kutta (RI), and explicit multirate integration (RF) decomposition, the time to solution of the classical Runge-Kutta approach was clearly improved. The allowed time step is inversely proportional to the square of the grid spacing, a key factor in computational efficiency, and the time step constraints are less restrictive for degaussing calculations than for other physical processes, allowing for strategic partitioning. MagneX employs a multirate time integration scheme that treats physically heterogeneous processes, such as rapid exchange interactions and slow demagnetization effects, on separate timescales. This approach significantly increases computational efficiency by allowing larger time steps for slower phenomena without compromising accuracy for faster processes. The core of the simulation is the Landau-Lifshitz-Gilbert (LLG) equation governing the time evolution of the magnetization vector field under the influence of the effective magnetic field. The demagnetization term can also be computed by fast Fourier transform (FFT)-based convolution methods, providing a benchmark for evaluating the performance of machine learning approaches. This hybrid strategy, which combines GPU-accelerated computation, advanced temporal integration, and machine learning, enables scalable, high-fidelity modeling of complex magnetization dynamics. Scientists have long sought to accurately model the complex behavior of magnetic materials at the nanoscale, a pursuit essential to advances in spintronics and next-generation data storage technologies. This new study represents an important step forward by presenting MagneX, an open-source micromagnetic modeling tool explicitly designed to overcome these limitations. By leveraging these advanced techniques, this tool unlocks the potential to investigate a much wider range of magnetic configurations and dynamical behaviors. However, relying on training data has its own limitations. The accuracy of a machine learning component is directly related to the quality and scope of the initial simulations used to train it. Although the current validation is promising, extending this approach to more complex magnetic interactions and material compositions requires considerable additional data and careful consideration of potential biases. Future work will likely focus on refining these machine learning models, exploring alternative alternative techniques, and integrating MagneX with other modeling frameworks to create a truly comprehensive platform for the design and analysis of spintronic devices.
👉 More information
🗞 MagneX: A high-performance, GPU-enabled, data-driven micromagnetic solver for spintronics
🧠ArXiv: https://arxiv.org/abs/2602.12242
