Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When gpu lost, scheduler will assign pod to wrong node #1782

Closed
zhiyu0729 opened this issue Oct 14, 2021 · 2 comments
Closed

When gpu lost, scheduler will assign pod to wrong node #1782

zhiyu0729 opened this issue Oct 14, 2021 · 2 comments
Labels
area/scheduling help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@zhiyu0729
Copy link
Contributor

zhiyu0729 commented Oct 14, 2021

What happened:
After pod scheduled, it create fail.

Status:         Failed
Reason:         UnexpectedAdmissionError
Message:        Pod Allocate failed due to requested number of devices unavailable for nvidia.com/gpu. Requested: 1, Available: 0, which is unexpected

What you expected to happen:
Pod Shouldn't schedule to this Node.

How to reproduce it (as minimally and precisely as possible):

  1. Node with 4 GPU
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     4
  1. Start Pod With 4 GPU in this Node.
  2. One GPU error detect by device-plugin, then.
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     3
  1. Start Volcano Scheduler now.
  2. Create Pod With 1 GPU.
  3. Pod scheduled to this node, but node no idle gpu resource.

Anything else we need to know?:

Environment:

  • Volcano Version: e83119
  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@zhiyu0729 zhiyu0729 added the kind/bug Categorizes issue or PR as related to a bug. label Oct 14, 2021
@zhiyu0729 zhiyu0729 changed the title gpu error occur, cause scheduling to the wrong node When gpu lost, scheduler pod to the wrong node Oct 14, 2021
@zhiyu0729 zhiyu0729 changed the title When gpu lost, scheduler pod to the wrong node When gpu lost, scheduler will schedule pod to the wrong node Oct 14, 2021
@zhiyu0729 zhiyu0729 changed the title When gpu lost, scheduler will schedule pod to the wrong node When gpu lost, scheduler will assign pod to the wrong node Oct 14, 2021
@zhiyu0729 zhiyu0729 changed the title When gpu lost, scheduler will assign pod to the wrong node When gpu lost, scheduler will assign pod to wrong node Oct 14, 2021
@shinytang6
Copy link
Member

What happened: After pod scheduled, it create fail.

Status:         Failed
Reason:         UnexpectedAdmissionError
Message:        Pod Allocate failed due to requested number of devices unavailable for nvidia.com/gpu. Requested: 1, Available: 0, which is unexpected

What you expected to happen: Pod Shouldn't schedule to this Node.

How to reproduce it (as minimally and precisely as possible):

  1. Node with 4 GPU
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     4
  1. Start Pod With 4 GPU in this Node.
  2. One GPU error detect by device-plugin, then.
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     3
  1. Start Volcano Scheduler now.
  2. Create Pod With 1 GPU.
  3. Pod scheduled to this node, but node node idle gpu resource.

Anything else we need to know?:

Environment:

  • Volcano Version: e83119
  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

l am a little confused, since the first pod (4 GPU) occupies the node first, why is the pod (1 GPU) can still be scheduled to the node, did l miss sth ?

@zhiyu0729
Copy link
Contributor Author

What happened: After pod scheduled, it create fail.

Status:         Failed
Reason:         UnexpectedAdmissionError
Message:        Pod Allocate failed due to requested number of devices unavailable for nvidia.com/gpu. Requested: 1, Available: 0, which is unexpected

What you expected to happen: Pod Shouldn't schedule to this Node.
How to reproduce it (as minimally and precisely as possible):

  1. Node with 4 GPU
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     4
  1. Start Pod With 4 GPU in this Node.
  2. One GPU error detect by device-plugin, then.
Capacity:
  nvidia.com/gpu:     4
Allocatable:
  nvidia.com/gpu:     3
  1. Start Volcano Scheduler now.
  2. Create Pod With 1 GPU.
  3. Pod scheduled to this node, but node node idle gpu resource.

Anything else we need to know?:
Environment:

  • Volcano Version: e83119
  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

l am a little confused, since the first pod (4 GPU) occupies the node first, why is the pod (1 GPU) can still be scheduled to the node, did l miss sth ?

The problem is here:

When schedule start , sync scheduler cache, tigger AddPod handler, when pod bind to node tasks list:

func (ni *NodeInfo) allocateIdleResource(ti *TaskInfo) error {
if ti.Resreq.LessEqual(ni.Idle, Zero) {
ni.Idle.Sub(ti.Resreq)
return nil
}
return fmt.Errorf("selected node NotReady")
}

first pod Resreq 4 gpu, node has 3 gpu can allocate, it raise error.

// AddPod add pod to scheduler cache
func (sc *SchedulerCache) AddPod(obj interface{}) {
pod, ok := obj.(*v1.Pod)
if !ok {
klog.Errorf("Cannot convert to *v1.Pod: %v", obj)
return
}
sc.Mutex.Lock()
defer sc.Mutex.Unlock()
err := sc.addPod(pod)
if err != nil {
klog.Errorf("Failed to add pod <%s/%s> into cache: %v",
pod.Namespace, pod.Name, err)
return
}
klog.V(3).Infof("Added pod <%s/%v> into cache.", pod.Namespace, pod.Name)
}

but in AddPod it just ingore this pod, so node idle resource is 3 gpu.

@Thor-wl Thor-wl added area/scheduling priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/scheduling help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

3 participants