You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Method to restore checkpoint state from a path.
415
416
@@ -419,7 +420,7 @@ def restore(
419
420
Args:
420
421
path: Path of the checkpoint to restore.
421
422
unit: An instance of :class:`~torchtnt.framework.unit.TrainUnit`, :class:`~torchtnt.framework.unit.EvalUnit`, or :class:`~torchtnt.framework.unit.PredictUnit` containing states to restore.
422
-
train_dataloader: An optional train dataloader to restore.
423
+
train_dataloader: An optional train dataloader to restore. Can only be used when restoring from a train or fit checkpoint.
423
424
process_group: The process group on which the ranks will communicate on. default: ``None`` (the entire world)
424
425
restore_options: Controls what to filter when restoring the state.
"""Utility method to restore dcp checkpoint from a checkpoint_id.
265
275
@@ -269,7 +279,9 @@ def restore_with_id(
269
279
Args:
270
280
checkpoint_id: Checkpoint id. It can be the path of the snapshot to restore.
271
281
unit: An instance of :class:`~torchtnt.framework.unit.TrainUnit`, :class:`~torchtnt.framework.unit.EvalUnit`, or :class:`~torchtnt.framework.unit.PredictUnit` containing states to restore.
272
-
train_dataloader: An optional train dataloader to restore.
282
+
train_dataloader: An optional train dataloader to restore. Can only be used when restoring from a train or fit checkpoint.
283
+
eval_dataloader: An optional eval dataloader to restore. Can only be used when restoring from an eval or fit checkpoint.
284
+
predict_dataloader: An optional predict dataloader to restore. Can only be used when restoring from a predict checkpoint.
273
285
process_group: The process group on which the ranks will communicate on. default: ``None`` (the entire world)
274
286
If not Gloo, a Gloo process group is created.
275
287
Note: If torch.distributed is available and a process group is initialized, dcp assumes the intention is to save/load checkpoints in distributed fashion.
Copy file name to clipboardExpand all lines: torchtnt/framework/callbacks/torchsnapshot_saver.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,7 @@ def restore(
270
270
storage_options: Optional[Dict[str, Any]] =None,
271
271
knob_options: Optional[KnobOptions] =None,
272
272
strict: bool=True,
273
+
**kwargs: Any,
273
274
) ->None:
274
275
"""Utility method to restore snapshot state from a path.
275
276
@@ -279,7 +280,7 @@ def restore(
279
280
Args:
280
281
path: Path of the snapshot to restore.
281
282
unit: An instance of :class:`~torchtnt.framework.unit.TrainUnit`, :class:`~torchtnt.framework.unit.EvalUnit`, or :class:`~torchtnt.framework.unit.PredictUnit` containing states to restore.
282
-
train_dataloader: An optional train dataloader to restore.
283
+
train_dataloader: An optional train dataloader to restore. Note that restoring from predict or evaluate dataloaders is not supported for TorchSnapshotSaver.
283
284
process_group: The process group on which the ranks will communicate on. default: ``None`` (the entire world)
284
285
restore_options: Controls what to filter when restoring the state.
285
286
storage_options: Additional keyword options for the storage plugin to use, to be passed to `torchsnapshot.Snapshot <https://pytorch.org/torchsnapshot/stable/api_reference.html#torchsnapshot.Snapshot>`_. See each storage plugin's documentation for customizations.
0 commit comments