cuTau Leaping

14
cuTauLeaping: A GPU-Powered Tau-Leaping Stochastic Simulator for Massive Parallel Analyses of Biological Systems

description

Brief Explanation about the Tau-Leaping Process, Parallel Processing and NVIDIA's CUDA architecture And the use of cuTau - Leaping for simulation of Biological systems

Transcript of cuTau Leaping

Page 1: cuTau Leaping

cuTauLeaping: A GPU-Powered Tau-Leaping Stochastic

Simulator for Massive Parallel Analyses of Biological

Systems

Page 2: cuTau Leaping

INTRODUCTION Tau-leaping is a stochastic simulation algorithm that

efficiently reconstructs the temporal evolution of biological systems, modeled according to the stochastic formulation of chemical kinetics. Since each simulation can be executed independently from the others, a massive parallelization of tau-leaping can bring to relevant reductions of the overall running time.

In cuTauLeaping, the workflow of the traditional tau-leaping algorithm is partitioned in different phases, which altogether allow a better exploitation of the parallel architecture of the GPU than a monolithic implementation.

Page 3: cuTau Leaping

Global Effects

GPGPU computing allows developers to exploit the great computational power of modern multi-core GPUs, by giving access to the underlying parallel architecture that was conceived for speeding up real-time three-dimensional computer graphics.

Stochastic simulation algorithms exploit random numbers generators (RNGs). Nvidia’s software development kit contains several libraries and utilities that help developers in the process of creating software for this architecture.

Page 4: cuTau Leaping

Economic Factors

The computational study of biological systems can present many advantages in terms of cost, ease to use and rapidity, and can support laboratory work by suggesting ad hoc designed experiments.

CURAND is an external library that we can use in cuTauLeaping .

CURAND from CUDA toolkit v5.0 provides different RNGs that produce psuedo random sequences with a very large period: XORWOW , MRG32K3A and Mersenne Twister (MT).

Of these, the MRG32K3A is the most efficient and cost effective.

Page 5: cuTau Leaping

Implications To Society

The emerging field of General Purpose Graphic Processing Units (GPGPU) provides power-efficient high-performance computing at a relatively low cost.

cuTauLeaping largely outperforms the CPU-based tau-leaping implementation when the number of parallel simulations increases. In particular, cuTauLeaping is exploited to investigate the probability distribution of bistable states in the Schlögl model, and to carry out a bidimensional parameter sweep analysis to study the oscillatory regimes in the Ras/cAMP/PKA pathway in S. cerevisiae.

Page 6: cuTau Leaping

Awareness of contemporary issues

The classical modeling approach based on ordinary differential equations (ODEs) is not able to fully capture all the effects of stochastic processes; in this context, the most remarkable example is the phenomenon of bistability, that can be effectively investigated by means of stochastic approaches.

The traditional methods to perform parallel executions of an algorithm consist in multithreading, distributed computing on clusters, or custom circuitry produced with Field Programmable Gate Arrays (FPGA).

Previous works presented the parallelization on Graphics Processing Units (GPU) of multiple SSA simulations, also considering reaction-diffusion systems [38], and the fine-grain acceleration of a single tau-leaping execution. The research we describe here represents the first achievement, to the best of our knowledge, in running a huge number of parallel tau-leaping simulations on the GPU for the analysis of biological systems; to this aim, we introduce the novel stochastic simulator called cuTauLeaping.

Page 7: cuTau Leaping

Ethical and Professional Issues cuTauLeaping involves a stochastic

simulator of biological systems that makes use of General Purpose Graphic Processing Units(GPGPU) computing to execute multiple parallel tau-leaping simulations, by fully exploiting the Nvidia’s Fermi GPU architecture.

The results of the comparison between cuTauLeaping(GPU used Nvidia GeForce GTX 590) and COPASI CPU tau-leaping show the advantage of cuTauLeaping as the number of simulations increases. Interestingly, because of the architectural differences and the different clock rates, a single run of cuTauLeaping may be slower than the CPU counterpart, and it becomes fully profitable only by running multiple simulations.

Page 8: cuTau Leaping

Figure 13. Performance comparison of CPU tau-leaping and cuTauLeaping

for a PSA of the Ras/cAMP/PKA model.

Page 9: cuTau Leaping

Literature Survey and Future Work Discrete Mathematical Structures

 The Gillespie algorithm (or occasionally the Doob-Gillespie algorithm) generates a statistically correct trajectory (possible solution) of a stochastic equation. 

  Gillespie developed two different, but equivalent formulations; the direct method and the first reaction method. Below is a summary of the steps to run the algorithm (math omitted):

