12 #ifndef ODP_API_SPEC_ML_TYPES_H_
13 #define ODP_API_SPEC_ML_TYPES_H_
14 #include <odp/visibility_begin.h>
74 #define ODP_ML_MAX_DIMS 8
77 #define ODP_ML_DIM_DYNAMIC 0
80 #define ODP_ML_COMPL_MODE_SYNC 0x1u
88 #define ODP_ML_COMPL_MODE_POLL 0x2u
96 #define ODP_ML_COMPL_MODE_EVENT 0x4u
163 void (*
init_fn)(
void *uarea, uint32_t size,
void *
args, uint32_t index);
946 #include <odp/visibility_end.h>
ODP event API type definitions.
Standard C language types and definitions for ODP.
#define ODP_ML_MAX_DIMS
Maximum number of dimensions in input / output data shape.
odp_ml_shape_type_t
Model input / output data shape type.
struct odp_ml_data_format_t odp_ml_data_format_t
Model input / output data format.
struct odp_ml_output_info_t odp_ml_output_info_t
Model output information.
uint32_t odp_ml_compl_mode_t
ML completion mode.
struct odp_ml_quant_info_t odp_ml_quant_info_t
Quantization information.
struct odp_ml_quant_param_t odp_ml_quant_param_t
Quantization parameters.
struct odp_ml_run_result_t odp_ml_run_result_t
Results of model run operation.
#define ODP_ML_MODEL_IO_NAME_LEN
Maximum length of model input/output name, including the null character.
odp_ml_data_type_t
Model input / output data type enumeration.
struct odp_ml_compl_pool_capability_t odp_ml_compl_pool_capability_t
ML completion event pool capabilities.
struct odp_ml_input_info_t odp_ml_input_info_t
Model input information.
struct odp_ml_compl_param_t odp_ml_compl_param_t
ML completion parameters.
#define ODP_ML_MODEL_NAME_LEN
Maximum length of model name, including the null character.
struct odp_ml_capability_t odp_ml_capability_t
Machine learning capabilities.
struct odp_ml_load_result_t odp_ml_load_result_t
Result of model load / unload operation.
struct odp_ml_config_t odp_ml_config_t
Machine learning configuration parameters.
struct odp_ml_model_param_t odp_ml_model_param_t
Machine learning model parameters.
struct odp_ml_data_t odp_ml_data_t
Model input / output data for a model inference run.
struct odp_ml_data_seg_t odp_ml_data_seg_t
Model input / output data segment.
#define ODP_ML_SHAPE_NAME_LEN
Maximum length of data dimension name, including the null character.
struct odp_ml_shape_info_t odp_ml_shape_info_t
Model input / output data shape information.
struct odp_ml_compl_pool_param_t odp_ml_compl_pool_param_t
ML completion event pool parameters.
struct odp_ml_extra_stat_info_t odp_ml_extra_stat_info_t
ML extra statistics counter information.
struct odp_ml_model_info_t odp_ml_model_info_t
Model information.
#define ODP_ML_EXTRA_STAT_NAME_LEN
Maximum length of extra statistics counter name, including the null character.
struct odp_ml_run_param_t odp_ml_run_param_t
Parameters for model run.
@ ODP_ML_SHAPE_STATIC
Static shape of data.
@ ODP_ML_SHAPE_NONE
Type of shape is not defined.
@ ODP_ML_SHAPE_BATCH
Dynamic batch size.
@ ODP_ML_DATA_TYPE_UINT32
32-bit unsigned integer
@ ODP_ML_DATA_TYPE_FP32
32-bit floating point number
@ ODP_ML_DATA_TYPE_FP16
16-bit floating point number
@ ODP_ML_DATA_TYPE_UINT8
8-bit unsigned integer
@ ODP_ML_DATA_TYPE_UINT64
64-bit unsigned integer
@ ODP_ML_DATA_TYPE_UINT24
24-bit unsigned integer
@ ODP_ML_DATA_TYPE_UINT16
16-bit unsigned integer
@ ODP_ML_DATA_TYPE_INT32
32-bit integer
@ ODP_ML_DATA_TYPE_BFP16
16-bit brain floating point (bfloat16) number
@ ODP_ML_DATA_TYPE_FP64
64-bit floating point number
@ ODP_ML_DATA_TYPE_INT64
64-bit integer
@ ODP_ML_DATA_TYPE_INT24
24-bit integer
@ ODP_ML_DATA_TYPE_NONE
Data type is not defined.
@ ODP_ML_DATA_TYPE_INT16
16-bit integer
@ ODP_ML_DATA_TYPE_INT8
8-bit integer
bool odp_bool_t
Boolean type.
Machine learning capabilities.
odp_ml_compl_mode_t compl_mode_mask
Supported completion modes for model load / unload operations.
odp_bool_t compl_queue_sched
Support of model load / unload completion into scheduled queues.
struct odp_ml_capability_t::@91 run
Model run capabilities.
struct odp_ml_capability_t::@90 load
Model load / unload capabilities.
uint32_t min_output_align
Minimum output data alignment in bytes.
odp_bool_t packed_output_data
Output data packing.
uint64_t max_model_size
Maximum model size in bytes.
uint32_t min_input_align
Minimum input data alignment in bytes.
odp_bool_t compl_queue_plain
Support of model load / unload completion into plain queues.
uint32_t max_segs_per_input
Maximum number of data segments per model input.
odp_bool_t packed_input_data
Input data packing.
uint32_t max_compl_id
Maximum completion identifier value.
uint32_t max_segs_per_output
Maximum number of data segments per model output.
odp_ml_compl_pool_capability_t pool
ML completion event pool capabilities.
uint32_t max_models
Maximum number of models.
uint32_t max_models_loaded
Maximum number of models that can be loaded simultaneously.
uint32_t max_inputs
Maximum number of model inputs.
uint32_t max_outputs
Maximum number of model outputs.
ML completion parameters.
odp_event_t event
Completion event.
void * user_ptr
User defined context pointer.
odp_ml_compl_mode_t mode
Completion mode.
uint32_t compl_id
Completion identifier.
odp_queue_t queue
Completion queue.
ML completion event pool capabilities.
uint32_t max_pools
Maximum number of ML completion event pools.
uint32_t max_num
Maximum number of ML completion events in a pool.
uint32_t max_cache_size
Maximum size of local thread cache.
odp_bool_t uarea_persistence
User area persistence.
uint32_t max_uarea_size
Maximum user area size in bytes.
uint32_t min_cache_size
Minimum size of local thread cache.
ML completion event pool parameters.
void(* init_fn)(void *uarea, uint32_t size, void *args, uint32_t index)
See uarea_init.init_fn of odp_pool_param_t for details (odp_pool_param_t.init_fn).
uint32_t uarea_size
User area size in bytes.
uint32_t cache_size
Maximum number of events cached locally per thread.
struct odp_ml_compl_pool_param_t::@89 uarea_init
Parameters for user area initialization.
uint32_t num
Number of ML completion events in the pool.
void * args
See uarea_init.args of odp_pool_param_t for details (odp_pool_param_t.args).
Machine learning configuration parameters.
uint64_t max_model_size
Maximum model binary size in bytes.
odp_ml_compl_mode_t load_mode_mask
Load / unload completion modes.
uint32_t max_models_loaded
Maximum number of models loaded.
uint32_t max_models_created
Maximum number of models.
odp_ml_compl_mode_t run_mode_mask
Run completion modes.
Model input / output data segment.
void * addr
Segment start address.
uint64_t size
Segment size in bytes.
Model input / output data for a model inference run.
uint32_t num_output_seg
Number of output data segments.
uint32_t num_input_seg
Number of input data segments.
odp_ml_data_seg_t * output_seg
Model output data segments.
odp_ml_data_seg_t * input_seg
Model input data segments.
Result of model load / unload operation.
uint64_t error_code
Model load / unload error code.
void * user_ptr
User context pointer value from odp_ml_compl_param_t.
union odp_ml_model_info_t::@92 aux
Auxiliary information regarding the model and its inputs / outputs.
uint64_t model_version
Model version number.
uint64_t interface_version
Model interface version number.
uint32_t num_outputs
Number of model outputs.
uint32_t all
All bits of the bit field structure.
uint32_t input_quant_info
Input quantization information provision.
uint32_t output_quant_info
Output quantization information provision.
char name[ODP_ML_MODEL_NAME_LEN]
Model name.
uint32_t index
Model index assigned by the implementation.
uint32_t num_inputs
Number of model inputs.
Machine learning model parameters.
const odp_ml_model_extra_param_t * extra_param
ODP implementation specific extra parameters.
uint64_t size
Size of the model binary in bytes.
struct odp_ml_model_param_t::@95 extra_info
Extra model information.
odp_bool_t extra_stat_enable
Enable / disable extra statistics counters.
const odp_ml_data_format_t * output_format
Model output data format array.
uint32_t num_outputs
Number of model outputs.
uint32_t max_compl_id
Maximum completion identifier value.
const odp_ml_data_format_t * input_format
Model input data format array.
void * model
Model binary.
uint32_t num_inputs
Number of model inputs.
Model output information.
odp_ml_data_type_t data_type
Model output data type.
odp_ml_shape_info_t shape
Model output data shape.
odp_ml_quant_info_t quant_info
Model output quantization information.
uint32_t data_type_size
Size of model output data type in bytes.
char name[ODP_ML_MODEL_IO_NAME_LEN]
Model output name.
Quantization information.
odp_ml_quant_param_t common
Quantization parameters common to all data values of an input / output.
float scale_fp32
Quantization scale.
odp_ml_data_type_t type
Type of quantization scale value.
int32_t zerop_i32
Quantization zero point.
Parameters for model run.
odp_ml_run_result_t * result
Model run results.
uint32_t batch_size
Batch size.
Results of model run operation.
void * user_ptr
User context pointer value from odp_ml_compl_param_t.
uint64_t error_code
Model run error code.
Model input / output data shape information.
char dim_name[ODP_ML_MAX_DIMS][ODP_ML_SHAPE_NAME_LEN]
Dimension name.
uint32_t dim_min[ODP_ML_MAX_DIMS]
Minimum dimension sizes.
odp_ml_shape_type_t type
Shape type.
uint32_t dim_max[ODP_ML_MAX_DIMS]
Maximum dimension sizes.
uint32_t num_dim
Number of dimensions.
uint32_t dim[ODP_ML_MAX_DIMS]
Dimension sizes.