-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* nvidia profiling for md * 1 model
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |