File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def _load_external_callbacks(group: str) -> list[Any]:
36
36
A list of all callbacks collected from external factories.
37
37
38
38
"""
39
- factories = entry_points (group = group ) if _PYTHON_GREATER_EQUAL_3_10_0 else entry_points ().get (group , {})
39
+ factories = entry_points (group = group ) if _PYTHON_GREATER_EQUAL_3_10_0 else entry_points ().get (group , {}) # type: ignore[arg-type]
40
40
41
41
external_callbacks : list [Any ] = []
42
42
for factory in factories :
Original file line number Diff line number Diff line change 67
67
from torch .distributed .fsdp import CPUOffloadPolicy , MixedPrecisionPolicy , OffloadPolicy
68
68
69
69
try :
70
- from torch .distributed .checkpoint .stateful import Stateful
70
+ from torch .distributed .checkpoint .stateful import Stateful as _TorchStateful
71
71
except ImportError :
72
- # define a no-op base class for compatibility
73
- class Stateful :
72
+
73
+ class _TorchStateful : # type: ignore[no-redef]
74
74
pass
75
75
76
76
@@ -541,7 +541,7 @@ def _init_fsdp2_mp_policy(mp_policy: Optional["MixedPrecisionPolicy"]) -> Option
541
541
542
542
543
543
# Code taken from: https://docs.pytorch.org/tutorials/recipes/distributed_checkpoint_recipe.html#saving
544
- class AppState (Stateful ):
544
+ class AppState (_TorchStateful ):
545
545
"""This is a useful wrapper for checkpointing the Application State. Since this object is compliant with the
546
546
Stateful protocol, DCP will automatically call state_dict/load_stat_dict as needed in the dcp.save/load APIs.
547
547
You can’t perform that action at this time.
0 commit comments