Skip to content

Commit

Permalink
clarify gpu / process (#6049)
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli authored Feb 18, 2021
1 parent ffdcb62 commit 115e58a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/source/extensions/datamodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ To define a DataModule define 5 methods:

prepare_data
^^^^^^^^^^^^
Use this method to do things that might write to disk or that need to be done only from a single GPU in distributed
Use this method to do things that might write to disk or that need to be done only from a single process in distributed
settings.

- download
Expand All @@ -199,7 +199,7 @@ settings.
MNIST(os.getcwd(), train=False, download=True, transform=transforms.ToTensor())
.. warning:: ``prepare_data`` is called from a single GPU. Do not use it to assign state (``self.x = y``).
.. warning:: ``prepare_data`` is called from a single process (e.g. GPU 0). Do not use it to assign state (`self.x = y`).


setup
Expand Down Expand Up @@ -243,12 +243,12 @@ There are also data operations you might want to perform on every GPU. Use setup
self.dims = getattr(self, 'dims', self.mnist_test[0][0].shape)
.. warning:: `setup` is called from every GPU. Setting state here is okay.
.. warning:: `setup` is called from every process. Setting state here is okay.


train_dataloader
^^^^^^^^^^^^^^^^
Use this method to generate the train dataloader. Usually you just wrap the dataset you defined in ``setup``.
Use this method to generate the train dataloader. Usually you just wrap the dataset you defined in ``setup``.

.. code-block:: python
Expand All @@ -262,7 +262,7 @@ Use this method to generate the train dataloader. Usually you just wrap the dat
val_dataloader
^^^^^^^^^^^^^^
Use this method to generate the val dataloader. Usually you just wrap the dataset you defined in ``setup``.
Use this method to generate the val dataloader. Usually you just wrap the dataset you defined in ``setup``.

.. code-block:: python
Expand Down

0 comments on commit 115e58a

Please sign in to comment.