volcano.sh/volcano@v1.9.0/docs/design/drf.md (about) 1 ## Dominant Resource Fairness (DRF) 2 3 ## Introduction 4 Dominant Resource Fairness (DRF), a generalization of max-min fairness to multiple resource types is a resource allocation policy that handles multiple resource types. 5 6 Dominant resource - a resource of specific type (cpu, memory, gpu) which is most demanded by given job among other resources it needs. This resource is identified as a share of the total cluster resources of the same type. 7 8 DRF computes the share of dominant resource allocated to a job (dominant share) and tries to maximize the smallest dominant share in the system. 9 Schedule the task of the job with smallest dominant resource 10 11 12 ## Kube-Batch Implementation 13 DRF calculate shares for each job. The share is the highest value of ratio of the (allocated resource/Total Resource) of the three resource types CPU, Memory and GPU. 14 This share value is used for job ordering and task premption. 15 16 #### 1. Job Ordering: 17 The job having the lowest share will have higher priority. 18 In the example below all the tasks task1, task2 of job1 and task3 and task4 of job2 is already allocated to the cluster. 19  20 21 22 ##### 1.1 Gang Scheduling with DRF in job ordering ( Gang -> DRF) 23 Gang scheduling sorts the job based on whether the job has at least **minAvailable** task already (allocated + successfully completed + pipelined) or not. 24 Jobs which has not met the minAvailable criteria has higher priority than jobs which has met 25 the minAvailable criteria. 26 27 For the jobs which has met the minAvailable criteria will be sorted according to DRF. 28 29  30 31 #### 2. Task Preemption: 32 33 The preemptor can only preempt other tasks only if the share of the preemptor is less than the share of the preemptee after recalculating the resource allocation of the premptor and preemptee.