1. Initialization: Initialize the number of molecules in the system, reactions constants, and random number generators.

2. Monte Carlo step: Generate random numbers to determine the next reaction to occur as well as the time interval. The probability of a given reaction to be chosen is proportional to the number of substrate molecules.

3. Update: Increase the time step by the randomly generated time in Step 2. Update the molecule count based on the reaction that occurred.

4. Iterate: Go back to Step 2 unless the number of reactants is zero or the simulation time has been exceeded.

Page 10: cuTau Leaping

Computer Organization & ArchitectureGPGPU computing allows developers to exploit the great computational power of modern multi-core GPUs, by giving access to the underlying parallel architecture that was conceived for speeding up real-time three-dimensional computer graphics. The GPU implementation of tau-leaping that we propose in this work was developed and optimized for Nvidia’s Compute Unified Device Architecture (CUDA), a cross-platform GPGPU library that combines the Single Instruction Multiple Data (SIMD) architecture and multi-threading.

Stochastic simulations based on the τ leaping method are applicable to well stirred chemical systems reacting within a single fixed volume. In this paper we propose a novel method, based on the τleaping procedure, for the simulation of complex systems composed by several communicating regions.

Page 11: cuTau Leaping

Figure 1. Schematization of CUDA architecture. Schematic representation of CUDA threads and memory hierarchy. Left side. Thread organization: a single kernel is launched from the host (the CPU) and 

is executed in multiple threads on the device (the GPU); threads can be organized in three-dimensional structures named blocks which can be, in turn, organized in three-dimensional grids. 

Right side. Memory hierarchy: threads can access data from many different memories with different scopes; registers and local memories are private for each thread. 

Page 12: cuTau Leaping

Digital Logic and DesignFermi is the codename for a GPU micro architecture developed by Nvidia as the successor to the Tesla micro architecture. It was the primary micro architecture used in the GeForce GeForce 400 series and GeForce 500 series. It was followed by Kepler, and used alongside Kepler in the GeForce 600 series, GeForce 700 series, and GeForce 800 series, in the latter two only in mobile GPUs. All desktop Fermi GPUs were manufactured in 40 nm, mobile Fermi GPUs in 40 nm and 28 nm.

Fermi Graphic Processing Units (GPUs) feature 3.0 billion transistors

• Streaming Multiprocessor (SM): composed by 32 CUDA cores (see Streaming Multiprocessor and CUDA core sections).

• GigaThread globlal scheduler: distributes thread blocks to SM thread schedulers and manages the context switches between threads during execution (see Warp Scheduling section).

• Host interface: connects the GPU to the CPU via a PCI-Express v2 bus (peak transfer rate of 8GB/s).

• DRAM: supported up to 6GB of GDDR5 DRAM memory thanks to the 64-bit addressing capability (see Memory Architecture section).

• Clock frequency: 1.5 GHz (not released by NVIDIA, but estimated by Insight 64).• Peak performance: 1.5 TFlops.• Global memory clock: 2 GHz.• DRAM bandwidth: 192GB/s.

Page 13: cuTau Leaping

Data Structures with CThe stoichiometry of chemical reactions is generally represented by (usually sparse) matrices, corresponding to the variation of the species appearing either as reactants or products

In order to further improve the performance of the simulation execution, it is better not to code the stoichiometric information by means of matrices. In cuTauLeaping, we flattened the stoichiometric matrices MA,MV, MVT and (MV)’ – which are typically sparse matrices – by packing their non-zero elements into arrays of CUDA vector types, named uchar4, that have the advantage of requiring a single instruction to fetch an entry.

Components are accessed by means of variable:x, :y, :z, and :w; the vectors corresponding to these matrices are named A,V,VT, V’, respectively. Since both VT and V’ vectors can assume negative numbers, we use an offset to store their :z values as unsigned chars, and subtract the offset during the calculations on the GPU to yield

back the correct negative numbers.

Page 14: cuTau Leaping

REFERENCES

cuTauLeaping: A GPU-Powered Tau-Leaping Stochastic Simulator for Massive Parallel Analyses of Biological Systems - Marco S. Nobile, Paolo Cazzaniga, Daniela Besozzi, Dario Pescini, Giancarlo Mauri.

GPU-powered Simulation Methodologies for Biological Systems - Daniela Besozzi, Giulio Caravagna, Paolo Cazzaniga, Marco Nobile, Dario Pescini and Alessandro Re.