mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-01 23:30:35 +00:00
Move import to when needed to avoid circular dependency error (#19579)
### Description Move import to when needed to avoid circular dependency error ### Motivation and Context Fixes dependency error described here: https://github.com/microsoft/DeepSpeed/issues/5140 --------- Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
This commit is contained in:
parent
6b73ab3e3e
commit
3bdb10d5ca
1 changed files with 3 additions and 1 deletions
|
|
@ -20,7 +20,6 @@ import onnxruntime
|
|||
from onnxruntime.capi import _pybind_state as C
|
||||
from onnxruntime.tools.symbolic_shape_infer import SymbolicShapeInference
|
||||
from onnxruntime.training.utils import ORTModelInputOutputSchemaType, PTable, onnx_dtype_to_pytorch_dtype
|
||||
from onnxruntime.training.utils.hooks import configure_ort_compatible_zero_stage3
|
||||
|
||||
from . import _are_deterministic_algorithms_enabled, _io, _logger, _onnx_models, _utils
|
||||
from ._fallback import (
|
||||
|
|
@ -143,6 +142,9 @@ class GraphExecutionManager(GraphExecutionInterface):
|
|||
|
||||
self._zero_stage3_param_map = {}
|
||||
if self._runtime_options.enable_zero_stage3_support:
|
||||
# Move import to here to avoid circular dependency error
|
||||
from onnxruntime.training.utils.hooks import configure_ort_compatible_zero_stage3 # type: ignore[import]
|
||||
|
||||
# Cannot toggle feature enabling/disabling after the first time enabled.
|
||||
|
||||
configure_ort_compatible_zero_stage3(debug=False, stats_output_dir="ort_output", stats_overwrite=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue