Skip to content

Commit 7cd04a3

Browse files
DaraanYoussefEssDS
authored andcommitted
[doc] fix invalid syntax in label_selector (ray-project#58352)
The current examples describe that label bundles are written as: `[{"ray.io/accelerator-type": "H100"}* 2]`, i.e. a dict * integer. This is wrong it has to be the list that is multiplied. This PR fixes this. Signed-off-by: Daraan <github.blurry@9ox.net>
1 parent b9f7868 commit 7cd04a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/source/ray-core/scheduling/labels.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ Use the `bundle_label_selector` option to add label selector to placement group
134134
# All bundles require the same labels:
135135
ray.util.placement_group(
136136
bundles=[{"GPU": 1}, {"GPU": 1}],
137-
bundle_label_selector=[{"ray.io/accelerator-type": "H100"} * 2],
137+
bundle_label_selector=[{"ray.io/accelerator-type": "H100"}] * 2,
138138
)
139139

140140
# Bundles require different labels:
141141
ray.util.placement_group(
142-
bundles=[{"CPU": 1}] + [{"GPU": 1} * 2],
143-
bundle_label_selector=[{"ray.io/market-type": "spot"}] + [{"ray.io/accelerator-type": "H100"} * 2]
142+
bundles=[{"CPU": 1}] + [{"GPU": 1}] * 2,
143+
bundle_label_selector=[{"ray.io/market-type": "spot"}] + [{"ray.io/accelerator-type": "H100"}] * 2
144144
)
145145
```
146146
## Using labels with autoscaler

0 commit comments

Comments
 (0)