Class IntelFpgaOpenclPlugin
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga.IntelFpgaOpenclPlugin
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper class to run aocl diagnose & determine major/minor numbers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigureIP(String ipPath, FpgaDevice device) Program one device.booleandiagnose(int timeout) Diagnose the devices using vendor toolchain but no need to parse device informationdiscover(int timeout) Discover the vendor's FPGA devices with execution time constraintgetDiagnoseInfo(int timeout) this is actually the opencl platform typebooleaninitPlugin(org.apache.hadoop.conf.Configuration config) Check the Intel FPGA for OpenCL toolchain.retrieveIPfilePath(String id, String dstDir, Map<org.apache.hadoop.fs.Path, List<String>> localizedResources) The vendor plugin download required IP files to a required directory.
-
Constructor Details
-
IntelFpgaOpenclPlugin
public IntelFpgaOpenclPlugin()
-
-
Method Details
-
getDefaultPathToExecutable
-
initPlugin
public boolean initPlugin(org.apache.hadoop.conf.Configuration config) Check the Intel FPGA for OpenCL toolchain.- Specified by:
initPluginin interfaceAbstractFpgaVendorPlugin- Parameters:
config- Hadoop configuration- Returns:
- true if the initialization was successful
-
discover
Description copied from interface:AbstractFpgaVendorPluginDiscover the vendor's FPGA devices with execution time constraint- Specified by:
discoverin interfaceAbstractFpgaVendorPlugin- Parameters:
timeout- The vendor plugin should return result during this time- Returns:
- The result will be added to FPGAResourceAllocator for later scheduling
-
getDiagnoseInfo
-
diagnose
public boolean diagnose(int timeout) Description copied from interface:AbstractFpgaVendorPluginDiagnose the devices using vendor toolchain but no need to parse device information- Specified by:
diagnosein interfaceAbstractFpgaVendorPlugin- Parameters:
timeout- timeout in milliseconds- Returns:
- true if the diagnostics was successful
-
getFpgaType
this is actually the opencl platform type- Specified by:
getFpgaTypein interfaceAbstractFpgaVendorPlugin- 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:AbstractFpgaVendorPluginThe vendor plugin download required IP files to a required directory. It should check if the IP file has already been downloaded.- Specified by:
retrieveIPfilePathin interfaceAbstractFpgaVendorPlugin- Parameters:
id- The identifier for IP file. Comes from application, ie. matrix_multi_v1dstDir- The plugin should download IP file to this directorylocalizedResources- 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
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:
configureIPin interfaceAbstractFpgaVendorPlugin- Parameters:
ipPath- the absolute path to the aocx IP filedevice- Fpga device object which represents the card- Returns:
- false if programming the card fails
-