Coleman Kendrick - Using Numba for GPU acceleration of Neutron Beamline Digital Twins | SciPy 2023

Numba accelerates neutron beamline simulations with GPUs, enabling custom components and scattering kernels on GPUs.

Key takeaways
  • Numba is an open-source just-in-time compiler for Python using LLVM as the backend.
  • McVine is a software package for simulating neutron beamline experiments.
  • McVine.ACC is a new version of McVine written in pure Python using Numba for GPU acceleration.
  • McVine.ACC can achieve significant speedups over the original McVine, especially for large simulations.
  • Numba allows scientists to implement their own components and scattering kernels in Python and achieve the performance benefits of GPU acceleration.
  • McVine.ACC supports a large subset of NumPy functions and data structures, making it easy to use existing NumPy code on the GPU.
  • McVine.ACC is currently being deployed to the McMine software package on Conda.
  • Numba has a wide variety of platforms, including AMD 64, ARM, PowerPC, and CUDA.
  • Numba is constantly being updated and improved, with a very active community.
  • Numba is easy to use, with minimal code changes needed to get something running on the GPU.
  • Numba has some downsides, such as not fully supporting all Python features and having some limitations with conditional statements.