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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- nameο
Model name.
- sequenceο
Modelβs position in an execution sequence.
- model_pathο
Original model path.
- model_checksumο
Original model checksum.
- input_nodesο
An array of JSON objects providing information on the pipelineβs input nodes.
- pluginsο
An array of JSON objects, each of which define an invocation of a plugin either on MLA, EV74 or A65.
- name: strο
- model_path: strο
- model_checksum: 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.