onnxruntime/orttraining/orttraining/python/training
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
..
amp Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
api Python documentation for onnxruntime-training (#15765) 2023-05-02 16:58:16 -07:00
experimental Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
onnxblock Python documentation for onnxruntime-training (#15765) 2023-05-02 16:58:16 -07:00
optim support latest deepspeed version for optim (#15682) 2023-04-25 20:12:23 -07:00
ortmodule Consolidate ORTModule logging (#16078) 2023-06-01 10:09:12 +08:00
torchdynamo Detect fake tensor mode if it has already been created. (#16220) 2023-06-02 23:17:49 -07:00
utils Bump ruff in CI (#15533) 2023-04-17 10:11:44 -07:00
__init__.py Refining the offline tooling for training artifact generation (#15212) 2023-03-30 18:05:51 -07:00
_checkpoint_storage.py Enable pylint and numpy rules (#15218) 2023-03-27 20:37:53 -07:00
_utils.py Introduce float 8 types (#14731) 2023-05-30 13:25:58 -07:00
artifacts.py Python documentation for onnxruntime-training (#15765) 2023-05-02 16:58:16 -07:00
checkpoint.py Bump ruff in CI (#15533) 2023-04-17 10:11:44 -07:00
model_desc_validation.py Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
orttrainer.py Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
orttrainer_options.py Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
postprocess.py Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00