onnxruntime/orttraining/orttraining/python/training
Wei-Sheng Chin b71ebf91a5
[DORT] Reduce global configs to make enabling dynamic shape easier (#16720)
There are several global configs used by DORT.
```py
DEFAULT_ONNX_EXPORTER_OPTIONS = torch.onnx._internal.exporter.ResolvedExportOptions(
    torch.onnx._internal.exporter.ExportOptions()
)

# TODO(wechi): This line must generate result identical to the call of
# _create_onnx_supports_op_overload_table(...) inside
# create_onnx_friendly_decomposition_table(...) in
# torch/onnx/_internal/fx/decomposition_table.py.
_SUPPORT_DICT = torch.onnx._internal.fx.decomposition_table._create_onnx_supports_op_overload_table(
    DEFAULT_ONNX_EXPORTER_OPTIONS.onnx_registry
)  # type: ignore

_EXTRA_SUPPORT_DICT: Dict[str, Any] = {
    "getattr": None,
    "_operator.getitem": None,
}

DORT_DECOMPOSITION_TABLE = DEFAULT_ONNX_EXPORTER_OPTIONS.decomposition_table
```

We can see all but `_EXTRA_SUPPORT_DICT` are extracted from deduced from
ONNX exporter's options. As there are many ways to configure ONNX
exporter's options, we decided to move these variables to `OrtBackend`'s
`__init__` so that the construction of `OrtBackend` becomes more
flexible (especially for enabling dynamic shape or not).
2023-07-18 09:06:58 -07:00
..
amp Adopt linrtunner as the linting tool - take 2 (#15085) 2023-03-24 15:29:03 -07:00
api Add support for training apis to support custom ops (#16601) 2023-07-14 11:15:51 -07:00
experimental Manage ORTModule configurations consistently (#16396) 2023-06-27 19:19:36 +08:00
onnxblock Add support for training apis to support custom ops (#16601) 2023-07-14 11:15:51 -07:00
optim Adding this set_to_none flag to zero_grad to have signature parity with pytorch Adam (#16375) 2023-06-19 17:27:41 -07:00
ort_triton Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
ortmodule Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
torchdynamo [DORT] Reduce global configs to make enabling dynamic shape easier (#16720) 2023-07-18 09:06:58 -07:00
utils Introduce memory observer for ORTModule (#16213) 2023-06-15 15:45:36 +08: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 Add support for training apis to support custom ops (#16601) 2023-07-14 11:15:51 -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