Repository: pytorch
Issue: `test_variant_consistency_jit_contiguous_cpu_float32` from `test_ops` fails
Labels: oncall: jit

## 🐛 Bug

When running the full PyTorch test suite, this tests fails

```
======================================================================
FAIL: test_variant_consistency_jit_contiguous_cpu_float32 (__main__.TestJitCPU)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/casparl/eb_tmp/eb-zicdqucj/tmp5xk49djn/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 368, in instantiated_test
    result = test(self, **param_kwargs)
  File "/tmp/casparl/eb_tmp/eb-zicdqucj/tmp5xk49djn/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 734, in test_wrapper
    return test(*args, **kwargs)
  File "/tmp/casparl/eb_build/PyTorch/1.10.0/foss-2021a-CUDA-11.3.1/pytorch/test/test_ops.py", line 813, in test_variant_consistency_jit
    self.assertAutodiffNode(traced_fn.last_graph, op.assert_autodiffed, nonfusible_nodes, fusible_nodes)
  File "/tmp/casparl/eb_tmp/eb-zicdqucj/tmp5xk49djn/lib/python3.9/site-packages/torch/testing/_internal/common_jit.py", line 281, in assertAutodiffNode
    self.assertEqual(should_autodiff_node,
  File "/tmp/casparl/eb_tmp/eb-zicdqucj/tmp5xk49djn/lib/python3.9/site-packages/torch/testing/_internal/common_utils.py", line 1948, in assertEqual
    super().assertTrue(x == y, msg=msg)
AssertionError: False is not true :
Failure in testing nodes' autodifferentiation. One or more nodes were not expected to be autodiffed but were found in a DifferentiableGraph or in a FusionGroup of a DifferentiableGraph. Did you intend for these nodes to be autodiffed? If so, change this test to expect autodifferentiation.
Specifically:
  ['aten::contiguous', 'aten::contiguous'] were not expected to be in one of the DifferentiableGraphs but were.
```

However, when I run the same tests _seperately_, it succeeds succesfully:

```
python -m unittest test_ops.TestJitCPU.test_variant_consistency_jit_contiguous_cpu_float32 -v
test_variant_consistency_jit_contiguous_cpu_float32 (test_ops.TestJitCPU) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.144s

OK
```

I will just skip the test for now, but I figured it would be good for the PyTorch team to know.

I don't really understand _why_ it fails when run as part of the test suite, and not when its run as an individual test, but my guess would be that maybe some environment from one of the previous tests leaks into this test when running it as part of the full test suite.


## To Reproduce

Steps to reproduce the behavior:

1. Build PyTorch 1.10.0 from sources
1. Run the full test suite `python run_test.py`
1. Run the individual test using `python -m unittest test_ops.TestJitCPU.test_variant_consistency_jit_contiguous_cpu_float32 -v`

## Expected behavior

I expect the test to pass (and at least to pass consistently, regardless of whether it is run from the full test suite or as individual test)

## Environment

 - PyTorch Version (e.g., 1.0): 1.10.0
 - OS (e.g., Linux): CentOS 8
 - How you installed PyTorch (`conda`, `pip`, source): source
 - Build command you used (if compiling from source):
```
USE_CUPTI_SO=1 PYTORCH_BUILD_VERSION=1.10.0 PYTORCH_BUILD_NUMBER=1 MAX_JOBS=72 BLAS=Eigen WITH_BLAS=open USE_FFMPEG=1 BUILD_CUSTOM_PROTOBUF=0 USE_IBVERBS=1 USE_CUDA=1 CUDNN_LIB_DIR=/tmp/sw_stack_gpu/software/cuDNN/8.2.1.32-CUDA-11.3.1/lib64 CUDNN_INCLUDE_DIR=/tmp/sw_stack_gpu/software/cuDNN/8.2.1.32-CUDA-11.3.1/include USE_SYSTEM_NCCL=1 NCCL_INCLUDE_DIR=/tmp/sw_stack_gpu/software/NCCL/2.10.3-GCCcore-10.3.0-CUDA-11.3.1/include USE_METAL=0   /tmp/sw_stack_gpu/software/Python/3.9.5-GCCcore-10.3.0/bin/python setup.py build
```
 - Python version: 3.9.5
 - CUDA/cuDNN version: CUDA 11.3.1, cuDNN 8.2.1.32
 - GPU models and configuration: N/A
 - Any other relevant information: N/A

## Additional context

I'm happy just skipping the test since I see it succeeded when run as an individual test, but I can imagine the PyTorch team might want to investigate further