afe.backends.mpk.definesο
Classesο
Provides data that is needed for reconstructing the MPK JSON file. |
|
Provides the information about a tensor type. |
|
Provides the information about a node. |
|
Provides the information about a Model input node. |
|
Provides the configuration parameters for the plugin. |
|
Configuration parameters for EV74 plugin. |
|
Configuration parameters for APU plugin. |
|
Configuration parameters for MLA plugin. |
|
Provides the information of the input node for plugin. |
|
Provides information about resources used by plugin. |
|
Provides data containing all information needed to generate MPK JSON data for a single plugin. |
|
Provides data containing all information needed to generate the MPK JSON data for a single model. |
Module Contentsο
- class afe.backends.mpk.defines.AFEMPKDataο
Provides data that is needed for reconstructing the MPK JSON file. The data is convertible to JSON format. All changes to these data structures must adhere to changes in MPK file specification.
- class afe.backends.mpk.defines.TensorTypeMPKDataο
Provides the information about a tensor type.
- Parameters:
scalar β The tensorβs scalar element type, as a string that numpy can interpret as a type.
shape β The tensorβs shape.
- scalar: strο
- shape: List[int]ο
- class afe.backends.mpk.defines.InOutNodesMPKDataο
Provides the information about a node.
- Parameters:
name β Node name which uniquely identifies the node over the scope of one model file.
type β Data type. From AFEβs perspective, the type of all nodes is βbufferβ.
size β Nodeβs data size in bytes.
- name: strο
- type: str = 'buffer'ο
- size: int = 0ο
- class afe.backends.mpk.defines.ModelInputMPKDataο
Provides the information about a Model input node.
- Parameters:
name β Node name which uniquely identifies the node over the scope of one model file.
type β Data type. From AFEβs perspective, the type of all nodes is βbufferβ.
size β Nodeβs data size in bytes.
input_range β Input range of floating point tensors.
- name: strο
- type: str = 'buffer'ο
- size: int = 0ο
- input_range: List[float] | None = Noneο
- class afe.backends.mpk.defines.ConfigParamsMPKDataο
Provides the configuration parameters for the plugin. Specification depends on the pluginβs processor type.
- class afe.backends.mpk.defines.EV74ConfigParamsMPKDataο
Configuration parameters for EV74 plugin.
- Parameters:
desired_batch_size β Batch size requested by user.
actual_batch_size β Batch size used in code generation.
kernel β EV74 function.
params β Parameters of the EV74 function.
- desired_batch_size: intο
- actual_batch_size: intο
- kernel: strο
- params: Dict[str, Any]ο
- class afe.backends.mpk.defines.APUConfigParamsMPKDataο
Configuration parameters for APU plugin. :param input_names: Names of the parameters of the APU codeβs entry point function. These
names may be used when passing parameters at runtime. Must have the same length as input_types.
- Parameters:
input_types β Shapes of input tensors, as they should be interpreted by the APU code.
output_types β Shapes of output tensors, as they should be interpreted by the APU code.
- input_names: List[str]ο
- input_types: List[TensorTypeMPKData]ο
- output_types: List[TensorTypeMPKData]ο
- class afe.backends.mpk.defines.MLAConfigParamsMPKDataο
Configuration parameters for MLA plugin.
- Parameters:
desired_batch_size β Batch size requested by user.
actual_batch_size β Batch size used in code generation.
number_of_quads_to_user β Number of quads used in MLA Production Compiler. Must be 4, other values might be supported in the future.
- desired_batch_size: int = 1ο
- actual_batch_size: int = 1ο
- number_of_quads_to_user: int = 4ο
- class afe.backends.mpk.defines.PluginInputNodeMPKDataο
Provides the information of the input node for plugin.
- Parameters:
name β Node name which uniquely identifies the node over the scope of one model file.
size β Size of the nodeβs data in bytes.
- name: strο
- size: intο
- class afe.backends.mpk.defines.PluginResourcesMPKDataο
Provides information about resources used by plugin.
- Parameters:
executable β Name of the generated executable file. The file format depends on which backend the resource belongs to.
- executable: strο
- class afe.backends.mpk.defines.PluginMPKDataο
Provides data containing all information needed to generate MPK JSON data for a single plugin.
- Parameters:
name β Plugin name.
sequence β Pluginβs position in the modelβs execution sequence.
processor β Execution processor for the plugin. It can be either βMLAβ, βEV74β or βA65β.
config_params β Configuration parameters for the plugin.
input_nodes β JSON objects providing information on the inputs for this plugin.
output_nodes β JSON objects providing information on the outputs for this plugin.
type β Plugin type. From the AFEβs perspective, it always has the value βsgpProcessβ.
resources β JSON object providing information about resources used by this plugin.
- name: strο
- sequence: intο
- processor: strο
- config_params: ConfigParamsMPKDataο
- input_nodes: List[PluginInputNodeMPKData]ο
- output_nodes: List[InOutNodesMPKData]ο
- type: str = 'sgpProcess'ο
- resources: PluginResourcesMPKData | None = Noneο
- class afe.backends.mpk.defines.AwesomeNetMPKDataο
Provides data containing all information needed to generate the MPK JSON data for a single model.
- Parameters:
name β Model name.
sequence β Modelβs position in an execution sequence.
input_nodes β An array of JSON objects providing information on the pipelineβs input nodes.
- Param:
plugins: An array of JSON objects, each of which define an invocation of a plugin either on MLA, EV74 or A65.
- name: strο
- sequence: int = 1ο
- model_sdk_version: strο
- input_nodes: List[ModelInputMPKData] = []ο
- plugins: List[PluginMPKData] = []ο
- get_actual_batch_size() int | Noneο
Returns actual batch size from plugins data. Returns None if all plugins are assigned to A65.
Display warnings if plugins have different actual batch sizes.
- get_plugins_backend_distribution() Dictο
Returns number of plugins assigned to MLA, EV74 and A65.