Fast patient-specific blood flow modelling on GPUs Dr. Gábor Závodszky Budapest University of Technology and Economics Department of Hydrodynamic Systems 21 May, 2015. HDR
Introduction - Cerebral aneurysms Treatment methods Coiling Flow diverting Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 1/22 • Clipping 1 / 22
Introduction - Cerebral aneurysms Treatment methods Flow diverting Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 1/22 • Clipping • Coiling 1 / 22
Introduction - Cerebral aneurysms Treatment methods Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 1/22 • Clipping • Coiling • Flow diverting 1 / 22
Simulation toolsuite overview Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 2/22 2 / 22
CFD simulation Boltzmann method. numerical scheme. linear. local. Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 3/22 • Based on the lattice • Highly parallel, explicit • Non-local steps are • Non-linear steps are 3 / 22
Calculation of derived quantities - PostProcess particles by tracing. Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 4/22 • Residence times for • Surface normals. • Wall Shear Stress. 4 / 22
Virtual stenting computed on the GPU modelled as a porous layer in the CFD step. Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 5/22 • Mass-Spring-Damper • The dynamics is • The resulting surface is 5 / 22
CFD - in more details Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 6/22 6 / 22
CFD - in more details II. Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 7/22 7 / 22
CFD - Python, Sailfish Technologies (Python) (Mako) (Sympy) pyCUDA, pyOpenCL Sailfish: Metaprogramming on GPUs! https://github.com/sailfish-team/sailfish Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 8/22 • 8 / 22
CFD - Python, Sailfish Technologies (Python) (Mako) (Sympy) pyCUDA, pyOpenCL Sailfish: Metaprogramming on GPUs! https://github.com/sailfish-team/sailfish Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 8/22 • • 8 / 22
CFD - Python, Sailfish Technologies (Python) (Mako) (Sympy) pyCUDA, pyOpenCL Sailfish: Metaprogramming on GPUs! https://github.com/sailfish-team/sailfish Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 8/22 • • • 8 / 22
CFD - Python, Sailfish Technologies (Python) (Mako) (Sympy) Sailfish: Metaprogramming on GPUs! https://github.com/sailfish-team/sailfish Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 8/22 • • • • pyCUDA, pyOpenCL 8 / 22
CFD - Python, Sailfish Technologies (Python) (Mako) (Sympy) https://github.com/sailfish-team/sailfish Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 8/22 • • • • pyCUDA, pyOpenCL • Sailfish: Metaprogramming on GPUs! 8 / 22
Bounce-back rule Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 9/22 • No-slip wall boundary 9 / 22
Bounce-back rule - Template Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 10/22 10 / 22
Bounce-back rule - D2Q9 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 11/22 11 / 22
Bounce-back rule - D2Q13 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 12/22 12 / 22
Can we take it further? Symbolic algebra! Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 13/22 13 / 22
Equilibrium function - Symbolic formalism Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 14/22 f eq u ) + 9 u ) 2 − 3 i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ 2 ( ⃗ u 2 ] e i · ⃗ e i · ⃗ 2 ⃗ 14 / 22
Equilibrium function - D3Q13 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 15/22 f eq u ) + 9 u ) 2 − 3 u 2 ] i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ e i · ⃗ 2 ( ⃗ e i · ⃗ 2 ⃗ 15 / 22
Equilibrium function - D3Q13 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 16/22 f eq u ) + 9 u ) 2 − 3 u 2 ] i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ e i · ⃗ 2 ( ⃗ e i · ⃗ 2 ⃗ 16 / 22
Equilibrium function - D3Q13 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 17/22 f eq u ) + 9 u ) 2 − 3 i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ 2 ( ⃗ u 2 ] e i · ⃗ e i · ⃗ 2 ⃗ 17 / 22
Equilibrium function - D3Q13 Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 18/22 f eq u ) + 9 u ) 2 − 3 i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ 2 ( ⃗ u 2 ] e i · ⃗ e i · ⃗ 2 ⃗ 18 / 22
Equilibrium function - D3Q13 The generated code: Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 19/22 f eq u ) + 9 u ) 2 − 3 i ( ⃗ x, t ) = w i ρ [1 + 3( ⃗ 2 ( ⃗ u 2 ] e i · ⃗ e i · ⃗ 2 ⃗ 19 / 22
Advantages overhead). Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 20/22 • Closer to the mathematical formalism. • Easier to read and modify. • Encourages experimentation. • Virtually no performance cost (apart from a small start-up 20 / 22
Scaling - CPU vs. GPU order of magnitude performance gain. point is due to primitive space partition). Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 21/22 • CPU - 768 cores • GPU - 4 Tesla 2070 • Near-linear scaling • Approximately one • (The fallback at the third 21 / 22
Typical runtimes 3 22/22 Fast patient-specific blood flow modelling on GPUs Dr. Gábor Závodszky 01:34: 22 00:15:01 00:05:03 4 - 00:18:31 00:06:21 - Number of GPUs 00:27:03 00:09:11 2 - 00:45:14 00:15:36 1 ∼ 3 M ∼ 6 M ∼ 20 M 22 / 22
Thank you for your attention! Dr. Gábor Závodszky Fast patient-specific blood flow modelling on GPUs 23/22 23 / 22
Recommend
More recommend