Skip to content

Commit 750df36

Browse files
committed
docs(scheduler): add semi-preemptible API usage examples
Document that semi-preemptible reuses the existing preemptibility API (a third enum/label value, no new field): show it set on the PodGroup spec, via the kai.scheduler/preemptibility workload label, and on a multi-level tree using minSubGroup for subgroup-level core/elastic. Signed-off-by: SiorMeir <msior@nvidia.com>
1 parent 2fd554c commit 750df36

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

  • docs/developer/designs/semi-preemptible

docs/developer/designs/semi-preemptible/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,62 @@ We want to add a new 3rd mode, named **semi-preemptible**, where the podgroup is
1010

1111
A workload with `minReplicas` such as Inference and Elastic Distributed Training can request to be non-preemptible up to its `minReplicas`, with any pods above that count being preemptible. This allows running a critical workload with some assured resources and some on-demand, availability-based resources.
1212

13+
## Usage
14+
15+
Semi-preemptible reuses the **existing preemptibility API** introduced in [priority/preemptibility separation](../priority-preemptibility-separation/README.md) — it is simply a third value, `semi-preemptible`, alongside `preemptible` and `non-preemptible`. There is no new field or label. The minimum that stays non-preemptible is the PodGroup's existing minimum shape (`minMember` at leaf PodSets, `minSubGroup` at intermediate nodes); nothing extra needs to be declared.
16+
17+
It can be set either directly on the PodGroup spec, or via the `kai.scheduler/preemptibility` label on a workload (the PodGrouper passes it through to the generated PodGroup).
18+
19+
**On the PodGroup spec** — a single elastic group (3 core pods, bursts beyond):
20+
```yaml
21+
apiVersion: scheduling.kai.nvidia.com/v2alpha2
22+
kind: PodGroup
23+
metadata:
24+
name: elastic-inference
25+
spec:
26+
preemptibility: "semi-preemptible"
27+
minMember: 3 # 3 core (non-preemptible) pods; pods above 3 are elastic
28+
priorityClassName: "inference"
29+
# ... rest of podgroup spec
30+
```
31+
32+
**On a workload (label)** — the PodGrouper propagates it to the PodGroup:
33+
```yaml
34+
apiVersion: apps/v1
35+
kind: Deployment
36+
metadata:
37+
name: elastic-inference
38+
spec:
39+
template:
40+
metadata:
41+
labels:
42+
kai.scheduler/preemptibility: "semi-preemptible"
43+
spec:
44+
# ... pod spec
45+
```
46+
47+
**Subgroup-level (multi-level tree)**`minSubGroup` makes whole subgroups core vs. elastic:
48+
```yaml
49+
apiVersion: scheduling.kai.nvidia.com/v2alpha2
50+
kind: PodGroup
51+
metadata:
52+
name: segmented-training
53+
spec:
54+
preemptibility: "semi-preemptible"
55+
minSubGroup: 2 # 2 core subgroups; additional subgroups are elastic
56+
subGroups:
57+
- name: segment-0
58+
minMember: 4
59+
- name: segment-1
60+
minMember: 4
61+
- name: segment-2 # elastic — reclaimed as a whole before any core subgroup
62+
minMember: 4
63+
priorityClassName: "train"
64+
# ... rest of podgroup spec
65+
```
66+
67+
When `preemptibility` is omitted, behavior is unchanged (priority-based default). Semi-preemptible is never applied implicitly — it is always opt-in.
68+
1369
## Quota Requirements
1470

1571
The "core" pods (up to `minMember` per leaf PodSet) must be in-quota when allocated. Any "extra" pods can be allocated over-quota. All pods must respect the Limit setting for the job's queue.

0 commit comments

Comments
 (0)