# New placement groups not being created after initial round

**URL:** <https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314>\
**Category:** Ray Core\
**Created:** [August 24, 2022, 6:41am UTC](https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314 "2022-08-24T06:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghav\_G](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/raghav_g/32/2960_2.png) [@Raghav\_G](https://discuss.ray.io/u/Raghav_G)\
**Post date:** [August 24, 2022, 6:41am UTC](https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314/1 "2022-08-24T06:41:35Z")

</div>

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

I have a workflow that requires a several tasks be run in consecutive order and so I wanted to use placement groups (pg) to do this.

As recommended by [this](https://discuss.ray.io/t/removing-placement-group-from-remote-function/906) thread, I created a nested function structure so that the PG could be created and destroyed by the same driver, but not be itself contained in the PG. The code essentially looks like the following:

```auto
@ray.remote(resources = my_resources)
def task1(input):
    ...
    return output

@ray.remote(resources = my_resources)
def task2(input):
    ...
    return output

def manage_tasks(input)
    pg = placement_group([my_resources], strategy="STRICT_PACK")
    ray.get(pg.ready())
    pg_strategy = PlacementGroupSchedulingStrategy(placement_group=pg)
    
    future1 = task1.options(scheduling_strategy=pg_strategy).remote(input)
    output = ray.get(task2.options(scheduling_strategy=pg_strategy).remote(future1))
    
    remove_placement_group(pg)
    return output

outputs = ray.get([manage_tasks.remote(i) for i in range(100)])

```

The issue I am having is that after the first “round” of placement groups, the other manage\_tasks workers never make it past the ray.get(pg.ready()) line. I am monitoring the cluster and there is space on the worker nodes to create new PGs. The cluster also has demands for 1+ PG groups. Thoughts?

---

<div class="post-metadata">

**Author:** ![jjyao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jjyao/32/1799_2.png) [@jjyao](https://discuss.ray.io/u/jjyao)\
**Post date:** [August 25, 2022, 6:05pm UTC](https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314/2 "2022-08-25T18:05:21Z")

</div>

What’s the Ray version you are using? What’s the cluster setup: how many nodes, how many resources on each node? What’s `my_resources`? cc @sangcho

---

<div class="post-metadata">

**Author:** ![Raghav\_G](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/raghav_g/32/2960_2.png) [@Raghav\_G](https://discuss.ray.io/u/Raghav_G)\
**Post date:** [August 27, 2022, 1:51pm UTC](https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314/3 "2022-08-27T13:51:34Z")

</div>

version:

- ray==2.0.0rc1

cluster setup:

- 1 worker node
- resources: {“CPU”: 12, “GPU”: 1, “guppy-mm2”: 1}

task1 & task2 remote decorator resources: num\_gpus=1, resources={‘guppy-mm2’: 0.01}

my\_resources in manage\_tasks function body: {‘guppy-mm2’: 0.01, ‘CPU’: 1, ‘GPU’: 1}

---

<div class="post-metadata">

**Author:** ![jjyao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jjyao/32/1799_2.png) [@jjyao](https://discuss.ray.io/u/jjyao)\
**Post date:** [August 30, 2022, 4:09am UTC](https://discuss.ray.io/t/new-placement-groups-not-being-created-after-initial-round/7314/4 "2022-08-30T04:09:04Z")

</div>

I’m able to reproduce it and I created an issue to track it: [https://github.com/ray-project/ray/issues/28160](https://github.com/ray-project/ray/issues/28160). Thanks for reporting it!
