Skip to content

Commit

Permalink
added profiling simple
Browse files Browse the repository at this point in the history
  • Loading branch information
Varun Ananth committed Sep 10, 2023
1 parent 1adce56 commit 3118d9b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions casanovo/denovo/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from ..denovo.model import Spec2Pep
from ..denovo.model import DBSpec2Pep

from pytorch_lightning.profiler import SimpleProfiler


logger = logging.getLogger("casanovo")

Expand Down Expand Up @@ -389,6 +391,12 @@ def db_search(
loaders.setup(stage="test")

# Create the Trainer object.
abs_experiment_dirpath = "/net/noble/vol2/home/vananth3/2023_vananth_denovo-dbsearch/results/2023-08-21_speedup"
profiler = SimpleProfiler(
dirpath=abs_experiment_dirpath,
filename="casanovo_plasmodium_vanilla",
extended=True,
)
trainer = pl.Trainer(
accelerator="auto",
auto_select_gpus=True,
Expand All @@ -397,6 +405,7 @@ def db_search(
max_epochs=config["max_epochs"],
num_sanity_val_steps=config["num_sanity_val_steps"],
strategy=_get_strategy(),
profiler=profiler,
)
# Run the model
trainer.predict(model, loaders.db_dataloader())
Expand Down

0 comments on commit 3118d9b

Please sign in to comment.