molecular dynamics simulations and drug discovery · molecular dynamics simulations and drug...

40

Upload: others

Post on 21-May-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics
Page 2: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

Molecular dynamics simulations and drug discovery

First principles computational materials design for energy storage materials in lithium ion batteries

Ying Shirley Meng, M. Elena Arroyo-de Dompablo

Jacob D. Durrant, J. Andrew McCammon

“With constant improvements in both computer power and algorithm design,

the future of computer-aided drug design is promising; molecular dynamics

simulations are likely to play an increasingly important role.”

BMC Biology 2011 9:71 | DOI: 10.1186/1741-7007-9-71

Energy Environ. Sci. 2009, 2, 589–609 | DOI: 10.1039/b901825e

“Specifically, we show how each relevant property can be related to the struc-

tural component in the material and can be computed from first principles.”

Page 3: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

SYSTEM SIZE

SA

MP

LIN

G T

IME

AB-INITIO METHODS

MOLECULAR DYNAMICS

100 100.000

ps

μs

ns

ms

fs

Map for Atomistic Simulations

Page 4: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

SYSTEM SIZE

SA

MP

LIN

G T

IME

AB-INITIO METHODS

QM/MMMETHODS

MOLECULAR DYNAMICS

100 100.000

ps

μs

ns

ms

fs

Map for Atomistic Simulations

Page 5: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

Nobel Prize 2013 in Chemistry: Development of Multiscale Models

Further details:

Electron dynamics in complex environments with real-time time dependent density functional theory in a QM-MM framework

U.N. Morzan et al.

The Journal of Chemical Physics 140, 164105 (2014).

DOI: 10.1063/1.4871688

Page 6: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

THE LIO PROJECT

“Implementing novel methods of atomistic quantum simulation that efficiently use the

current state-of-the-art hardware tools”

github.com/nanolebrero/lio

Computer

Science

Theoretical

ChemistryLIO

Page 7: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

THE LIO PROJECT

github.com/nanolebrero/lio

Quantum Calculations (QM/MM with Amber)

DFT + Gaussian Basis

Born-Oppenheimer

Dynamics

TD-DFT ElectronDynamics

Single Point Calculation Electronic Propagation

Ehrenfest Dynamics

Page 8: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

ρ( x , y , z)

DFT: The way of the density

Hohenberg - Khon Theorem

“Motions are governed not by deterministic laws, but by probability functions; chemical bonds are formed not mechanically, but by shifting clouds of electrons that are simultaneously waves and particles.”

Molecular dynamics simulations and drug discovery

Ψ(r⃗1, ... , r⃗n)

Page 9: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

ρ( x , y , z)

DFT: The way of the density

Hohenberg - Khon Theorem

Ψ(r⃗1, ... , r⃗n)

ρ( x , y , z) =∑i=1

M

∑j=1

M

Pij ⋅χi( x , y , z )⋅χ j( x , y , z)

Page 10: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

E [ ρ ] = T [ ρ ] + V ne [ ρ ] + V ee [ ρ ] + E XC [ ρ ]

Page 11: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

Analytical Resolution:

gets distributed

ρ(r )= ∑i=1

M

∑j=1

M

Pij⋅χi(r )⋅χ j(r )

= T [ P ] +V ne [ P ] +V ee [ P ]

E [ ρ ] = T [ ρ ] + V ne [ ρ ] + V ee [ ρ ] + E XC [ ρ ]

Page 12: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

E [ ρ ] = T [ ρ ] + V ne [ ρ ] + V ee [ ρ ] + E XC [ ρ ]

Single Point( 1 Step )

Page 13: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

E XC [ ρ ] ≃∭ ϵXC [ ρ(x , y , z ) , ∇ρ(x , y , z) ] dV

E XC [ ρ ] ≃∑k

ϵXC [ ρ(r k ) ,∇ρ(rk ) ]⋅V k

ρ(r k ) =∑i=1

