-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
#61555 introduces the _Joinable
abstract base class. Classes to be compatible with the generic join context manager _Join
should inherit from _Joinable
. However, because torch.nn.Module
does not call super(Module, self).__init__()
, DistributedDataParallel.__init__()
must explicitly call the _Joinable
constructor via _Joinable.__init__()
. Similarly, because torch.optim.Optimizer
does not call super(Optimizer, self).__init__()
, ZeroRedundancyOptimizer.__init__()
must explicitly call the _Joinable
constructor.
If the Module
and Optimizer
constructors are modified to include the super().__init__()
calls, then DistributeDataParallel
and ZeroRedundancyOptimizer
can remove the explicit call to the _Joinable
constructor and instead rely on the method resolution order.
cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23