From 4288b5b9ffe19a38d029a025b9682817affc4c67 Mon Sep 17 00:00:00 2001 From: Ameer Haj Ali Date: Tue, 1 Dec 2020 23:16:18 +0200 Subject: [PATCH] [placement group] -1 option for placement group index (#12532) * -1 option for placement group index Add documentation of passing -1 as a placement group index to specify any available bundle. * Update --- doc/source/placement-group.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/placement-group.rst b/doc/source/placement-group.rst index de26b0498..3e14fd79f 100644 --- a/doc/source/placement-group.rst +++ b/doc/source/placement-group.rst @@ -68,7 +68,7 @@ Placement groups are atomically created - meaning that if there exists a bundle ready, unready = ray.wait([pg.ready()], timeout=0) # You can look at placement group states using this API. - pprint(placement_group_table(pg)) + print(placement_group_table(pg)) Infeasible placement groups will be pending until resources are available. The Ray Autoscaler will be aware of placement groups, and auto-scale the cluster to ensure pending groups can be placed as needed. @@ -182,6 +182,7 @@ Now let's define an actor that uses GPU. We'll also define a task that use ``ext gpu_actors = [GPUActor.options( placement_group=pg, # This is the index from the original list. + # This index is set to -1 by default, which means any available bundle. placement_group_bundle_index=0) # Index of gpu_bundle is 0. .remote() for _ in range(2)] @@ -189,6 +190,7 @@ Now let's define an actor that uses GPU. We'll also define a task that use ``ext extra_resource_actors = [extra_resource_task.options( placement_group=pg, # This is the index from the original list. + # This index is set to -1 by default, which means any available bundle. placement_group_bundle_index=1) # Index of extra_resource_bundle is 1. .remote() for _ in range(2)]