IMPROVING THE PERFORMANCE OF PATIENT-LEVEL SIMULATION MODELS USING MULTI-THREADING AND SINGLE INSTRUCTION MULTIPLE DATA (SIMD) OPERATIONS
Author(s)
Pollock R
Covalence Research Ltd, London, UK
OBJECTIVES Health economic evaluations based on patient-level simulations can be computationally expensive to perform, particularly where Monte Carlo simulation and non-parametric bootstrapping are employed. Alongside continuing improvements in the performance of underlying hardware, substantial performance gains may also be achieved by implementing multi-threading and replacing conventional for-loops with vectorized single instruction multiple data (SIMD) operations. The present study evaluated the performance of risk equations from the United Kingdom Prospective Diabetes Study Outcomes Model (UKPDSOM) using for-loops versus SIMD operations, and single-threading versus multi-threading. METHODS The UKPDSOM myocardial infarction cumulative incidence functions for males and females (exponential and Weibull models, respectively) were implemented in a single-threaded Swift 4.2.1 program using for-loops to calculate beta coefficient sum products, and exponent and logarithmic functions from glibc to derive annual event probabilities. The loops were subsequently replaced with the vectorized vDSP_vmulD (vector multiply), vDSP_sveD (vector sum), and vvlogf (vector logarithm) functions from the vForce and vDSP libraries, and the workload spread across 2 or 4 threads using an asynchronous dispatch queue. Mean runtimes and standard deviations (SD) were calculated over five simulations. RESULTS The mean (±SD) runtime for a single-threaded patient-level simulation with 1,000,000 patients over a 40-year time horizon was 97.8±0.15 seconds using for-loops versus 64.9±0.22 seconds using vectorized functions. Running on 2 threads reduced the runtime to 51.3±0.63 and 36.9±1.16 seconds with for-loop and vectorized versions, respectively, while running on 4 threads took 28.8±1.80 seconds and 25.0±1.61 seconds, again respectively. Overall, introducing SIMD and running on 4 threads reduced simulation time by 74% relative to using conventional for-loops on a single thread. CONCLUSIONS Modern concurrency and vectorization libraries allow multi-threading and SIMD optimizations to be implemented relatively easily in patient-level simulation models, substantially improving model performance and facilitating shorter model runtimes, or allowing more sophisticated modeling or sampling techniques to be employed with no runtime penalty.
Conference/Value in Health Info
2019-11, ISPOR Europe 2019, Copenhagen, Denmark
Code
PNS302
Topic
Clinical Outcomes, Methodological & Statistical Research
Topic Subcategory
Clinical Outcomes Assessment, Modeling and simulation
Disease
Diabetes/Endocrine/Metabolic Disorders, No Specific Disease