Skip to content

Commit 8f91faa

Browse files
committed
YT-24691: Fix cms gpu nodes filtering problem
commit_hash:c0f620428d79c0532bede40784f35be204f26d9c
1 parent 54a784f commit 8f91faa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

internal/cms/task_processor.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -763,18 +763,18 @@ func (p *TaskProcessor) updateDecommissionStats(ctx context.Context) error {
763763
// For now we only have 1 gpu node per host.
764764
// Anything other than that is considered non-gpu.
765765
func (p *TaskProcessor) isGPUTask(t *models.Task) bool {
766-
nodes := t.GetNodes()
767-
768-
if len(nodes) != 1 {
766+
if len(t.GetNodes()) == 0 {
769767
return false
770768
}
771769

772-
nodeComponent, ok := p.resolveNodeComponent(t, nodes[0])
773-
if ok && nodeComponent.HasTag("gpu") {
774-
return true
770+
for _, n := range t.GetNodes() {
771+
nodeComponent, ok := p.resolveNodeComponent(t, n)
772+
if !ok || !nodeComponent.HasTag("gpu") {
773+
return false
774+
}
775775
}
776776

777-
return false
777+
return true
778778
}
779779

780780
// makeProcessingPlan reorders and filters tasks based on their and cluster states.

0 commit comments

Comments
 (0)