Skip to content

Commit

Permalink
nvidia profiling for md (#411)
Browse files Browse the repository at this point in the history
* nvidia profiling for md

* 1 model
  • Loading branch information
zasdfgbnm committed Jan 30, 2020
1 parent 2de2ecb commit 0731668
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tools/md-benchmark-nsys-profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import ase
import ase.io
import ase.md
import argparse
import torchani
import autonvtx
import torch

parser = argparse.ArgumentParser()
parser.add_argument('filename', help="file for the molecule")
args = parser.parse_args()

molecule = ase.io.read(args.filename)
model = torchani.models.ANI1x()[0].cuda()
calculator = model.ase()
molecule.set_calculator(calculator)
dyn = ase.md.verlet.VelocityVerlet(molecule, timestep=1 * ase.units.fs)

dyn.run(1000) # warm up

torch.cuda.cudart().cudaProfilerStart()
autonvtx(model)
with torch.autograd.profiler.emit_nvtx(record_shapes=True):
dyn.run(10)

0 comments on commit 0731668

Please sign in to comment.