-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Test suite should test implementations #6135
Copy link
Copy link
Open
Labels
module: testsIssues related to tests (not the torch.testing module)Issues related to tests (not the torch.testing module)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
module: testsIssues related to tests (not the torch.testing module)Issues related to tests (not the torch.testing module)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
This issue was prompted by #6132. To explain the situation, let us consider the situation of convolution.
Today, we have a number of tests for convolution. The majority of these tests go through the "official" convolution interface, which is what all of our users use. However, inside the implementation of convolution, there are a large number of if-statements which specify which particular implementation we use, depending on some settings. This too, is also a good idea, because we want our users to get the best kernels without thinking about it.
However, when it comes time to test these kernels, we now have some very ugly code:
Essentially, we need to indirectly force the dispatch code one way or another, to make sure we test all of the actual kernel implementations. This makes it very easy to miss test configurations where you (a) forget to toggle between implementations or (b) the toggling code is wrong and you're not exercising a codepath that you actually wanted to test.
The basic situation is that there are two orthogonal things we want to test:
The current test suite conflates the two. It would be good if it did not.