Skip to content

Allow users to pass in a custom device_mesh to the enable_parallelism method in the diffusers library #12880

@pthombre

Description

@pthombre

def enable_parallelism( self, *, config: Union[ParallelConfig, ContextParallelConfig], cp_plan: Optional[Dict[str, ContextParallelModelPlan]] = None, mesh: Optional[DeviceMesh] = None, # Add this parameter ):

If users have already initialized a device mesh for other parallelism strategies (FSDP, tensor parallelism, pipeline parallelism), they can reuse it instead of creating a new one. This prevents conflicts and redundant initialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions