Skip to content

Commit 0adcfcc

Browse files
committed
Remove unused functions
1 parent fdb29bd commit 0adcfcc

1 file changed

Lines changed: 0 additions & 68 deletions

File tree

pkg/scheduler/plugins/predicates/predicates.go

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ package predicates
2222
import (
2323
"fmt"
2424
"slices"
25-
"strconv"
2625
"strings"
2726

2827
"k8s.io/apimachinery/pkg/util/sets"
@@ -33,11 +32,9 @@ import (
3332
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/api/node_info"
3433
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/api/pod_info"
3534
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/api/podgroup_info"
36-
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/api/resource_info"
3735
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/cache/cluster_info"
3836
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/conf"
3937
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/framework"
40-
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/gpu_sharing"
4138
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/k8s_internal"
4239
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/k8s_internal/predicates"
4340
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/log"
@@ -391,69 +388,4 @@ func (pp *predicatesPlugin) evaluateTaskOnPredicates(
391388
return nil
392389
}
393390

394-
func (pp *predicatesPlugin) checkMaxPodsWithGpuGroupReservation(
395-
task *pod_info.PodInfo, node *node_info.NodeInfo) error {
396-
availablePods := node.IdleVector.Get(resource_info.PodsIndex) + node.ReleasingVector.Get(resource_info.PodsIndex)
397-
398-
if !task.IsSharedGPURequest() {
399-
if availablePods > 0 {
400-
return nil
401-
}
402-
return common_info.NewFitError(task.Name, task.Namespace, node.Name, api.NodePodNumberExceeded)
403-
}
404-
405-
needsNewGpuGroup := pp.willCreateNewGpuGroup(task, node)
406-
if !needsNewGpuGroup {
407-
return nil
408-
}
409-
410-
if availablePods < 2 {
411-
return common_info.NewFitError(task.Name, task.Namespace, node.Name, api.NodePodNumberExceeded)
412-
}
413-
414-
return nil
415-
}
416-
417-
// willCreateNewGpuGroup determines if allocating this task will create a new GPU group
418-
// (and thus require a new reservation pod).
419-
func (pp *predicatesPlugin) willCreateNewGpuGroup(task *pod_info.PodInfo, node *node_info.NodeInfo) bool {
420-
if pp.ssn == nil {
421-
return true
422-
}
423-
424-
fittingGPUs := pp.ssn.FittingGPUs(node, task)
425-
gpuForSharingImmediate := gpu_sharing.GetNodePreferableGpuForSharing(fittingGPUs, node, task, false)
426-
427-
if gpuForSharingImmediate != nil && !gpuForSharingImmediate.IsReleasing {
428-
return containsNewGpuGroup(gpuForSharingImmediate.Groups)
429-
}
430-
431-
gpuForSharingPipelined := gpu_sharing.GetNodePreferableGpuForSharing(fittingGPUs, node, task, true)
432-
433-
if gpuForSharingPipelined != nil {
434-
return containsNewGpuGroup(gpuForSharingPipelined.Groups)
435-
}
436-
437-
// No GPU assignment possible - conservatively assume new group would be needed
438-
return true
439-
}
440-
441-
// containsNewGpuGroup checks if any of the GPU groups is a newly created one (UUID format).
442-
func containsNewGpuGroup(groups []string) bool {
443-
for _, gpuGroup := range groups {
444-
if isNewGpuGroup(gpuGroup) {
445-
return true
446-
}
447-
}
448-
return false
449-
}
450-
451-
// isNewGpuGroup determines if a GPU group ID represents a new group (UUID) vs an existing one (numeric).
452-
func isNewGpuGroup(gpuGroup string) bool {
453-
// New GPU groups are UUIDs (e.g., "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
454-
// Existing GPU groups are numeric strings ("0", "1", "2", etc.)
455-
_, err := strconv.Atoi(gpuGroup)
456-
return err != nil // If not a number, it's a UUID = new group
457-
}
458-
459391
func (pp *predicatesPlugin) OnSessionClose(_ *framework.Session) {}

0 commit comments

Comments
 (0)