def METHOD_NAME(grid):
    global _groups, _grid
    _grid = grid
    assert _grid.pipe_parallel_size > 1, "There is no pipeline parallelism"
    if not can_send_recv():
        _groups = [dist.new_group(ranks=group) for group in _grid.p2p_groups]