java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.com.nec.NECVEPlugin
All Implemented Interfaces:
DevicePlugin, DevicePluginScheduler

public class NECVEPlugin extends Object implements DevicePlugin, DevicePluginScheduler
A device framework plugin which supports NEC Vector Engine.
  • Constructor Details

  • Method Details

    • getRegisterRequestInfo

      public DeviceRegisterRequest getRegisterRequestInfo()
      Description copied from interface: DevicePlugin
      Called first when device plugin framework wants to register.
      Specified by:
      getRegisterRequestInfo in interface DevicePlugin
      Returns:
      DeviceRegisterRequest DeviceRegisterRequest
    • getDevices

      public Set<Device> getDevices()
      Description copied from interface: DevicePlugin
      Called when update node resource.
      Specified by:
      getDevices in interface DevicePlugin
      Returns:
      a set of Device, TreeSet recommended
    • onDevicesAllocated

      public DeviceRuntimeSpec onDevicesAllocated(Set<Device> set, YarnRuntimeType yarnRuntimeType)
      Description copied from interface: DevicePlugin
      Asking how these devices should be prepared/used before/when container launch. A plugin can do some tasks in its own or define it in DeviceRuntimeSpec to let the framework do it. For instance, define VolumeSpec to let the framework to create volume before running container.
      Specified by:
      onDevicesAllocated in interface DevicePlugin
      Parameters:
      set - A set of allocated Device.
      yarnRuntimeType - Indicate which runtime YARN will use Could be RUNTIME_DEFAULT or RUNTIME_DOCKER in DeviceRuntimeSpec constants. The default means YARN's non-docker container runtime is used. The docker means YARN's docker container runtime is used.
      Returns:
      a DeviceRuntimeSpec description about environment, VolumeSpec, MountVolumeSpec. etc
    • onDevicesReleased

      public void onDevicesReleased(Set<Device> releasedDevices)
      Description copied from interface: DevicePlugin
      Called after device released.
      Specified by:
      onDevicesReleased in interface DevicePlugin
      Parameters:
      releasedDevices - A set of released devices
    • allocateDevices

      public Set<Device> allocateDevices(Set<Device> availableDevices, int count, Map<String,String> env)
      Description copied from interface: DevicePluginScheduler
      Called when allocating devices. The framework will do all device book keeping and fail recovery. So this hook could be stateless and only do scheduling based on available devices passed in. It could be invoked multiple times by the framework. The hint in environment variables passed in could be potentially used in making better scheduling decision. For instance, GPU scheduling might support different kind of policy. The container can set it through environment variables.
      Specified by:
      allocateDevices in interface DevicePluginScheduler
      Parameters:
      availableDevices - Devices allowed to be chosen from.
      count - Number of device to be allocated.
      env - Environment variables of the container.
      Returns:
      A set of Device allocated