Skip to content

Commit

Permalink
Document optional steps for converting Fabric code (#19486)
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Feb 17, 2024
1 parent bb35e8e commit c5ab348
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source-fabric/fundamentals/convert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ Check out our before-and-after example for `image classification <https://github
----


****************
Optional changes
****************

Here are a few optional upgrades you can make to your code, if applicable:

- Replace ``torch.save()`` and ``torch.load()`` with Fabric's :doc:`save and load methods <../guide/checkpoint/checkpoint>`.
- Replace collective operations from ``torch.distributed`` (barrier, broadcast, etc.) with Fabric's :doc:`collective methods <../advanced/distributed_communication>`.
- Use Fabric's :doc:`no_backward_sync() context manager <../advanced/gradient_accumulation>` if you implemented gradient accumulation.
- Initialize your model under the :doc:`init_module() <../advanced/model_init>` context manager.


----


**********
Next steps
**********
Expand Down

0 comments on commit c5ab348

Please sign in to comment.