Advancements in a GPU Monte Carlo simulator for radiotherapy
2016 GPU Technology Conference Shogo Okada <shogo@post.kek.jp> Koichi Murakami <koichi.murakami@kek.jp> Nick Henderson <nwh@stanford.edu> (speaking)
Advancements in a GPU Monte Carlo simulator for radiotherapy 2016 - - PowerPoint PPT Presentation
Advancements in a GPU Monte Carlo simulator for radiotherapy 2016 GPU Technology Conference Shogo Okada <shogo@post.kek.jp> Koichi Murakami <koichi.murakami@kek.jp> Nick Henderson <nwh@stanford.edu> (speaking)
2016 GPU Technology Conference Shogo Okada <shogo@post.kek.jp> Koichi Murakami <koichi.murakami@kek.jp> Nick Henderson <nwh@stanford.edu> (speaking)
Institute of Technology
Stanford
(~ x, ~ p, k) k ∈ {γ, e−, e+, . . . }
Goal: record energy deposited in material
traveling through matter
geometries, and materials
areas
ATLAS LISA gMocren
modularization and separation of conerns
simulation of X-ray radiotherapy
in medical physics for X-ray therapy
stacks
atomicAdd)
Verification for Dose Distribution
z y density water 1.0 g/cm3 lung 0.26 g/cm3 bone 1.85 g/cm3 air 0.0012 g/cm3
(1) water (2) lung (3) bone air source Beam particle and its initial kinetic energy:
Dose Distribution of slab phantoms
Comparison of depth dose for γ 6MV
− G4 v9.6.3 − G4CU
(1) water
(2) lung (3) bone
5 10 15 20 25 30dose (Gy)
0.05 0.1 0.15 0.2 0.25 0.3G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.1 0.15 0.2 0.25 0.3G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.01 0.02 0.03 0.04 0.05 0.06 0.07G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
lung bone
Comparison of depth dose for γ 18MV
− G4 v9.6.3 − G4CU
(1) water
(2) lung (3) bone
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
lung bone
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
5 10 15 20 25 30
dose (Gy)
0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18G4 G4CU
depth dose distribution
depth (cm)
5 10 15 20 25 30residual
Comparison of depth dose for e- 20MeV
− G4 v9.6.3 − G4CU
(1) water
(2) lung (3) bone
depth (cm) 5 10 15 20 25 30 dose (Gy)log scale
depth (cm) 5 10 15 20 25 30 dose (Gy)log scale log scale lung bone
Computation Time Performance
γ beam with 6MV γ beam with 18MV (1) water (2) lung (3) bone (1) water (2) lung (3) bone G4 [msec/particle] 0.780 0.822 0.819 0.803 0.857 0.924 G4CU [msec/particle] 0.00336 0.00331 0.00341 0.00433 0.00425 0.00443 × speedup factor ( = G4 / G4CU ) 232 248 240 185 201 208
GPU:
CPU:
e- beam with 20MeV (1) water (2) lung (3) bone G4 [msec/particle] 1.84 1.87 1.65 G4CU [msec/particle] 0.00881 0.00958 0.00885 × speedup factor ( = G4 / G4CU ) 208 195 193
185~250 times speedup against single-core G4 simulation!!
particle simulation (Microdosimetry simulation)
http://geant4-dna.org
Chromatine fiber (constituent of chromosomes) EM shower in DNA ∅ 10 nm
including radical, ions, … Diffusion and reactions for chemical species
exposure
Medical diagnosis Airline crew Space missions Radiation therapy
Particles Electrons Protons Hydrogen atoms Helium atoms (He++, He+, He0) Elastic scattering
9 eV - 10 keV Uehara 10 keV - 1 MeV Champion 100 eV - 1 MeV Hoang 100 eV - 10 MeV Hoang
Excitation
10 eV - 10 keV Emfietzoglou 10 keV - 1 MeV Born 10 eV - 500 keV Miller Green 500 keV - 100 MeV Born 10 eV - 500 keV Miller Green 1 keV - 400 MeV Miller Green
Charge change
— 100 eV - 10 MeV Dingfelder 100 eV - 10 MeV Dingfelder 1 keV - 400 MeV Dingfelder
Ionization
10 eV - 10 keV Emfietzoglou 10 keV - 1 MeV Born 100 eV - 500 keV Rudd 500 keV - 100 MeV Born 100 eV - 100 MeV Rudd 1 keV - 400 MeV Rudd
Vibrational excitation
2 - 100 eV Michaud et al. — — —
Disociative attachment
4 - 13 eV Melton — — —
Physics Processes E1 E2
p e- H atom -> p
ΔE
p e-
((( (((
AB + e- -> AB- -> A + B-
The difference in energy loss process (EM vs DNA)
Standard EM Physics
step with the Bethe-Bloch formula
is above threshold DNA physics
ionization and excitation processes
threshold
secondary particles
particles
Bethe-Bloch formula
−dE dx = Kz2 Z A 1 β2 1 2 ln 2mec2β2γ2Tmax I2 − β2 − δ 2
ΔE2 ΔE3
Δx1 Δx2 Δx3 Δx4
ΔE4 ΔE1 ΔE3 ΔE2 i
i z a t i
e x c i t a t i
ΔE4 ΔE5 ΔE6
DNA Physics Standard EM Physics
temporally and wait until threads are available
… CUDA Threads Stacks
32 threads
… Warp #0 1 2 3 4 5 6 … 30 H 31 p e- H e- e- e- H … H e-
32 threads
… Warp #1 32 33 34 35 36 37 38 … 62 63 p H e- e- H p … Thread#
…
Event #0 Event #1
…
Electronic state Process Decay channel Fraction (%) Ionization state Dissociative decay H3O+ + •OH 100 Excitation state: A1B1 Dissociative decay
65 Relaxation H2O + ΔE 35 Excitation state: B1A1 Auto-ionization H3O+ + •OH + e-aq 55 Dissociative decay
15 Relaxation H2O + ΔE 30 Excitation state: Rydberg, diffusion bands Auto-ionization H3O+ + •OH + e-aq 50 Relaxation H2O + ΔE 50
ref.) Radiat Environ Biophys (2009) 48: 11- 20
(H2O
+, H2O*, e
+ dissociates. H2O* dissociates or releases energy into water.
The strategy for chemical simulation
(1)Calculate intermolecular distance (d) for all pairs
make reactions (2)Find minimum distance within pairs and calculate time step (3)Diffuse molecules (4)Loop (1) ~ (3) until time reaches 1 µs
58
dC"known uw ?
Compute "ΔS^ã8
ΔxC"known uw =ΔS^ã8
If ΔS^ã8 < ΔSªÑ^
ΔxC"known uw =ΔSªÑ^
If dC < !C Make reaction Check reactivity via Brownian bridge Can3react Can not3react Diffusion
R = k 4πNAD
Smoluchowski model
Species Diffusion coefficient (×10-9 m2/s) H3O+ 9.0 H• 7.0 OH- 5.0 e-aq 4.9 H2 4.8
2.8 H2O2 2.3 Reaction Reaction rate (×1010 M-1s-1) 2e-aq + 2H2O -> H2+ 2OH- 0.50 e-aq + •OH -> OH- 2.95 e-aq + H• + H2O -> OH- + H2 2.65 e-aq + H3O+ -> H• + H2O 2.11 e-aq + H2O2 -> OH- + •OH 1.44
0.44
1.44 H• + H• -> H2 1.20 H3O+ + OH- -> 2H2O 1.43
ref.) Radiat Environ Biophys (2009) 48: 11- 20
Process time for calculating intermolecular distance for all possible pairs increases by O(N^2/2) -> Need longer time
# of molecules 500 1000 1500 2000 2500 3000 # of events 1 10
210
310
410
h_nmol Entries 90000 Mean 125 Std Dev 151
# of molecules generated within 1 ps (e- 750 keV, 90,000 events)
for reducing simulation time. But we don’t know
tail events mean: 125
d d < R ? No Yes Interaction Diffusion
for all pairs, make reactions, compute time step, and transport molecules
MPEXS-DNA Physics and Chemical Simulation
evt#1 evt#2 evt#3 evt#4 evt#5 evt#N
Particle Stacks Molecule Stacks … … CUDA threads (32 threads) … CUDA threads (3.2k threads) …
time_step_k<<<nblock,nthread>>>() brownian_transport_k<<<nblock,nthread>>>() brownian_bridge_k<<<nblock,nthread>>>()
Physics Phase Chemical Phase
e-
voxelized water phantom score energy deposition in each voxel
incident particle initial energy phantom size # of voxel cells (voxel size) e- 100 keV 102 x 102 x 100 um 51 x 51 x 50 (2 x 2 x 2 um) p 1 MeV 25.5 x 25.5 x 25 um 51 x 51 x 50 (0.5 x 0.5 x 0.5 um) He++ 1 MeV 10.2 x 10.2 x 10 um 51 x 51 x 50 (0.2 x 0.2 x 0.2 um)
Simulation model Depth dose curves (CPU vs GPU)
z-direction (um) 10 20 30 40 50 60 70 80 90 100 Dose (Gy) 1 10
2
10
depth dose distribution
z-direction (um) 1 2 3 4 5 6 7 8 9 10 Dose (Gy) 500 1000 1500 2000 2500 3000 3500 4000
3
10 ×
depth dose distribution
z-direction (um) 5 10 15 20 25 Dose (Gy) 200 400 600 800 1000 1200
3
10 ×
depth dose distribution
p 1 MeV He++ 1 MeV e- 100 keV
— CPU — GPU — CPU — GPU — CPU — GPU
Incident particle Initial energy MPEXS-DNA Geant4-DNA speedup factor (=G4/MPEXS Total thread numbers (Nblk x Nthr/blk) Process time (sec/particle) Process time (sec/particle) DNA Physics e- 100 keV 524,288 (4,096 x 128) 3.53 x 10-3 0.764
277
p 1 MeV 524,288 (4,096 x 128) 5.97 x 10-2 11.8
265
He++ 1 MeV 524,288 (4,096 x 128) 6.10 x 10-2 12.3
269
Standard EM Physics e- 20 MeV 524,288 (4,096 x 128) 8.81 x 10-6 1.84 x 10-3
208
Computing Performance including physical phase (Geant4-DNA vs MPEXS-DNA)
e- 10 keV e- 750 keV p 20 MeV Water phantom size 1 x 1 x 1 um 5 x 5 x 5 um 1 x 1 x 1 um Average # of molecules generated at 1 ps 419 125 366 Process time (Geant4-DNA) 34.6 sec / event 4.99 sec / event 27.5 sec / event Process time (MPEXS-DNA) 0.201 sec / event 0.0343 sec / event 0.129 sec / event Speedup factor
172x 146x 213x
at DNA scale
simulations
2.6 GHz)
GeForce GT 750M)
single core of CPU and 1M events on GPU.
dosimetry based on Geant4. <https://dx.doi.org/10.1051/snamc/201404204>
<https://dx.doi.org/10.1109/NSSMIC.2013.6829452>
DNA levels. <https://dx.doi.org/10.1007/978-3-319-23024-5_29>
<https://dx.doi.org/10.1016/S0168-9002(03)01368-8>
Geant4-DNA very low energy extension of the Geant4 Monte Carlo simulation