From 2e5c3b64ce0b3decc032db967945480d5bf5f49e Mon Sep 17 00:00:00 2001 From: JackCaoG <59073027+JackCaoG@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:08:32 -0700 Subject: [PATCH] Make compile count in Dynamo test more general (#6802) --- test/dynamo/test_dynamo.py | 5 +++-- torch_patches/.torch_pin | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 torch_patches/.torch_pin diff --git a/test/dynamo/test_dynamo.py b/test/dynamo/test_dynamo.py index 76bddba7b2d..78d192996ee 100644 --- a/test/dynamo/test_dynamo.py +++ b/test/dynamo/test_dynamo.py @@ -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) diff --git a/torch_patches/.torch_pin b/torch_patches/.torch_pin new file mode 100644 index 00000000000..020003647c8 --- /dev/null +++ b/torch_patches/.torch_pin @@ -0,0 +1 @@ +#122349