Adoption of the alpaka performance portability library in the CMS software
Andrea Bocci, Antonio Di Pilato, Eric Cano, Felice Pantaleo, Gabrielle Hugo, Marco Rovere, Matti Kortelainen, Shahzad Malik Muzaffar, Vincenzo Innocente, Wahid Redjeb · Journal of Physics Conference Series · 2023
Abstract To achieve better computational efficiency and exploit a wider range of computing resources, the CMS software framework (CMSSW) has been extended to offload part of the physics reconstruction to NVIDIA GPUs, while the support for AMD and Intel GPUs is under development. To avoid the need to write, validate and maintain a separate implementation of the reconstruction algorithms for each back-end, CMS decided to adopt a performance portability framework. After evaluating different alternatives, it was decided to adopt Alpaka as the solution for Run-3. Alpaka (Abstraction Library for Parallel Kernel Acceleration) is a header-only C++ library that provides performance portability across different back-ends, abstracting the underlying levels of parallelism. It supports serial and parallel execution on CPUs, and extremely parallel execution on GPUs. This contribution will show how Alpaka is used inside CMSSW to write a single code base; to use different tool-chains to build the code for each supported back-end, and link them into a single application; and to select the best back-end at runtime. It will highlight how the alpaka-based implementation achieves near-native performance, and will conclude discussing the plans to support additional back-ends.