M

∑j=1

M

Pij χi(r k ) χ j(rk )

∂ρ∂ x

=∑i=1

M ∂χi

∂ x∑j=1

M

Pij χ j +∑i=1

M

χ i ∑j=1

M

Pij

∂χ j

∂ x

Page 14: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Compute Basis Values.

(2) Compute Density Values.

(3) Numeric Integral

SINGLE POINT CALCULATION

INPUTNuclear Geometry

OUTPUTGround State Density

Pij EXC [ ρ ]

Starting Guess

Page 15: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Compute Basis Values.

(2) Compute Density Values.

(3) Numeric Integral

SINGLE POINT CALCULATION

INPUTNuclear Geometry

OUTPUTGround State Density

Pij EXC [ ρ ]

Starting Guess

χ1(r 1) ... χ1(r K )... ... ...

χ M (r1) ... χM (r K )

Page 16: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Compute Basis Values.

(2) Compute Density Values.

(3) Numeric Integral

SINGLE POINT CALCULATION

INPUTNuclear Geometry

OUTPUTGround State Density

Pij EXC [ ρ ]

Starting Guess ρ(r k) =∑i=1

M

∑j=1

M

Pij χ i(r k) χ j(r k)

Page 17: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Compute Basis Values.

(2) Compute Density Values.

(3) Numeric Integral

SINGLE POINT CALCULATION

INPUTNuclear Geometry

OUTPUTGround State Density

Pij EXC [ ρ ]

Starting Guess ∑k

ϵXC [ ρ(r k) , ∇ρ(rk ) ]⋅V k

Page 18: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Compute Basis Values.

(2) Compute Density Values.

(3) Numeric Integral

SINGLE POINT CALCULATION

INPUTNuclear Geometry

OUTPUTGround State Density

Pij EXC [ ρ ]

Starting Guess ρ(r k) =∑i=1

M

∑j=1

M

Pij χ i(r k) χ j(r k)

Page 19: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

ρ(r k) =∑i=1

M

∑j=1

M

Pij χ i(r k) χ j(r k)

1 Thread = 1 Point + Double Sum

Page 20: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

ρ(r k) =∑i=1

M

χ i(rk ) ∑j=1

M

P ij χ j(r k)

1 Thread = 1 Point + Only j-Sum

(+ other subroutine to i-accumulate)

ρ(r k) =∑i=1

M

∑j=1

M

Pij χ i(r k) χ j(r k)

Page 21: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∂ρ∂ x

=∑i=1

M ∂χi

∂ x∑j=1

M

Pij χ j +∑i=1

M

χi ∑j =1

M

P ij

∂χ j

∂ x

SAMEPATTERN

SAMENUMBER

ρ(r k) =∑i=1

M

∑j=1

M

Pij χ i(r k) χ j(r k)

ρ(r k) =∑i=1

M

χ i(rk ) ∑j=1

M

P ij χ j(r k)

Page 22: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

k=1 k=2 k=3 k=4 k=5 k=6 k=7 k=8 .........

i = 1

i = 2

i = 3

i = 4

i = 5

i = 6

i = 7

i = 8

FU

NC

TIO

NS

OF

BA

SIS

...

POINTS OF GRID∑j=1

M

P ij χ j(r k)

Page 23: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

k=1 k=2 k=3 k=4 k=5 k=6 k=7 k=8 .........

i = 1

i = 2

i = 3

i = 4

i = 5

i = 6

i = 7

i = 8

BLOCKS OF SIZE B

...

POINTS OF GRIDF

UN

CT

ION

S O

F B

AS

IS

Page 24: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∑j=1

M

P1 j χ j(r k)

...

∑j=1

M

P2 j χ j(r k)

∑j=1

M

PBj χ j(r k)

BLOCKS OF SIZE B

Point k fixed

Thread 1

Thread 2

Thread B

( function i = B )

( function i = 2 )

