Skip to content

Commit 3323b03

Browse files
author
Joseph Suarez
committed
Enable profiling
1 parent 1267d52 commit 3323b03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pufferlib/pufferl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ def __call__(self, name, epoch, nest=False):
734734
if (epoch + 1) % self.frequency != 0:
735735
return
736736

737-
#if torch.cuda.is_available():
738-
# torch.cuda.synchronize()
737+
if torch.cuda.is_available():
738+
torch.cuda.synchronize()
739739

740740
tick = time.time()
741741
if len(self.stack) != 0 and not nest:
@@ -752,8 +752,8 @@ def pop(self, end):
752752
profile['elapsed'] += delta * self.frequency
753753

754754
def end(self):
755-
#if torch.cuda.is_available():
756-
# torch.cuda.synchronize()
755+
if torch.cuda.is_available():
756+
torch.cuda.synchronize()
757757

758758
end = time.time()
759759
for i in range(len(self.stack)):

0 commit comments

Comments
 (0)