[Paper Review] Accelerating QDP++/Chroma on GPUs
This paper extends QDP++/Chroma to accelerate lattice QCD expression evaluation on NVIDIA GPUs using Just-in-Time (JIT) compilation of user expressions and a software-managed LRU cache for GPU memory. By offloading non-kernel routines—previously neglected in optimization—via GPU execution, the approach achieves a total speedup of over 10×, significantly reducing Amdahl’s Law limitations in Chroma workflows.
Extensions to the C++ implementation of the QCD Data Parallel Interface are provided enabling acceleration of expression evaluation on NVIDIA GPUs. Single expressions are off-loaded to the device memory and execution domain leveraging the Portable Expression Template Engine and using Just-in-Time compilation techniques. Memory management is automated by a software implementation of a cache controlling the GPU's memory. Interoperability with existing Krylov space solvers is demonstrated and special attention is paid on 'Chroma readiness'. Non-kernel routines in lattice QCD calculations typically not subject of hand-tuned optimisations are accelerated which can reduce the effects otherwise suffered from Amdahl's Law.
Motivation & Objective
- Address the performance bottleneck in lattice QCD caused by Amdahl’s Law, where non-kernel routines dominate execution time despite highly optimized solvers.
- Extend QDP++ to support GPU execution for user-defined expressions, enabling acceleration of non-kernel operations like smearing and contractions.
- Ensure full interoperability with QUDA for fermion matrix inversion while sharing GPU memory via a unified software cache.
- Demonstrate 'Chroma readiness' by enabling successful compilation and execution of Chroma on the extended QDP++ stack with GPU acceleration.
- Reduce CPU-GPU data transfer overhead through a runtime software cache managing device memory affinity of lattice objects.
Proposed method
- Offload single user expressions to GPU using dynamic CUDA kernel generation via Just-in-Time (JIT) compilation.
- Employ the Portable Expression Template Engine (PETE) to represent expressions as abstract syntax trees, enabling GPU code generation at runtime.
- Implement a software-based LRU cache to manage GPU memory, minimizing redundant host-to-device transfers by tracking object residency.
- Integrate with QUDA via call wrappers that redirect memory allocations to the shared device memory pool managed by the LRU cache.
- Use a tree parser to traverse expression ASTs, generate GPU code, and query the cache before triggering JIT compilation or device execution.
- Support fallback to host execution if required GPU resources are unavailable, ensuring robustness and backward compatibility.
Experimental results
Research questions
- RQ1Can non-kernel lattice QCD routines—previously unoptimized—be effectively accelerated on GPUs using high-level C++ abstractions?
- RQ2To what extent does GPU acceleration of non-kernel operations reduce the overall execution time in Chroma, given Amdahl’s Law constraints?
- RQ3How can GPU memory management be automated and shared between QDP++ and QUDA without disrupting existing workflows?
- RQ4What performance gains are achievable when both the fermion matrix inversion (via QUDA) and non-kernel routines (via JIT-compiled QDP++ expressions) are accelerated on the same GPU?
- RQ5Can a portable, high-level C++ interface like QDP++ be extended to support heterogeneous GPU execution without sacrificing portability or maintainability?
Key findings
- The extended QDP++ achieves a total speedup of over 10× on a GTX 480 when accelerating all Chroma components, including non-kernel routines, compared to CPU-only execution.
- Even with a 30× speedup in matrix inversion via QUDA, the total speedup was only ~2× when only the solver was GPU-accelerated, demonstrating the dominance of non-kernel routines in execution time.
- The software LRU cache reduced redundant GPU memory transfers, improving efficiency and enabling shared memory management between QDP++ and QUDA.
- JIT compilation of QDP++ expressions enabled GPU execution of user-defined expressions without requiring low-level kernel hand-tuning.
- Initial tests with coalesced memory access showed a 6–10× improvement in sustained memory bandwidth, indicating significant potential for further optimization.
- The implementation successfully supports Chroma compilation and execution, confirming 'Chroma readiness' and enabling end-to-end GPU acceleration of lattice QCD workflows.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.