Skip to content

Review: BEAGLE 3: Improved Performance, Scaling, and Usability for a High-Performance Computing Library for Statistical Phylogenetics

Citation

  • Ayres, D. L., Cummings, M. P., Baele, G., Darling, A. E., Lewis, P. O., Swofford, D. L., Huelsenbeck, J. P., Lemey, P., Rambaut, A., & Suchard, M. A. (2019). BEAGLE 3: improved performance, scaling, and usability for a high-performance computing library for statistical phylogenetics. Systematic Biology, 68(6), 1052–1061.
  • DOI

Abstract

BEAGLE is a high-performance likelihood-calculation library for phylogenetic inference. The BEAGLE library defines a simple, but flexible, application programming interface (API), and includes a collection of efficient implementations for calculation under a variety of evolutionary models on different hardware devices. The library has been integrated into recent versions of popular phylogenetics software packages including BEAST and MrBayes and has been widely used across a diverse range of evolutionary studies. Here, we present BEAGLE 3 with new parallel implementations, increased performance for challenging data sets, improved scalability, and better usability. We have added new OpenCL and central processing unit-threaded implementations to the library, allowing the effective utilization of a wider range of modern hardware. Further, we have extended the API and library to support concurrent computation of independent partial likelihood arrays, for increased performance of nucleotide-model analyses with greater flexibility of data partitioning. For better scalability and usability, we have improved how phylogenetic software packages use BEAGLE in multi-GPU (graphics processing unit) and cluster environments, and introduced an automated method to select the fastest device given the data set, evolutionary model, and hardware. For application developers who wish to integrate the library, we also have developed an online tutorial. To evaluate the effect of the improvements, we ran a variety of benchmarks on state-of-the-art hardware. For a partitioned exemplar analysis, we observe run-time performance improvements as high as 5.9-fold over our previous GPU implementation. BEAGLE 3 is free, open-source software licensed under the Lesser GPL and available at https://beagle-dev.github.io.


BEAGLE is the likelihood library behind BEAST and MrBayes, among others. The paper describes version 3: OpenCL and threaded CPU implementations, concurrent computation of independent partial likelihood arrays for partitioned nucleotide analyses, better use of several GPUs and of clusters, and an automatic choice of the fastest device for a given data set, model and machine.

Numerical rescaling in BEAGLE 3

The paper does not describe a rescaling scheme. Its benchmarks ran without one: "The tests also did not perform numerical value rescaling, as there are numerous ways such rescaling procedures can be effected, and this is a design feature that differs among phylogenetics programs." It notes that rescaling is often necessary, because the likelihood values of many data sets underflow. The same benchmarks used double precision throughout, because PLL, one of the programs compared, does not support single precision.

Relevance to Hifuku

BEAGLE is the established GPU library for the same computation Hifuku performs on the device, the pruning recursion over many site patterns, and its benchmarks show what a mature implementation gains from GPU hardware. The paper describes the earlier BEAGLE GPU likelihood as parallel over site patterns within each node's partial likelihoods, with the tree traversed in sequence (p. 1053). Hifuku's fused kernels take that concept, the site pattern as the unit of parallelism, with a different thread layout: one thread per pattern, walking the whole tree in one launch. BEAGLE 3's own advance, computing several independent partial-likelihood arrays in one launch, is not used. Hifuku has no partitioned likelihood.

Hifuku takes two further concepts from BEAGLE's source code rather than from this paper, and the Hifuku code cites them by file and function (beagle-lib commit ecf2ba5d). Hifuku's implementations of these concepts are its own.

  • libhmsbeagle/CPU/BeagleCPU4StateImpl.hpp, rescalePartials. The concept is the per-node rescaling scheme: divide each pattern by its maximum over states, leave a zero maximum undivided, and accumulate the logarithm of each factor per pattern. The identity behind it is derived in Section 1.2 of the theory overview.
  • libhmsbeagle/plugin/Plugin.h and libhmsbeagle/beagle.cpp, beagleCreateInstance. The concept is one interface over several hardware implementations, each of which describes what it can do. Hifuku's Backend protocol has this structure, with a CPU and a CUDA implementation. BEAGLE also filters and ranks implementations against the caller's preference and requirement flags; Hifuku does not, and the caller names the device.

The 4-bit tip encoding Hifuku uses for DNA is not a BEAGLE concept, since BEAGLE's tip states are integer codes. The concept comes from libpll's nucleotide map (src/maps.c, pll_map_nt): one bit per base, with an ambiguity code as the OR of its bases.