( function i = 1 )

Page 25: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∑j=1

M

P1 j χ j(r k)

...

∑j=1

M

P2 j χ j(r k)

∑j=1

M

PBj χ j(r k)

BLOCKS OF SIZE B

Point k fixed

Thread 1

Thread 2

Thread B

( function i = B )

( function i = 2 )

( function i = 1 )

The same set of j = 1 to M for all

threads

Different sets of j = 1 to M for all

threads

Pi 1 , P i 2 , ... , Pi M χ1(r k) , χ2(rk ) , ... , χM (r k )

Page 26: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∑j=1

B

P1 j χ j(rk ) + ∑j=B+1

2 B

P1 j χ j(r k ) +... + ∑j=M−B+1

M

P1 j χ j(r k)

...

∑j=1

B

P2 j χ j(r k) + ∑j=B+1

2 B

P2 j χ j(rk ) +... + ∑j=M −B+1

M

P2 j χ j(rk )

∑j=1

B

PBj χ j(rk ) + ∑j=B+1

2 B

PBj χ j(r k) +... + ∑j=M−B+1

M

PBj χ j(r k )

Page 27: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

(1) Load functions “j” = 1 to B (one each thread) to shared mem.

(2) __syncthreads()

(3) Each thread performs sums from 1 to B.

Repeat (1) to (3) for “j” = B+1 to 2B, 2B+1 to 3B, etc.

∑j=1

B

P1 j χ j(rk ) + ∑j=B+1

2 B

P1 j χ j(r k ) +... + ∑j=M−B+1

M

P1 j χ j(r k)

...

∑j=1

B

P2 j χ j(r k) + ∑j=B+1

2 B

P2 j χ j(rk ) +... + ∑j=M −B+1

M

P2 j χ j(rk )

∑j=1

B

PBj χ j(rk ) + ∑j=B+1

2 B

PBj χ j(r k) +... + ∑j=M−B+1

M

PBj χ j(r k )

Page 28: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∑j=1

B

P1 j χ j(rk ) + ∑j=B+1

2 B

P1 j χ j(r k ) +... + ∑j=M−B+1

M

P1 j χ j(r k)

...

∑j=1

B

P2 j χ j(r k) + ∑j=B+1

2 B

P2 j χ j(rk ) +... + ∑j=M −B+1

M

P2 j χ j(rk )

∑j=1

B

PBj χ j(rk ) + ∑j=B+1

2 B

PBj χ j(r k) +... + ∑j=M−B+1

M

PBj χ j(r k )

{P1 1 P12 ... P1 B

... ... ... ...PB1 PB 2 ... PBB

}

Page 29: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

∑j=1

B

P1 j χ j(rk ) + ∑j=B+1

2 B

P1 j χ j(r k ) +... + ∑j=M−B+1

M

P1 j χ j(r k)

...

∑j=1

B

P2 j χ j(r k) + ∑j=B+1

2 B

P2 j χ j(rk ) +... + ∑j=M −B+1

M

P2 j χ j(rk )

∑j=1

B

PBj χ j(rk ) + ∑j=B+1

2 B

PBj χ j(r k) +... + ∑j=M−B+1

M

PBj χ j(r k )

{P1 1 P12 ... P1 B

... ... ... ...PB1 PB 2 ... PBB

} TEXTURE MEMORY

● 2D access

● Local cache

Page 30: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

GETGLOBAL

VARS∑ =+P11 χ1(r k)

GETGLOBAL

VARS∑ =+P12 χ2(rk ) ...

From a memory intensive kernel...

Page 31: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

GETGLOBAL

VARS∑ =+P11 χ1(r k)

GETGLOBAL

VARS∑ =+P12 χ2(rk ) ...

GETGLOBAL

VARS∑ =+P11 χ1(r k) ... ∑ =+P1 B χB(r k) ...

From a memory intensive kernel...

...to a more arithmetic intensive kernel.

