Conference site ยป Proceedings

Using Numba for GPU acceleration of Neutron Beamline Digital Twins

Coleman J. Kendrick
Oak Ridge National Laboratory

Jiao Y. Y. Lin
Oak Ridge National Laboratory

Garrett E. Granroth
Oak Ridge National Laboratory


Digital twins of neutron instruments using Monte Carlo ray tracing have proven to be useful in neutron data analysis and verifying instrument and sample designs. However, these simulations can become quite complex and computationally demanding with tens of billions of neutrons. In this paper, we present a GPU accelerated version of MCViNE using Python and Numba to balance user extensibility with performance. Numba is an open-source just-in-time (JIT) compiler for Python using LLVM to generate efficient machine code for CPUs and GPUs with NVIDIA CUDA. The JIT nature of Numba allowed complex instrument kernels to be generated easily. Initial simulations have shown a speedup between 200-1000x over the original CPU implementation. The performance gain with Numba enables more sophisticated data analysis and impacts neutron scattering science and instrument design.


Monte Carlo, numba, digital twin, Python, neutron, GPU, ray tracing, CUDA



Bibtex entry

Full text PDF