IV-29 Bill Gillespie

Torsten: Stan functions for pharmacometric applications. New functionality including within chain parallel computation.

William R. Gillespie and Yi Zhang

Metrum Research Group, Tariffville, CT

Introduction/Objectives: Stan is a widely used, open-source, probabilistic programming language and Bayesian inference engine [1, 2]. It provides a general model specification language and uses HMC simulation for fully Bayesian data analysis. Torsten is a library of Stan functions that simplifies implementation of pharmacometric (PMX) models and extends the range of models that may be implemented [3]. The objective of the work presented here is to improve and extend Torsten. This includes the addition of new functions and enhancements to existing ones.

Methods: Torsten is open source software. Its functions are written in C++ and they comply with Stan development requirements. They may be accessed by all Stan interfaces such as RStan and CmdStan. Torsten now includes versions of Stan’s ordinary differential equation (ODE) solvers that have been revised to improve performance and provide MPI-based parallel computing, Existing Torsten PMX functions now use those functions instead of those in Stan. Also added to both Stan and Torsten is a new ODE solver using the Adams-Mouton method from the CVODES package [4]. Previous Torsten PMX functions calculated model states for one individual at a time. We have implemented new population functions that calculate the model states for a group of individuals in a single function call. Those functions also employ MPI to distribute those calculations over multiple processors, thus providing efficient within chain parallel computation. We have developed a Stan interface to user-provided numerical partial differential equation (PDE) solvers. So far the interface has been tested on three external solvers: OpenSees, libMesh and MFEM. More can be added with similar fashion.

Results: Here we show the parallel speedup using Torsten’s BDF integrator for stiff ODEs with a neutropenia model described by a system of 8 ODEs. In this model we solve a group of ODE systems. Each ODE system in the group is the same but with different parameters. We fix the group size to 1000 and solve it with Torsten’s MPI solver using different numbers of processors.

MPI performance of the neutropenia model solved by Torsten’s BDF integrator

 n_processor  Walltime(ms) Speedup  efficiency
——————————————————————–
        1                 9774            1.000       1.000
        2                 4943            1.977       0.989
        4                 2453            3.985       0.996
        8                 1350            7.240       0.905
      16                 1140            8.574       0.536
      32                   788          12.404       0.388
      64                   710          13.766       0.215
     128                  534          18.303       0.143
     256                  446          21.915       0.086
     512                  451          21.672       0.042

Similar speedup is seen with the Adams-Moulton integrator. Based on the above ODE integrators, Torsten’s new population PMX functions take NONMEM-compatible event inputs so they can be directly applied in a Stan inference model. Below we show the MPI performance results for a two compartment model solved by Torsten’s PMX function using the BDF integrator. The inference model contains a population of 8, with the parameters being each individual’s CL, Q, V1, V2, and ka. In each MCMC run the number of warmup and post-warmup samples is 200 each.

MPI performance of the two-cpt inference model by Torsten’s PMX solver (BDF integrator)

 n_processor  Walltime(ms) Speedup  efficiency
——————————————————————
     1                    7850            1.000       1.000
     2                    4067            1.930       0.965
     4                    2186            3.591       0.898
     8                    1255            6.255       0.782

Conclusions: Recent developments in Stan and Torsten significantly improve computational efficiency and extend the range of models that may be implemented. The addition of within chain parallel computation to Stan/Torsten makes fully Bayesian analysis with Stan an increasingly practical option for PMX applications.

References:
[1] B. Carpenter, A. Gelman, M. Hoffman, D. Lee, B. Goodrich, M. Betancourt, M. Brubaker, J. Guo, P. Li, , and A. Riddell. Stan: A probabilistic programming language. Journal of Statistical Software, 76(1):1–32, 2017.
[2] B. Carpenter, M. D. Hoffman, M. Brubaker, D. Lee, P. Li, and M. Betancourt. The Stan Math Library: Reverse-mode automatic differentiation in C++. arXiv, 1509.07164, 2015.
[3] https://github.com/metrumresearchgroup/Torsten
[4] A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward. Sundials: Suite of nonlinear and differential/algebraic equation solvers. ACM Transactions on Mathematical Software (TOMS), 31(3):363–396, 2005.

Reference: PAGE 28 (2019) Abstr 9168 [www.page-meeting.org/?abstract=9168]

Poster: Methodology - Estimation Methods

PDF poster / presentation (click to open)