Redesign and heterogeneous computing
Authors: Edgeley James , Sanderson Allen , Xing Jacques 
Published: June 2024

This session focuses on the redesign of Nektar++ operators to enable the heterogeneous (CPU/GPU) computing and its comprises the following talks
1. Multi-level pipelining for improved GPU performance
2. Redesigning the Nektar++ Operators for CPU/GPU Execution, a WIP
3. Performance Timing

Multi-level pipelining for improved GPU performance

Optimising performance on GPUs requires careful shepherding of data through the different levels of memory to their arithmetic operations and then back through memory. By overlapping data transfers and calculation in a pipeline it is possible to minimise bottlenecking and obtain the best performance from the device. This general approach can be employed at all levels of the GPU memory model. Two examples are discussed: a pipelined kernel for local operators and a graph-based execution model.
The pipelined kernel has been implemented in CUDA and applied to some of the redesigned Nektar++ operators. Using double buffering and tuning the work-per-thread to hide latency it is possible to achieve significant speedups over existing latency-bound methods.
As well as optimisations to the kernels themselves, further improvements can be achieved by reordering and overlapping the kernels with data movement. A directed acyclic graph model with support for several backends has been implemented. Expensive memory copies and kernel launch overheads are avoided. Encapsulating operations on blocks of data as nodes in this graph allows for greater parallelisation and scalability.

Redesigning the Nektar++ Operators for CPU/GPU Execution, a WIP

As part of the Nektar++ redesign efforts the operators have been brought under one roof so to easily allow for different implementations to be developed, maintained, and deployed. Two keys parts of the development and maintenance allow code that is common across the implementations to be utilized. The remaining differences typically amount to a few kernels. In some cases, no differences remains thus allowing for a “universal” implementation. The second key part was the introduction of the execution and memory space paradigm. This paradigm was key to being able to deploy the operators across the CPUs and GPUs without any need for “device” specific implementations. This talk will be a bit of “deep dive” as many of the paradigms introduced will be used throughout the redesign progresses.

GPU Performance Benchmarking for the Nektar++ Redesign

Nektar++ is being redesigned as a collection of operators to allow different implementations targeting various hardware architectures. As high-performance computing (HPC) clusters are moving more and more toward heterogeneous architectures, parts of the Nektar++ redesign efforts involve the offloading of operators workload to GPUs. However, efficient use of GPUs notably requires proper memory access and high occupancy rate. In this respect, this work present preliminary performance benchmarking results for the 2D and 3D BwdTrans operators using CUDA and Kokkos implementations exploiting both single-level and hierarchical parallelisms.