Skip to content

Commit

Permalink
Make compile count in Dynamo test more general (#6802)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCaoG authored Mar 22, 2024
1 parent f43ac41 commit 2e5c3b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/dynamo/test_dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,10 @@ def test_resnet18(self):
# Graph 5: sync input for backward (TODO(JackCaoG) understand why there are two graphs)
# Graph 6, 7: PyTorch has updated the number of captured by resnet
# (https://github.com/pytorch/pytorch/pull/117434)
self.assertEqual(met.metric_data('CompileTime')[0], 7)
self.assertLessEqual(met.metric_data('CompileTime')[0], 7)
# We execute 4 graphs per step (+ 1 for SGD) when optimizer is enabled.
self.assertEqual(met.metric_data('ExecuteTime')[0], sample_count * 4 + 1)
self.assertLessEqual(
met.metric_data('ExecuteTime')[0], sample_count * 4 + 1)
# one for each forward, backward and optimizer
self.assertEqual(
met.metric_data('RunCachedGraphInputData')[0], sample_count * 3)
Expand Down
1 change: 1 addition & 0 deletions torch_patches/.torch_pin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#122349

0 comments on commit 2e5c3b6

Please sign in to comment.