Skip to content

Commit 2a7b4af

Browse files
committed
mx cleanup [1/x]: unbreak mx_formats tests
Summary: There tests are: 1. not all passing locally, due to excessive recompiles 2. mostly not running in CI (case by case) This PR fixes (1). A future PR will improve on (2). Test Plan: ``` pytest test/prototype/mx_formats/ -s -x ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: d338c4724d0b49269f1d198db3b3b7d43fbfa8e8 ghstack-comment-id: 2593881934 Pull Request resolved: #1569
1 parent 32d9b0b commit 2a7b4af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/prototype/mx_formats/test_mx_linear.py

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
pytest.skip("Unsupported PyTorch version", allow_module_level=True)
2727

2828

29+
# source: https://stackoverflow.com/a/22638709
30+
@pytest.fixture(autouse=True)
31+
def run_around_tests():
32+
# 1. before test - set up (currently do nothing)
33+
# 2. run test
34+
yield
35+
# 3. after test - teardown
36+
torch._dynamo.reset()
37+
38+
2939
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA not available")
3040
@pytest.mark.parametrize("elem_dtype", SUPPORTED_ELEM_DTYPES)
3141
@pytest.mark.parametrize("bias", [True, False])

0 commit comments

Comments
 (0)