onnxruntime/orttraining
ashari4 18c97381cd
Detect fake tensor mode if it has already been created. (#16220)
### Description
<!-- Describe your changes. -->

Detect fake tensor mode if it has already been created. Follows this
example in pytorch:
86c7652503/torch/_inductor/compile_fx.py (L280)


### Motivation and Context
As of torch nightly 6/2/23, when trying to run a torch dynamo graph on
the ORT backend, we observe

```
E           torch._dynamo.exc.BackendCompilerFailed: backend='compiler_fn' raised:
E           AssertionError: Mixing fake modes NYI
E           
E           
E           You can suppress this exception and fall back to eager by setting:
E               import torch._dynamo
E               torch._dynamo.config.suppress_errors = True
```
The issue is that `ort_backend.py` creates a new fake tensor mode even
though one has already been created by torch.
2023-06-02 23:17:49 -07:00
..
orttraining Detect fake tensor mode if it has already been created. (#16220) 2023-06-02 23:17:49 -07:00
pytorch_frontend_examples Enable pylint and numpy rules (#15218) 2023-03-27 20:37:53 -07:00
tools [ROCm] reduce batch size to fix CI error (#15714) 2023-05-16 13:10:02 +08:00