Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-21

Optimize node sorting algorithms

    XMLWordPrintableJSON

Details

    Description

      Currently, we're using DominantRatio for the node sorting algorithm

      func CompUsageShares(left, right *Resource) int {
       lshares := getShares(left,nil) rshares := getShares(right,nil)
       return compareShares(lshares, rshares) 
      }

      Which is not good, two reasons:

      1. Dominate resource compare is about 8X more expensive than single float compares for two resource types.
      1. Dominate resource is not stable when we have scarce resource types like GPU. A node with 192GB mem, 32 vcores, and 1 GPU available, compared to 168GB mem, 64 vcore and 8 GPU available; the prior one can go first because of the following logic:
      if total == nil || total.Resources[k] == 0 {
       // negative share is logged
       if v < 0 {
        log.Logger().Debug("usage is negative no total, share is also negative", zap.Int64("resource quantity", int64(v))) 
       }
       shares[idx] = float64(v) idx++ continue
      }

      I think we should discard dominate resource compare for node resource. Instead, we just use one resource type (like vcores) to compare available resource.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wangda Wangda Tan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: