Hi, I have encountered the same issue when following this parallelism tutorial: Multi-GPU Examples — PyTorch Tutorials 1.7.1 documentation 2 → Attributes of the wrapped module
Simple code snippet to reproduce:
>>> import torch
>>> class TorchDataParallel(torch.nn.DataParallel):
...     def __getattr__(self, name):
...         return getattr(self.module, name)
... 
>>> block = torch.nn.Module()
>>> parallel_block = TorchDataParallel(block)
>>> parallel_block.stream_names
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __getattr__
  File "<stdin>", line 3, in __getattr__
  File "<stdin>", line 3, in __getattr__
  [Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded

Wondering what would be the right way to access custom attributes?