Cannibalize noarch CI job into crossref CI job

crossref is a new strategy for performing tests when you want
to run a normal PyTorch API call, separately run some variation of
the API call (e.g., same thing but all the arguments are meta tensors)
and then cross-reference the results to see that they are consistent.
Any logic you add to CrossRefMode will get run on *every* PyTorch API
call that is called in the course of PyTorch's test suite.  This can
be a good choice for correctness testing if OpInfo testing is not
exhaustive enough.

For now, the crossref test doesn't do anything except verify that
we can validly push a mode onto the torch function mode stack for all
functions.

Signed-off-by: Edward Z. Yang <ezyangfb.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75988

Approved by: https://github.com/seemethere
This commit is contained in:
Edward Z. Yang
2022-04-19 19:56:43 -07:00
committed by PyTorch MergeBot
parent d9219d2944
commit ee955b8bb9
14 changed files with 59 additions and 29 deletions

View File

@ -42,7 +42,7 @@ except ImportError:
skipIfNoMatplotlib = unittest.skipIf(not TEST_MATPLOTLIB, "no matplotlib")
import torch
from torch.testing._internal.common_utils import TestCase, run_tests, TEST_WITH_ASAN
from torch.testing._internal.common_utils import TestCase, run_tests, TEST_WITH_ASAN, TEST_WITH_CROSSREF
def tensor_N(shape, dtype=float):
numel = np.prod(shape)
@ -54,6 +54,8 @@ class BaseTestCase(TestCase):
def setUp(self):
if not TEST_TENSORBOARD:
return self.skipTest("Skip the test since TensorBoard is not installed")
if TEST_WITH_CROSSREF:
return self.skipTest("Don't run TensorBoard tests with crossref")
self.temp_dirs = []
def createSummaryWriter(self):