java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.NodeResourceUpdaterPlugin
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuNodeResourceUpdateHandler

public class GpuNodeResourceUpdateHandler extends NodeResourceUpdaterPlugin
  • Constructor Details

    • GpuNodeResourceUpdateHandler

      public GpuNodeResourceUpdateHandler(GpuDiscoverer gpuDiscoverer, org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • updateConfiguredResource

      public void updateConfiguredResource(org.apache.hadoop.yarn.api.records.Resource res) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from class: NodeResourceUpdaterPlugin
      Update configured resource for the given component.
      Specified by:
      updateConfiguredResource in class NodeResourceUpdaterPlugin
      Parameters:
      res - resource passed in by external module (such as NodeStatusUpdater
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - when any issue happens.
    • getAvgNodeGpuUtilization

      public float getAvgNodeGpuUtilization() throws Exception
      Returns:
      The average physical GPUs used in this node. For example: Node with total 4 GPUs Physical used 2.4 GPUs Will return 2.4/4 = 0.6f
      Throws:
      Exception - when any error happens
    • getTotalNodeGpuUtilization

      public float getTotalNodeGpuUtilization() throws Exception
      Returns:
      The total physical GPUs used in this node. For example: Node with total 4 GPUs Physical used 2.4 GPUs Will return 2.4f
      Throws:
      Exception - when any error happens