Page 32: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

HARDWARE

GPU: GeForce GTX 780

CPU: Intel i5-3330

Details: M. A. Nitsche, M. Ferreria, E. E. Mocskos, M. C. Gonzalez Lebrero, J. Chem Theory and Comput. 2014, 10, 959–967DOI: 10.1021/ct400308n

CPU GPU CPU GPU CPU GPUHeme Taxol Valinomycin

0

2

4

6

8

10

12

14

Exc

Tim

e (s

)

x7.3

x6.5

x5.7

Test Systems Speedup(1 core)

Heme x 29

Taxol x 26

Valinomycin x 23

( no openMP )

( Estimated time for the 4 core CPU )

Page 33: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

Gaussian functioncentered in atom

Function value is relevant for

this point

Function value is not relevant

for this point

Page 34: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

● Groups solved separately: reduced version of problem.

● Inhomogeneous workload: few groups with a lot of points/functions VS a lot of groups with very few.

● “Small” Group: bad for GPU.

Hybrid Partitioning:Small spheres (lots of points) and big cubes

(fewer points)

GROUPS OF POINTS

Page 35: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

HYBRID SCHEME

Hardware:● Tesla K80 (1 device)● N x Intel Xeon E5-2698 v3

synergistic behavior

Compute the “smallest” groups in the CPU.

Page 36: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

RESULTS FOR THE HYBRID

Hardware Speedup

GeForce GTX 980 vs Intel i5-3450 x 8.0

Tesla K80 vs Xeon E5-2698 x 1.9

Hybrid (K80+8c) vs Xeon E5-2698 x 2.8

XC TERM KERNEL

HYBRID COMPUTING

SCHEME

LimitationsCoulombQM/MM

Page 37: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

CURRENT STATE

XC TERM KERNEL

HYBRID COMPUTING

SCHEME

QM/MMCoulombcuBLAS

Current Limitations● Exc (again!)● Matrix Diag/Dcmp?

Sin

gle

Po

int

Tim

e (s

ec)

Before XC Kernel

After XC Kernel

After: Hybrid, QMMM, Coulomb,

cuBLAS

76 s

20 s

3.3 s

Page 38: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

CURRENT STATE

XC TERM KERNEL

HYBRID COMPUTING

SCHEME

QM/MMCoulombcuBLAS

Current Limitations● Exc (again!)● Matrix Diag/Dcmp?

Sin

gle

Po

int

Tim

e (s

ec)

Before XC Kernel

After XC Kernel

76 s

20 s

3.3 s

Free Energy Calculation

800 – 200 days 30 days

After: Hybrid, QMMM, Coulomb,

cuBLAS

Page 39: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

PROBLEM

● Math expression specific to the physical model.

● Very inhomogeneous workload.

● Memory intensive calculations.

Customized solution with performance comparable to those of problems more naturally suited for GPU.

Distribution of work that takes into account the different

capabilities of CPUs / GPUs

Direct manipulation of registers and memory influences algorithmic structure.

Multiple blocks of threads can run in the same execution unit

Re-organizing work to make it more homogeneous.

Page 40: Molecular dynamics simulations and drug discovery · Molecular dynamics simulations and drug discovery ... the future of computer-aided drug design is promising; molecular dynamics

Thank you for your attention!

And thanks to... THE LIO GROUP- Mariano González Lebrero- Dario Estrin- Damian Scherlis- Esteban Mosckos- Uriel Morzan- William Agudelo- Nicolás Foglia- Fernando Boubetta- Federico Pedron- Manuel Ferreria- Matías Nitsche- Juan Pablo Darago- Chad Hopkins

Collaborators:- Jorge Kohanoff- Cristián G. Sánchez- Ivan Girotto

Institutional Support:- CONICET- UBA- ICTP

Everyone at the group of computer simulation of the DQIAyQF, FCEN, UBA.

visit our code! github.com/nanolebrero/lio