from __future__ import annotations

from typing import Any, Optional

from ...fluid.layers.tensor import fill_constant as fill_constant

def get_all_process_groups(): ...
def get_process_group(group_id: Any, g_process_group_map: Optional[Any] = ...): ...
def get_world_process_group(): ...
def new_process_group(ranks: Any): ...

class ProcessGroup:
    def __init__(self, group_id: Any, ranks: Any) -> None: ...
    @property
    def id(self): ...
    @property
    def ranks(self): ...
    @property
    def nranks(self): ...
    def add_ranks(self, new_ranks: Any) -> None: ...
    def local_rank(self, global_rank: Any): ...
    def is_instantiate(self): ...
    def instantiate(self) -> None: ...
