Skip to content

Commit c5ab348

Browse files
authored
Document optional steps for converting Fabric code (#19486)
1 parent bb35e8e commit c5ab348

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/source-fabric/fundamentals/convert.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ Check out our before-and-after example for `image classification <https://github
9090
----
9191

9292

93+
****************
94+
Optional changes
95+
****************
96+
97+
Here are a few optional upgrades you can make to your code, if applicable:
98+
99+
- Replace ``torch.save()`` and ``torch.load()`` with Fabric's :doc:`save and load methods <../guide/checkpoint/checkpoint>`.
100+
- Replace collective operations from ``torch.distributed`` (barrier, broadcast, etc.) with Fabric's :doc:`collective methods <../advanced/distributed_communication>`.
101+
- Use Fabric's :doc:`no_backward_sync() context manager <../advanced/gradient_accumulation>` if you implemented gradient accumulation.
102+
- Initialize your model under the :doc:`init_module() <../advanced/model_init>` context manager.
103+
104+
105+
----
106+
107+
93108
**********
94109
Next steps
95110
**********

0 commit comments

Comments
 (0)