Skip to content

extend Enum api #5478

@Borda

Description

@Borda

🚀 Feature

it may be nice to have some general calls over our enums such as Distributed mentioned by @carmocca in #5300 (comment)

Any logic to compare different DistributedTypes should be encapsulated by the enum itself.

Motivation

easier handling some cumulative behaviours, such is_ddp which cover DDP and DDP_SPAWN

Pitch

class DistributedType(LightningEnum):
    DP = 'dp'
    ...

    def is_distributed(self):
        return self in (DistributedType.DDP, DistributedType.DDP_SPAWN, DistributedType.DDP2)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions