Skip to content

Commit

Permalink
[Doc] Fix documentation in dgl.multiprocessing namespace (dmlc#3929)
Browse files Browse the repository at this point in the history
* fix docs

* remove

* oh

* fix
  • Loading branch information
BarclayII authored Apr 15, 2022
1 parent f5bba28 commit 4375c2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion docs/source/api/python/dgl.multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ In addition, if your backend is PyTorch, this module will also be compatible wit
.. autosummary::
:toctree: ../../generated/

spawn
call_once_and_share
shared_tensor
2 changes: 1 addition & 1 deletion python/dgl/multiprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if F.get_preferred_backend() == 'pytorch':
# Wrap around torch.multiprocessing...
from torch.multiprocessing import *
# ... and override the Process initializer and spawn function.
# ... and override the Process initializer.
from .pytorch import *
else:
# Just import multiprocessing module.
Expand Down
8 changes: 3 additions & 5 deletions python/dgl/multiprocessing/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ def _get_shared_mem_name(id_):
return "shared" + str(id_)

def call_once_and_share(func, shape, dtype, rank=0):
"""Invoke the function in a single process of the process group spawned by
:func:`spawn`, and share the result to other processes.
Requires the subprocesses to be spawned with :func:`dgl.multiprocessing.pytorch.spawn`.
"""Invoke the function in a single process of the PyTorch distributed process group,
and share the result with other processes.
Parameters
----------
Expand Down Expand Up @@ -89,7 +87,7 @@ def call_once_and_share(func, shape, dtype, rank=0):

def shared_tensor(shape, dtype=torch.float32):
"""Create a tensor in shared memory accessible by all processes within the same
``torch.distsributed`` process group.
``torch.distributed`` process group.
The content is uninitialized.
Expand Down

0 comments on commit 4375c2d

Please sign in to comment.