-
Notifications
You must be signed in to change notification settings - Fork 564
Open
Description
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
Labels
No labels