java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga.IntelFpgaOpenclPlugin
All Implemented Interfaces:
AbstractFpgaVendorPlugin

public class IntelFpgaOpenclPlugin extends Object implements AbstractFpgaVendorPlugin
Intel FPGA for OpenCL plugin. The key points are: 1. It uses Intel's toolchain "aocl" to discover devices/reprogram IP to the device before container launch to achieve a quickest reprogramming path 2. It avoids reprogramming by maintaining a mapping of device to FPGA IP ID 3. It assume IP file is distributed to container directory
  • Constructor Details

    • IntelFpgaOpenclPlugin

      public IntelFpgaOpenclPlugin()
  • Method Details

    • getDefaultPathToExecutable

      public String getDefaultPathToExecutable()
    • initPlugin

      public boolean initPlugin(org.apache.hadoop.conf.Configuration config)
      Check the Intel FPGA for OpenCL toolchain.
      Specified by:
      initPlugin in interface AbstractFpgaVendorPlugin
      Parameters:
      config - Hadoop configuration
      Returns:
      true if the initialization was successful
    • discover

      public List<FpgaDevice> discover(int timeout)
      Description copied from interface: AbstractFpgaVendorPlugin
      Discover the vendor's FPGA devices with execution time constraint
      Specified by:
      discover in interface AbstractFpgaVendorPlugin
      Parameters:
      timeout - The vendor plugin should return result during this time
      Returns:
      The result will be added to FPGAResourceAllocator for later scheduling
    • getDiagnoseInfo

      public String getDiagnoseInfo(int timeout)
    • diagnose

      public boolean diagnose(int timeout)
      Description copied from interface: AbstractFpgaVendorPlugin
      Diagnose the devices using vendor toolchain but no need to parse device information
      Specified by:
      diagnose in interface AbstractFpgaVendorPlugin
      Parameters:
      timeout - timeout in milliseconds
      Returns:
      true if the diagnostics was successful
    • getFpgaType

      public String getFpgaType()
      this is actually the opencl platform type
      Specified by:
      getFpgaType in interface AbstractFpgaVendorPlugin
      Returns:
      the type of FPGA plugin represented as a string
    • retrieveIPfilePath

      public String retrieveIPfilePath(String id, String dstDir, Map<org.apache.hadoop.fs.Path,List<String>> localizedResources)
      Description copied from interface: AbstractFpgaVendorPlugin
      The vendor plugin download required IP files to a required directory. It should check if the IP file has already been downloaded.
      Specified by:
      retrieveIPfilePath in interface AbstractFpgaVendorPlugin
      Parameters:
      id - The identifier for IP file. Comes from application, ie. matrix_multi_v1
      dstDir - The plugin should download IP file to this directory
      localizedResources - The container localized resource can be searched for IP file. Key is localized file path and value is soft link names
      Returns:
      The absolute path string of IP file
    • configureIP

      public boolean configureIP(String ipPath, FpgaDevice device)
      Program one device. It's ok for the offline "aocl program" failed because the application will always invoke API to program. The reason we do offline reprogramming is to make the application's program process faster.
      Specified by:
      configureIP in interface AbstractFpgaVendorPlugin
      Parameters:
      ipPath - the absolute path to the aocx IP file
      device - Fpga device object which represents the card
      Returns:
      false if programming the card fails