Gangavarapu Karthik, Ji Xiang, Baele Guy, Fourment Mathieu, Lemey Philippe, Iv Frederick A Matsen, Suchard Marc A
ArXiv. 2023 Mar 8:arXiv:2303.04390v1.
The rapid growth in genomic pathogen data spurs the need for efficient inference techniques, such as Hamiltonian Monte Carlo (HMC) in a Bayesian framework, to estimate parameters of these phylogenetic models where the dimensions of the parameters increase with the number of sequences $N$. HMC requires repeated calculation of the gradient of the data log-likelihood with respect to (wrt) all branch-length-specific (BLS) parameters that traditionally takes $\mathcal{O}(N^2)$ operations using the standard pruning algorithm. A recent study proposes an approach to calculate this gradient in $\mathcal{O}(N)$, enabling researchers to take advantage of gradient-based samplers such as HMC. The CPU implementation of this approach makes the calculation of the gradient computationally tractable for nucleotide-based models but falls short in performance for larger state-space size models, such as codon models. Here, we describe novel massively parallel algorithms to calculate the gradient of the log-likelihood wrt all BLS parameters that take advantage of graphics processing units (GPUs) and result in many fold higher speedups over previous CPU implementations. We benchmark these GPU algorithms on three computing systems using three evolutionary inference examples: carnivores, dengue and yeast, and observe a greater than 128-fold speedup over the CPU implementation for codon-based models and greater than 8-fold speedup for nucleotide-based models. As a practical demonstration, we also estimate the timing of the first introduction of West Nile virus into the continental Unites States under a codon model with a relaxed molecular clock from 104 full viral genomes, an inference task previously intractable. We provide an implementation of our GPU algorithms in BEAGLE v4.0.0, an open source library for statistical phylogenetics that enables parallel calculations on multi-core CPUs and GPUs.
基因组病原体数据的快速增长促使人们需要高效的推理技术,例如贝叶斯框架下的哈密顿蒙特卡罗(HMC)方法,来估计这些系统发育模型的参数,其中参数的维度会随着序列数量(N)的增加而增大。HMC需要反复计算数据对数似然相对于所有分支长度特定(BLS)参数的梯度,传统上使用标准剪枝算法进行此计算需要(\mathcal{O}(N^2))次操作。最近的一项研究提出了一种在(\mathcal{O}(N))时间内计算此梯度的方法,使研究人员能够利用诸如HMC之类的基于梯度的采样器。该方法的CPU实现使得基于核苷酸的模型在计算梯度时变得易于处理,但对于更大状态空间大小的模型(如密码子模型),其性能有所不足。在此,我们描述了新颖的大规模并行算法,用于计算对数似然相对于所有BLS参数的梯度,该算法利用图形处理单元(GPU),并比以前的CPU实现带来了许多倍的加速。我们在三个计算系统上使用三个进化推理示例(食肉动物、登革热和酵母)对这些GPU算法进行基准测试,观察到基于密码子的模型比CPU实现加速超过128倍,基于核苷酸的模型加速超过8倍。作为一个实际演示,我们还在具有宽松分子钟的密码子模型下,根据104个完整病毒基因组估计了西尼罗河病毒首次传入美国大陆的时间,这是一个以前难以处理的推理任务。我们在BEAGLE v4.0.0中提供了我们的GPU算法实现,BEAGLE v4.0.0是一个用于统计系统发育学的开源库,可在多核CPU和GPU上进行并行计算。