Skip to content

Commit

Permalink
mx cleanup [1/x]: unbreak mx_formats tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vkuzo committed Jan 21, 2025
1 parent 32d9b0b commit ec31377
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/prototype/mx_formats/test_mx_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
pytest.skip("Unsupported PyTorch version", allow_module_level=True)


# source: https://stackoverflow.com/a/22638709
@pytest.fixture(autouse=True)
def run_around_tests():
# 1. before test - set up (currently do nothing)
# 2. run test
yield
# 3. after test - teardown
torch._dynamo.reset()


@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA not available")
@pytest.mark.parametrize("elem_dtype", SUPPORTED_ELEM_DTYPES)
@pytest.mark.parametrize("bias", [True, False])
Expand Down

0 comments on commit ec31377

Please sign in to comment.