Skip to content

Commit 8a7b037

Browse files
authored
rename criticality to priority (#1363)
1 parent c4369d7 commit 8a7b037

File tree

14 files changed

+85
-85
lines changed

14 files changed

+85
-85
lines changed

apix/v1alpha2/inferenceobjective_types.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
// +kubebuilder:storageversion
2828
// +kubebuilder:printcolumn:name="Model Name",type=string,JSONPath=`.spec.modelName`
2929
// +kubebuilder:printcolumn:name="Inference Pool",type=string,JSONPath=`.spec.poolRef.name`
30-
// +kubebuilder:printcolumn:name="Criticality",type=string,JSONPath=`.spec.criticality`
30+
// +kubebuilder:printcolumn:name="Priority",type=string,JSONPath=`.spec.priority`
3131
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
3232
// +genclient
3333
type InferenceObjective struct {
@@ -64,20 +64,20 @@ type InferenceObjectiveList struct {
6464
// condition, one will be selected at random.
6565
type InferenceObjectiveSpec struct {
6666

67-
// Criticality defines how important it is to serve the request compared to other requests in the same pool.
68-
// Criticality is an integer value that defines the priority of the request.
67+
// Priority defines how important it is to serve the request compared to other requests in the same pool.
68+
// Priority is an integer value that defines the priority of the request.
6969
// The higher the value, the more critical the request is; negative values _are_ allowed.
7070
// No default value is set for this field, allowing for future additions of new fields that may 'one of' with this field.
7171
// However, implementations that consume this field (such as the Endpoint Picker) will treat an unset value as '0'.
72-
// Criticality is used in flow control, primarily in the event of resource scarcity(reqeusts need to be queued).
73-
// All requests will be queued, and flow control will _always_ allow requests of higher criticality to be served first.
74-
// Fairness is only enforced and tracked between requests of the same criticality.
72+
// Priority is used in flow control, primarily in the event of resource scarcity(reqeusts need to be queued).
73+
// All requests will be queued, and flow control will _always_ allow requests of higher priority to be served first.
74+
// Fairness is only enforced and tracked between requests of the same priority.
7575
//
76-
// Example: requests with Criticality 10 will always be served before
77-
// requests with Criticality of 0(the value used if Criticality is unset or no InfereneceObjective is specified).
78-
// Similarly requests with a Criticality of -10 will always be served after requests with Criticality of 0.
76+
// Example: requests with Priority 10 will always be served before
77+
// requests with Priority of 0 (the value used if Priority is unset or no InfereneceObjective is specified).
78+
// Similarly requests with a Priority of -10 will always be served after requests with Priority of 0.
7979
// +optional
80-
Criticality *int `json:"criticality,omitempty"`
80+
Priority *int `json:"priority,omitempty"`
8181

8282
// PoolRef is a reference to the inference pool, the pool must exist in the same namespace.
8383
//

apix/v1alpha2/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/apix/v1alpha2/inferenceobjectivespec.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/inference.networking.x-k8s.io_inferenceobjectives.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ spec:
2121
- jsonPath: .spec.poolRef.name
2222
name: Inference Pool
2323
type: string
24-
- jsonPath: .spec.criticality
25-
name: Criticality
24+
- jsonPath: .spec.priority
25+
name: Priority
2626
type: string
2727
- jsonPath: .metadata.creationTimestamp
2828
name: Age
@@ -68,21 +68,6 @@ spec:
6868
creation timestamp, will be selected to remain valid. In the event of a race
6969
condition, one will be selected at random.
7070
properties:
71-
criticality:
72-
description: |-
73-
Criticality defines how important it is to serve the request compared to other requests in the same pool.
74-
Criticality is an integer value that defines the priority of the request.
75-
The higher the value, the more critical the request is; negative values _are_ allowed.
76-
No default value is set for this field, allowing for future additions of new fields that may 'one of' with this field.
77-
However, implementations that consume this field (such as the Endpoint Picker) will treat an unset value as '0'.
78-
Criticality is used in flow control, primarily in the event of resource scarcity(reqeusts need to be queued).
79-
All requests will be queued, and flow control will _always_ allow requests of higher criticality to be served first.
80-
Fairness is only enforced and tracked between requests of the same criticality.
81-
82-
Example: requests with Criticality 10 will always be served before
83-
requests with Criticality of 0(the value used if Criticality is unset or no InfereneceObjective is specified).
84-
Similarly requests with a Criticality of -10 will always be served after requests with Criticality of 0.
85-
type: integer
8671
poolRef:
8772
description: PoolRef is a reference to the inference pool, the pool
8873
must exist in the same namespace.
@@ -108,6 +93,21 @@ spec:
10893
required:
10994
- name
11095
type: object
96+
priority:
97+
description: |-
98+
Priority defines how important it is to serve the request compared to other requests in the same pool.
99+
Priority is an integer value that defines the priority of the request.
100+
The higher the value, the more critical the request is; negative values _are_ allowed.
101+
No default value is set for this field, allowing for future additions of new fields that may 'one of' with this field.
102+
However, implementations that consume this field (such as the Endpoint Picker) will treat an unset value as '0'.
103+
Priority is used in flow control, primarily in the event of resource scarcity(reqeusts need to be queued).
104+
All requests will be queued, and flow control will _always_ allow requests of higher priority to be served first.
105+
Fairness is only enforced and tracked between requests of the same priority.
106+
107+
Example: requests with Priority 10 will always be served before
108+
requests with Priority of 0 (the value used if Priority is unset or no InfereneceObjective is specified).
109+
Similarly requests with a Priority of -10 will always be served after requests with Priority of 0.
110+
type: integer
111111
required:
112112
- poolRef
113113
type: object

config/manifests/inferenceobjective.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: InferenceObjective
33
metadata:
44
name: food-review
55
spec:
6-
criticality: 1
6+
priority: 1
77
poolRef:
88
group: inference.networking.k8s.io
99
name: vllm-llama3-8b-instruct
@@ -13,7 +13,7 @@ kind: InferenceObjective
1313
metadata:
1414
name: base-model
1515
spec:
16-
criticality: 2
16+
priority: 2
1717
poolRef:
1818
group: inference.networking.k8s.io
1919
name: vllm-llama3-8b-instruct
@@ -23,7 +23,7 @@ kind: InferenceObjective
2323
metadata:
2424
name: base-model-cpu
2525
spec:
26-
criticality: 2
26+
priority: 2
2727
poolRef:
2828
group: inference.networking.k8s.io
2929
name: vllm-llama3-8b-instruct

config/manifests/regression-testing/inferenceobjective.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: InferenceObjective
33
metadata:
44
name: adapter-0
55
spec:
6-
criticality: 2
6+
priority: 2
77
poolRef:
88
group: inference.networking.k8s.io
99
name: vllm-llama3-8b-instruct
@@ -15,7 +15,7 @@ kind: InferenceObjective
1515
metadata:
1616
name: adapter-1
1717
spec:
18-
criticality: 2
18+
priority: 2
1919
poolRef:
2020
group: inference.networking.k8s.io
2121
name: vllm-llama3-8b-instruct
@@ -27,7 +27,7 @@ kind: InferenceObjective
2727
metadata:
2828
name: adapter-2
2929
spec:
30-
criticality: 2
30+
priority: 2
3131
poolRef:
3232
group: inference.networking.k8s.io
3333
name: vllm-llama3-8b-instruct
@@ -39,7 +39,7 @@ kind: InferenceObjective
3939
metadata:
4040
name: adapter-3
4141
spec:
42-
criticality: 2
42+
priority: 2
4343
poolRef:
4444
group: inference.networking.k8s.io
4545
name: vllm-llama3-8b-instruct
@@ -51,7 +51,7 @@ kind: InferenceObjective
5151
metadata:
5252
name: adapter-4
5353
spec:
54-
criticality: 2
54+
priority: 2
5555
poolRef:
5656
group: inference.networking.k8s.io
5757
name: vllm-llama3-8b-instruct
@@ -63,7 +63,7 @@ kind: InferenceObjective
6363
metadata:
6464
name: adapter-5
6565
spec:
66-
criticality: 2
66+
priority: 2
6767
poolRef:
6868
group: inference.networking.k8s.io
6969
name: vllm-llama3-8b-instruct
@@ -75,7 +75,7 @@ kind: InferenceObjective
7575
metadata:
7676
name: adapter-6
7777
spec:
78-
criticality: 2
78+
priority: 2
7979
poolRef:
8080
group: inference.networking.k8s.io
8181
name: vllm-llama3-8b-instruct
@@ -87,7 +87,7 @@ kind: InferenceObjective
8787
metadata:
8888
name: adapter-7
8989
spec:
90-
criticality: 2
90+
priority: 2
9191
poolRef:
9292
group: inference.networking.k8s.io
9393
name: vllm-llama3-8b-instruct
@@ -99,7 +99,7 @@ kind: InferenceObjective
9999
metadata:
100100
name: adapter-8
101101
spec:
102-
criticality: 2
102+
priority: 2
103103
poolRef:
104104
group: inference.networking.k8s.io
105105
name: vllm-llama3-8b-instruct
@@ -111,7 +111,7 @@ kind: InferenceObjective
111111
metadata:
112112
name: adapter-9
113113
spec:
114-
criticality: 2
114+
priority: 2
115115
poolRef:
116116
group: inference.networking.k8s.io
117117
name: vllm-llama3-8b-instruct
@@ -123,7 +123,7 @@ kind: InferenceObjective
123123
metadata:
124124
name: adapter-10
125125
spec:
126-
criticality: 2
126+
priority: 2
127127
poolRef:
128128
group: inference.networking.k8s.io
129129
name: vllm-llama3-8b-instruct
@@ -135,7 +135,7 @@ kind: InferenceObjective
135135
metadata:
136136
name: adapter-11
137137
spec:
138-
criticality: 2
138+
priority: 2
139139
poolRef:
140140
group: inference.networking.k8s.io
141141
name: vllm-llama3-8b-instruct
@@ -147,7 +147,7 @@ kind: InferenceObjective
147147
metadata:
148148
name: adapter-12
149149
spec:
150-
criticality: 2
150+
priority: 2
151151
poolRef:
152152
group: inference.networking.k8s.io
153153
name: vllm-llama3-8b-instruct
@@ -160,7 +160,7 @@ kind: InferenceObjective
160160
metadata:
161161
name: adapter-13
162162
spec:
163-
criticality: 2
163+
priority: 2
164164
poolRef:
165165
group: inference.networking.k8s.io
166166
name: vllm-llama3-8b-instruct
@@ -173,7 +173,7 @@ kind: InferenceObjective
173173
metadata:
174174
name: adapter-14
175175
spec:
176-
criticality: 2
176+
priority: 2
177177
poolRef:
178178
group: inference.networking.k8s.io
179179
name: vllm-llama3-8b-instruct
@@ -186,7 +186,7 @@ kind: InferenceObjective
186186
metadata:
187187
name: base-model
188188
spec:
189-
criticality: 2
189+
priority: 2
190190
poolRef:
191191
group: inference.networking.k8s.io
192-
name: vllm-llama3-8b-instruct
192+
name: vllm-llama3-8b-instruct

pkg/epp/controller/inferenceobjective_reconciler_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ var (
4343
pool = utiltest.MakeInferencePool("test-pool1").Namespace("ns1").ObjRef()
4444
infObjective1 = utiltest.MakeInferenceObjective("model1").
4545
Namespace(pool.Namespace).
46-
Criticality(1).
46+
Priority(1).
4747
CreationTimestamp(metav1.Unix(1000, 0)).
4848
PoolName(pool.Name).
4949
PoolGroup("inference.networking.k8s.io").ObjRef()
5050
infObjective1Pool2 = utiltest.MakeInferenceObjective(infObjective1.Name).
5151
Namespace(infObjective1.Namespace).
52-
Criticality(*infObjective1.Spec.Criticality).
52+
Priority(*infObjective1.Spec.Priority).
5353
CreationTimestamp(metav1.Unix(1001, 0)).
5454
PoolName("test-pool2").
5555
PoolGroup("inference.networking.k8s.io").ObjRef()
5656
infObjective1Critical = utiltest.MakeInferenceObjective(infObjective1.Name).
5757
Namespace(infObjective1.Namespace).
58-
Criticality(2).
58+
Priority(2).
5959
CreationTimestamp(metav1.Unix(1003, 0)).
6060
PoolName(pool.Name).
6161
PoolGroup("inference.networking.k8s.io").ObjRef()
@@ -67,7 +67,7 @@ var (
6767
PoolGroup("inference.networking.k8s.io").ObjRef()
6868
infObjective1DiffGroup = utiltest.MakeInferenceObjective(infObjective1.Name).
6969
Namespace(pool.Namespace).
70-
Criticality(1).
70+
Priority(1).
7171
CreationTimestamp(metav1.Unix(1005, 0)).
7272
PoolName(pool.Name).
7373
PoolGroup("inference.networking.x-k8s.io").ObjRef()
@@ -112,7 +112,7 @@ func TestInferenceObjectiveReconciler(t *testing.T) {
112112
wantObjectives: []*v1alpha2.InferenceObjective{},
113113
},
114114
{
115-
name: "Objective changed criticality",
115+
name: "Objective changed priority",
116116
objectivessInStore: []*v1alpha2.InferenceObjective{infObjective1},
117117
objective: infObjective1Critical,
118118
wantObjectives: []*v1alpha2.InferenceObjective{infObjective1Critical},

pkg/epp/datastore/datastore_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func TestObjective(t *testing.T) {
114114
model2ts := testutil.MakeInferenceObjective("model2").ObjRef()
115115
// Same model name as model1ts, newer timestamp
116116
model1tsCritical := testutil.MakeInferenceObjective("model1").
117-
Criticality(2).ObjRef()
117+
Priority(2).ObjRef()
118118
// Same object name as model2ts, different model name.
119119
model2chat := testutil.MakeInferenceObjective(model2ts.Name).ObjRef()
120120

@@ -135,7 +135,7 @@ func TestObjective(t *testing.T) {
135135
wantOpResult: true,
136136
},
137137
{
138-
name: "Set model1 with the same modelName, but with diff criticality, should update.",
138+
name: "Set model1 with the same modelName, but with diff priority, should update.",
139139
existingModels: []*v1alpha2.InferenceObjective{model1ts},
140140
op: func(ds Datastore) bool {
141141
ds.ObjectiveSet(model1tsCritical)

0 commit comments

Comments
 (0)