Skip to content

Commit d03e9df

Browse files
authored
Removed runai-gpu-limit validation from binder (#284)
1 parent 0ff9c0c commit d03e9df

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

pkg/binder/plugins/gpusharing/gpu-request/gpu_request_validator.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func ValidateGpuRequests(pod *v1.Pod) error {
2121
gpuFractionFromAnnotation, hasGpuFractionAnnotation := pod.Annotations[constants.GpuFraction]
2222
gpuMemoryFromAnnotation, hasGpuMemoryAnnotation := pod.Annotations[constants.GpuMemory]
2323
gpuFractionsCountFromAnnotation, hasGpuFractionsCount := pod.Annotations[constants.GpuFractionsNumDevices]
24-
_, hasGpuLimitAnnotation := pod.Annotations[constants.GpuLimit]
24+
2525
mpsFromAnnotation, hasMpsAnnotation := pod.Annotations[constants.MpsAnnotation]
2626
_, hasGpuResourceRequest := container.Resources.Requests[constants.GpuResource]
2727
gpuLimitQuantity, hasGpuResourceLimit := container.Resources.Limits[constants.GpuResource]
@@ -46,10 +46,6 @@ func ValidateGpuRequests(pod *v1.Pod) error {
4646
return fmt.Errorf("GPU is not not listed in resource limits")
4747
}
4848

49-
if hasGpuLimitAnnotation && !isFractional {
50-
return fmt.Errorf("cannot have GPU limit annotation without GPU fraction request")
51-
}
52-
5349
if hasGpuResourceLimit && !isGpuFractionValid(hasWholeGPULimit, gpuLimitQuantity) {
5450
return fmt.Errorf("GPU resource limit annotation cannot be larger than 1")
5551
}

pkg/binder/plugins/gpusharing/gpu-request/gpu_request_validator_test.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,6 @@ func TestValidateGpuRequests(t *testing.T) {
121121
},
122122
error: fmt.Errorf("GPU is not not listed in resource limits"),
123123
},
124-
{
125-
name: "forbid fraction limit annotation without fraction request",
126-
pod: &v1.Pod{
127-
ObjectMeta: metav1.ObjectMeta{
128-
Annotations: map[string]string{
129-
constants.GpuLimit: "1",
130-
},
131-
},
132-
Spec: v1.PodSpec{
133-
Containers: []v1.Container{
134-
{
135-
Resources: v1.ResourceRequirements{},
136-
},
137-
},
138-
},
139-
},
140-
error: fmt.Errorf("cannot have GPU limit annotation without GPU fraction request"),
141-
},
142124
{
143125
name: "forbid fraction limit annotation without fraction request",
144126
pod: &v1.Pod{

pkg/common/constants/constants.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const (
2121
GpuMemory = "gpu-memory"
2222
ReceivedResourceType = "received-resource-type"
2323
GpuFractionsNumDevices = "gpu-fraction-num-devices"
24-
GpuLimit = "runai-gpu-limit"
2524
MpsAnnotation = "mps"
2625
StalePodgroupTimeStamp = "kai.scheduler/stale-podgroup-timestamp"
2726
LastStartTimeStamp = "kai.scheduler/last-start-timestamp"

0 commit comments

Comments
 (0)