Skip to content

super().__init__() usage for _Joinable #61662

@awgu

Description

@awgu

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    oncall: distributedAdd this issue/PR to distributed oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions