Repository: pytorch
Issue: DISABLED test_aot_export_with_torch_cond (__main__.TestAOTExport)
Labels: triaged,module: flaky-tests,skipped,oncall: pt2,module: higher order operators,module: pt2-dispatcher

Platforms: asan, linux, mac, macos, rocm, slow



This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_aot_export_with_torch_cond&suite=TestAOTExport&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/32636076771).

Over the past 3 hours, it has been determined flaky in 15 workflow(s) with 30 failures and 15 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_aot_export_with_torch_cond`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/functorch/test_aotdispatch.py", line 4906, in test_aot_export_with_torch_cond
    self.assertExpectedInline(
  File "/opt/conda/envs/py_3.11/lib/python3.11/site-packages/torch/testing/_internal/common_utils.py", line 3003, in assertExpectedInline
    return super().assertExpectedInline(actual if isinstance(actual, str) else str(actual), expect, skip + 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.11/lib/python3.11/site-packages/expecttest/__init__.py", line 351, in assertExpectedInline
    assert_expected_inline(
  File "/opt/conda/envs/py_3.11/lib/python3.11/site-packages/expecttest/__init__.py", line 316, in assert_expected_inline
    assert_eq(expect, actual, msg=help_text)
  File "/opt/conda/envs/py_3.11/lib/python3.11/site-packages/expecttest/__init__.py", line 388, in assertMultiLineEqualMaybeCppStack
    self.assertMultiLineEqual(expect, actual, *args, **kwargs)
  File "/opt/conda/envs/py_3.11/lib/python3.11/unittest/case.py", line 1253, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
  File "/opt/conda/envs/py_3.11/lib/python3.11/unittest/case.py", line 703, in fail
    raise self.failureException(msg)
AssertionError: 'def [284 chars]rg0_1]);  gt = true_graph_0 = false_graph_0 = [188 chars]d_1)' != 'def [284 chars]rg0_1, 3, 4]);  gt = true_graph_0 = false_grap[194 chars]d_1)'
  def forward(self, arg0_1):
      sum_1 = torch.ops.aten.sum.default(arg0_1)
      gt = torch.ops.aten.gt.Scalar(sum_1, 4);  sum_1 = None
      true_graph_0 = self.true_graph_0
      false_graph_0 = self.false_graph_0
-     cond = torch.ops.higher_order.cond(gt, true_graph_0, false_graph_0, [arg0_1]);  gt = true_graph_0 = false_graph_0 = arg0_1 = None
+     cond = torch.ops.higher_order.cond(gt, true_graph_0, false_graph_0, [arg0_1, 3, 4]);  gt = true_graph_0 = false_graph_0 = arg0_1 = None
?                                                                                ++++++
      getitem = cond[0];  cond = None
      add = torch.ops.aten.add.Tensor(getitem, 3)
      add_1 = torch.ops.aten.add.Tensor(getitem, 4);  getitem = None
      return (add, add_1) : To accept the new output, re-run test with envvar EXPECTTEST_ACCEPT=1 (we recommend staging/committing your changes before doing this)

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_CROSSREF=1 python test/functorch/test_aotdispatch.py TestAOTExport.test_aot_export_with_torch_cond

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `functorch/test_aotdispatch.py`

cc @clee2000 @ezyang @chauhang @penguinwu @zou3519 @ydwu4 @bdhirsh @yf225