Repository: pytorch
Issue: DISABLED test_mnist_exported_with_no_warnings (__main__.TestFxToOnnx)
Labels: module: onnx,triaged,module: flaky-tests,skipped

Platforms: linux

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

Over the past 3 hours, it has been determined flaky in 3 workflow(s) with 3 failures and 3 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_mnist_exported_with_no_warnings`
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 "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/_exporter_legacy.py", line 774, in dynamo_export
    return Exporter(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/_exporter_legacy.py", line 546, in export
    graph_module = self.options.fx_tracer.generate_fx(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py", line 217, in generate_fx
    return self.pre_export_passes(options, model, graph_module, updated_model_args)  # type: ignore[return-value]
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py", line 226, in pre_export_passes
    return _exporter_legacy.common_pre_export_passes(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/_exporter_legacy.py", line 805, in common_pre_export_passes
    module = passes.Decompose(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/diagnostics/infra/decorator.py", line 146, in wrapper
    ctx.log_and_raise_if_error(diag)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/diagnostics/infra/context.py", line 355, in log_and_raise_if_error
    raise diagnostic.source_exception
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/diagnostics/infra/decorator.py", line 130, in wrapper
    return_values = fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/fx/_pass.py", line 275, in run
    module = self._run(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/fx/passes/decomp.py", line 70, in _run
    decomposed_module = proxy_tensor.make_fx(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 2196, in wrapped
    return make_fx_tracer.trace(f, *args)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 2134, in trace
    return self._trace_inner(f, *args)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 2105, in _trace_inner
    t = dispatch_trace(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_compile.py", line 32, in inner
    return disable_fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 744, in _fn
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 1138, in dispatch_trace
    graph = tracer.trace(root, concrete_args)  # type: ignore[arg-type]
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 744, in _fn
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/_symbolic_trace.py", line 843, in trace
    (self.create_arg(fn(*args)),),
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 1193, in wrapped
    out = f(*tensors)
  File "<string>", line 1, in <lambda>
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/fx/passes/_utils.py", line 28, in wrapped
    return torch.fx.Interpreter(graph_module).run(*args)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/interpreter.py", line 167, in run
    self.env[node] = self.run_node(node)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/interpreter.py", line 228, in run_node
    return getattr(self, n.op)(n.target, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/interpreter.py", line 357, in call_module
    return submod(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/_symbolic_trace.py", line 821, in module_call_wrapper
    return self.call_module(mod, forward, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 1045, in call_module
    return forward(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/_symbolic_trace.py", line 814, in forward
    return _orig_module_call(mod, *args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 554, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
    return F.conv2d(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 1241, in __torch_function__
    return func(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/_stats.py", line 21, in wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 1343, in __torch_dispatch__
    return proxy_call(self, func, self.pre_dispatch, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/fx/experimental/proxy_tensor.py", line 912, in proxy_call
    out = func(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_ops.py", line 723, in __call__
    return self._op(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/_stats.py", line 21, in wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1270, in __torch_dispatch__
    return self.dispatch(func, types, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1810, in dispatch
    return self._cached_dispatch_impl(func, types, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1380, in _cached_dispatch_impl
    output = self._dispatch_impl(func, types, args, kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 2348, in _dispatch_impl
    op_impl_out = op_impl(self, func, *args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_impls.py", line 160, in dispatch_to_op_implementations_dict
    return op_implementations_dict[func](fake_mode, func, *args, **kwargs)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/_subclasses/fake_impls.py", line 743, in conv
    conv_backend = torch._C._select_conv_backend(**kwargs)
RuntimeError: expected stride to be a single integer value or a list of -1 values to match the convolution dimensions, but got stride=[1, 1]

While executing %tensor_x : [num_users=1] = call_module[target=L__self___conv1](args = (%l_tensor_x_,), kwargs = {})
Original traceback:
  File "/var/lib/jenkins/workspace/test/onnx/test_fx_to_onnx.py", line 69, in forward
    tensor_x = self.conv1(tensor_x)


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/onnx/test_fx_to_onnx.py", line 82, in test_mnist_exported_with_no_warnings
    onnx_program = dynamo_export(MNISTModel(), tensor_x)
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/__init__.py", line 525, in dynamo_export
    return dynamo_export(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/onnx/_internal/_exporter_legacy.py", line 790, in dynamo_export
    raise errors.OnnxExporterError(message) from e
torch.onnx.OnnxExporterError: Failed to export the model to ONNX. Generating SARIF report at 'report_dynamo_export.sarif'. SARIF is a standard format for the output of static analysis tools. SARIF logs can be loaded in VS Code SARIF viewer extension, or SARIF web viewer (https://microsoft.github.io/sarif-web-component/). Please report a bug on PyTorch Github: https://github.com/pytorch/pytorch/issues

To execute this test, run the following from the base repo dir:
    python test/onnx/test_fx_to_onnx.py TestFxToOnnx.test_mnist_exported_with_no_warnings

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

</details>


Test file path: `onnx/test_fx_to_onnx.py`

cc @clee2000 @wdvr