Enhancing Numerical Computation Performance
Explore techniques to optimize numerical code performance by considering technology choices, algorithmic strategies, and the impact of memory, compute, and I/O resources. Learn how to identify bottlenecks, create performance models, profile for improvements, and leverage parallelization for enhanced efficiency.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Speeding up numerical computations Tuomas Koskela ARC Collaborations HPC subgroup t.koskela@ucl.ac.uk
What limits performance of my numerical code? Technology choices Algorithmic choices Compute is cheap, memory is expensive Especially so with GPUs I/O is much more expensive Concurrency <-> Load balance Clock rates no longer increase, parallelism is key
How to measure and improve performance Make a model of performance bottlenecks Profile to prove/disprove the model Predict behavior Optimize the code! Refactoring, parallelisation, algorithms, Verify predictions Repeat
Roofline model example Arithmetic Intensity (AI) = Flops/Bytes presented to DRAM [1] Attainable Flop/s = min(Peak Flop/s, AI * Bandwidth) Memory/Cache locality modifications are observed as changes in AI Peak Flop/s Attainable Flop/s Memory Bound Compute Bound [1] S. Williams, et. al., CACM, vol. 52, no. 4, pp. 65-76, 2009. Arithmetic Intensity (Flop/Byte)
Example: CONQUEST Density Functional Theory (DFT) Code Written in Fortran Parallelised with MPI from 1 to O(100 000) cores https://github.com/OrderN/CONQUEST-release Open source https://github.com/OrderN/CONQUEST-release Collaboration between UCL ARC and Dept of Physics under ARCHER2 eCSE programme
Performance model & predictions Concurrency in loops over grid points is not being exploited Parallelising with OpenMP will yield speedups MPI based parallelism scales badly on systems with large nodes Will scale better if we can exploit distributed parallelism on-node Matrix multiplication performance is limited by communication Overlapping communication with computation will improve performance
Loops over grid Scalapack diagonalisation 127s runtime OMP Threads idle
Loops over grid OMP threaded Scalapack is now a bigger bottleneck 40s runtime OMP Threads Working
Weak scaling measurement on ARCHER2 Pure MPI is ~30% faster on one node Hybrid MPI+OpenMP is ~30% faster on 32 nodes
Messages sent out Rank 1 gets a slow receive, everyone else has to wait Same receive/wait pattern repeats
Messages sent out
Summary Many factors can limit code performance, usually it s not serial compute Profiling tools and techniques can help you reason about performance bottlenecks and fix them Contact us to collaborate on solving this kind of issues