From 80a3877b3de8d05f3a9b11c648d312ae90c2075c Mon Sep 17 00:00:00 2001 From: Sam Larsen Date: Mon, 21 Apr 2025 11:51:30 -0700 Subject: [PATCH] [easy] Fix test_dynamo_timed (#151816) Summary: The structured logging counter is a global that might have been affected by earlier tests. Clear it explicitly. Fixes #148093 Test Plan: `pytest test/dynamo/test_utils.py` Pull Request resolved: https://github.com/pytorch/pytorch/pull/151816 Approved by: https://github.com/ppanchalia --- test/dynamo/test_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/dynamo/test_utils.py b/test/dynamo/test_utils.py index 7b5e725ae94..a7413b02e7e 100644 --- a/test/dynamo/test_utils.py +++ b/test/dynamo/test_utils.py @@ -174,6 +174,7 @@ class TestDynamoTimed(TestCase): add(torch.rand([10]), torch.rand([10])) utils.reset_frame_count() + torch._logging._internal.structured_logging_overhead.clear() @dynamo_config.patch( {