17
SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer (SDSC/UCSD) & Alexandros Stamatakis (TUM) December 3, 2009

SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

Embed Size (px)

Citation preview

Page 1: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

Hybrid MPI/Pthreads Parallelizationof the RAxML Phylogenetics Code

Wayne Pfeiffer (SDSC/UCSD) &Alexandros Stamatakis (TUM)

December 3, 2009

Page 2: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

What was done? Why is it important? Who cares?

• Hybrid MPI/Pthreads version of RAxML phylogenetics code was developed• MPI code was added to previous Pthreads-only code

• This allows multiple multi-core nodes in a cluster to be used in a single run• Typical problems now run well on 10 nodes (80 cores) of Dash (a new

cluster at SDSC) as compared to only on one node (8 cores) before

• Hybrid code is being made available on TeraGrid via CIPRES portal• Work was done as part of ASTA project supporting Mark Miller of

SDSC, who oversees the portal• This will give biologists easy access to the code

Page 3: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

What does a phylogenetics code do?

. . . ...... . .Homo_sapiens AAGCTTCACCGGCGCAGTCATTCTCATAAT...Pan AAGCTTCACCGGCGCAATTATCCTCATAAT...Gorilla AAGCTTCACCGGCGCAGTTGTTCTTATAAT...Pongo AAGCTTCACCGGCGCAACCACCCTCATGAT...Hylobates AAGCTTTACAGGTGCAACCGTCCTCATAAT...

/-------------------------- Homo_sapiens | |-------------------------- Pan + | /----------------- Gorilla | | \---96---+ /-------- Pongo \---100--+ \-------- Hylobates

It starts from amultiple sequence alignment (matrix of taxa versus characters)

& generates a phylogeny (usually a tree of taxa)

Page 4: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

A little more about molecular phylogenetics

• Multiple sequence alignment• Specified by DNA bases, RNA bases, or amino acids• Obtained by separate analysis of multiple sequences

• Possible changes to a sequence• Substitution (point mutation or SNP: considered in RAxML)• Insertion & deletion (also handled by RAxML)• Structural variations (e.g., duplication, inversion, & translocation)• Recombination & horizontal gene transfer (important in bacteria)

• Common methods, typically heuristic & based on models of molecular evolution• Distance• Parsimony• Maximum likelihood (used by RAxML)• Bayesian

Page 5: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

RAxML is a maximum likelihood (ML) codewith parallelism at various algorithmic levels

• Heuristic searching within a tree can exploit fine-grained parallelism using Pthreads• A variant of subtree pruning and grafting (SPR) called lazy subtree

rearrangement (LSR)

• Three types of searches across trees can exploit coarse-grained parallelism using MPI• Multiple ML searches on the same data set starting from different

initial trees to explore solution space better• Multiple bootstrap searches on resampled data sets to obtain

confidence values on interior branches of tree• Comprehensive analysis that combines the two previous analyses

Page 6: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

Comprehensive analysis combinesmany rapid bootstraps followed by a full ML search

• Complete, publishable analysis in a single run• Four stages (with typical numbers of searches)

• 100 rapid bootstrap searches• 20 fast ML searches• 10 slow ML searches• 1 thorough ML search

• Coarse-grained parallelism via MPI• In first three stages, but decreasing with each stage

• Fine-grained parallelism via Pthreads• Available at all stages

• Tradeoff in effectiveness between MPI and Pthreads• Typically 10 or 20 MPI processes max• Optimal number of Pthreads increasing with number of patterns, but

limited to number of cores per node

Page 7: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

Some noteworthy points regardingthe MPI parallel implementation

• A thorough search is done for every MPI process (instead of just a single search as in Pthreads-only code)• Increases run time only a little, because load is reasonably balanced• Often leads to better quality solution

• Only two MPI calls are made• MPI_Barrier after bootstraps• MPI_Bcast after thorough searches to select best one for output

• Treatment of random numbers is reproducible• At least for a given number of MPI processes

Page 8: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

