Skip to content

documentation: fix kwargs and descriptions of the smdmp checkpoint function #3410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ smdistributed.modelparallel.torch APIs for Saving and Loading
* ``num_kept_partial_checkpoints`` (int) (default: None): The maximum number
of partial checkpoints to keep on disk.

.. function:: smdistributed.modelparallel.torch.resume_from_checkpoint(path, tag=None, partial=True, strict=True, load_optimizer_states=True, translate_function=None)
.. function:: smdistributed.modelparallel.torch.resume_from_checkpoint(path, tag=None, partial=True, strict=True, load_optimizer=True, load_sharded_optimizer_state=True, translate_function=None)

While :class:`smdistributed.modelparallel.torch.load` loads saved
model and optimizer objects, this function resumes from a saved checkpoint file.
Expand All @@ -742,7 +742,16 @@ smdistributed.modelparallel.torch APIs for Saving and Loading
* ``partial`` (boolean) (default: True): Whether to load the partial checkpoint.
* ``strict`` (boolean) (default: True): Load with strict load, no extra key or
missing key is allowed.
* ``load_optimizer_states`` (boolean) (default: True): Whether to load ``optimizer_states``.
* ``load_optimizer`` (boolean) (default: True): Whether to load ``optimizer``.
* ``load_sharded_optimizer_state`` (boolean) (default: True): Whether to load
the sharded optimizer state of a model.
It can be used only when you activate
the `sharded data parallelism
<https://docs.aws.amazon.com/sagemaker/latest/dg/model-parallel-extended-features-pytorch-sharded-data-parallelism.html>`_
feature of the SageMaker model parallel library.
When this is ``False``, the library only loads the FP16
states, such as FP32 master parameters and the loss scaling factor,
not the sharded optimizer states.
* ``translate_function`` (function) (default: None): function to translate the full
checkpoint into smdistributed.modelparallel format.
For supported models, this is not required.
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ sphinx-rtd-theme==0.5.0
docutils==0.15.2
packaging==20.9
jinja2<3.1
schema