Skip to content

invoke_on_rank_and_broadcast_result stuck #3278

@121547456

Description

@121547456

In a distributed environment, when rank0 obtains the plan and then calls the invoke_on_rank_and_broadcast_result communication, it will get stuck.
`def invoke_on_rank_and_broadcast_result(
pg: dist.ProcessGroup,
rank: int,
func: Callable[..., T],
*args: Any,
**kwargs: Any,
) -> T:
"""
Invokes a function on the designated rank and broadcasts the result to all
members within the group.

Example::

    id = invoke_on_rank_and_broadcast_result(pg, 0, allocate_id)
"""
if pg.rank() == rank:
    res = func(*args, **kwargs)
    object_list = [res]
else:
    object_list = [None]
if pg.size() > 1:
    dist.broadcast_object_list(object_list, rank, group=pg)
return cast(T, object_list[0])`

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