5 benchmark problems & 4 benchmark computerswere used

Benchmark problems

Benchmark computers (all with quad-core x64 processors)

Abe at NCSA 8-way nodes with 2.33-GHz Intel ClovertownsDash at SDSC 8-way nodes with 2.4-GHz Intel NehalemsRanger at TACC 16-way nodes with 2.3-GHz AMD BarcelonasTriton PDAF at SDSC 32-way nodes with 2.5-GHz AMD Shanghais

RecommendedTaxa Characters Patterns bootstraps

354 460 348 1,200150 1,269 1,130 650218 2,294 1,846 550404 13,158 7,429 700125 29,149 19,436 50

Page 9: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

For problem with 1.8k patterns, RAxML achieves speedupof 35 on 80 cores of Dash using 10 MPI processes & 8 Pthreads

Page 10: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

Parallel efficiency plot of same data clarifies performance differences;on ≥ 8 cores, 4 or 8 Pthreads is optimal;

on 8 cores, 4 Pthreads is 1.3x faster than 8 Pthreads

Page 11: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

First three stages scale well with MPI,but last (thorough search) stage does not; that limits scalability

Page 12: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

For problem with 19k patterns, performance on Dash is best usingall 8 Pthreads; scaling is poorer than for problem with 1.8k patterns

Page 13: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

For problem with 19k patterns, scaling is betteron Triton PDAF than on Dash using all 32 Pthreads available

Page 14: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

For problem with 19k patterns, Triton PDAF is fasterthan other computers at high core counts

Page 15: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

With more bootstraps (per bootstopping):speedup is better & parallel efficiency ≥ 0.44 on 80 cores;

optimal number of threads drops; &run time for longest problem goes from > 4 d to < 1.8 h

Best time (s) / threads Speedup Computer/Taxa Patterns on 1c on 80c on 80c bootstraps

Results for 100 bootstraps specified354 348 1,980 130 /4 15.23 Dash150 1,130 2,325 95 /8 24.47 Dash218 1,846 9,630 271 /8 35.54 Dash404 7,429 72,866 1,828 /8 39.86 Dash125 19,436 22,970 1,092 /8 21.03 Dash125 19,436 32,627 847 /32 + 38.52 + Triton PDAF

Results for >100 bootstraps specified354 348 15,703 443 /2 35.45 Dash/1,200150 1,130 10,566 290 /4 36.43 Dash/ 650218 1,846 33,738 845 /4 39.93 Dash/ 550404 7,429 355,724 6,270 /8 56.73 Dash/ 700

1c and 80c refer to the number of cores used in a run. The run with a + was made on 64c.

Page 16: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

The hybrid code provides three notable benefitsfor comprehensive analyses

• Multiple computer nodes can be used in a single run• For problem with 1.8k patterns, speedup on 10 nodes (80 cores) of

Dash is 6.5 compared to one node (using 8 Pthreads in both cases)• Speedup is 35 on 80 cores compared to serial case

• Number of Pthreads per node can be adjusted for optimal efficiency• For same problem, using 2 MPI processes & 4 Pthreads on a single

node of Dash is 1.3x faster than using 8 Pthreads alone

• Additional thorough searches often lead to better solution

Page 17: SAN DIEGO SUPERCOMPUTER CENTER at the UNIVERSITY OF CALIFORNIA, SAN DIEGO Hybrid MPI/Pthreads Parallelization of the RAxML Phylogenetics Code Wayne Pfeiffer

SAN DIEGO SUPERCOMPUTER CENTER

at the UNIVERSITY OF CALIFORNIA, SAN DIEGO

Some final points

• Newest computers are fastest• Dash is fastest for 4 out of 5 problems considered• Triton PDAF is fastest for problem with 19k patterns because it allows

32 Pthreads

• Hybrid code is available in RAxML 7.2.4 and later• Available now from RAxML Web site

(http://wwwkramer.in.tum.de/exelixis/software.html)• Available soon on TeraGrid via CIPRES portal

(http://www.phylo.org/portal2)