From 9110c76e3da02197206c4eb04f2654b1f3ac0650 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Wed, 20 Nov 2024 13:01:16 -0800 Subject: [PATCH] Clear out Dynamo cache in between tests Summary: This issue was discovered when we tried to land https://www.internalfb.com/diff/D66189091. There is nothing wrong with D66189091, it just changes the way Dynamo invalidates its cache entry. However, it upsets these tests because they unintentionally rely on the Dynamo old behavior of invalidting cache entries. Reviewed By: kimishpatel Differential Revision: D66255174 --- backends/xnnpack/test/ops/linear.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/xnnpack/test/ops/linear.py b/backends/xnnpack/test/ops/linear.py index de84f8e41ab..cc96bd53da8 100644 --- a/backends/xnnpack/test/ops/linear.py +++ b/backends/xnnpack/test/ops/linear.py @@ -497,6 +497,7 @@ def _test_linear( which ares then transformed into aten.linear.default by the ConvertToLinear pass. """ for i, _ in enumerate(in_sizes): + torch._dynamo.reset() in_size = int(in_sizes[i]) input_size = int(input_sizes[i]) output_size = int(output_sizes[i])