uint64_t model_version;
/** About input/output/intermediate DRAM buffer format, for the first input and the last output, which are required for host communication. */
- uint64_t
- buffer_size; /**< Total buffer size to cover all data (i.e., allocate DRAM size) */
- uint64_t size; /**< Size of this model, including this meta */
- model_opmode
- type; /**< Type of the model, consistent with model_opmode. Refer to typedef.h */
- uint32_t dummy; /**< FIXME: Dummy field to keep an aligned offset */
+
+ uint64_t buffer_size;
+ /**< [v1-only] Total buffer size to cover all data (i.e., allocate DRAM size) */
+ uint64_t size;
+ /**< Size of this model, including this meta */
+ model_opmode type;
+ /**< Type of the model, consistent with model_opmode. Refer to typedef.h */
+ uint32_t dummy;
+ /**< FIXME: Dummy field to keep an aligned offset */
/**
* If input comes from host, the buffer may be filled with input data.
*/
/** input tensor details */
- uint32_t input_num; /**< Number of input tensors (<= MAX_TENSORS) */
- uint32_t input_offsets
- [MAX_TENSORS]; /**< offsets for input tensors; each tensor would be not contiguous */
-
- uint32_t input_elem_size
- [MAX_TENSORS]; /**< input per-element size (in bytes) */
- uint32_t input_dims[MAX_TENSORS]
- [MAX_RANK]; /**< input dimensions (N, H, W, C) */
-
- uint32_t
- input_emod_y[MAX_TENSORS]; /**< input addressing info (emod_y) */
- uint32_t
- input_emod_z[MAX_TENSORS]; /**< input addressing info (emod_z) */
- uint32_t input_quant_z
- [MAX_TENSORS]; /**< input quantization parameter (zero-point) */
- float input_quant_s
- [MAX_TENSORS]; /**< input quantization parameter (scale) */
+ uint32_t input_num;
+ /**< Number of input tensors (<= MAX_TENSORS) */
+ uint32_t input_offsets[MAX_TENSORS];
+ /**< offsets for input tensors; each tensor would be not contiguous */
+ uint32_t input_elem_size[MAX_TENSORS];
+ /**< input per-element size (in bytes) */
+ uint32_t input_dims[MAX_TENSORS][MAX_RANK];
+ /**< input dimensions (N, H, W, C) */
+
+ uint32_t input_emod_y[MAX_TENSORS];
+ /**< input addressing info (emod_y) */
+ uint32_t input_emod_z[MAX_TENSORS];
+ /**< input addressing info (emod_z) */
+
+ uint32_t input_quant_z[MAX_TENSORS];
+ /**< input quantization parameter (zero-point) */
+ float input_quant_s[MAX_TENSORS];
+ /**< input quantization parameter (scale) */
/** output tensor details */
- uint32_t output_num; /**< Number of output tensors (<= MAX_TENSORS) */
- uint32_t output_offsets
- [MAX_TENSORS]; /**< offsets for output tensors; each tensor would be not contiguous */
-
- uint32_t output_elem_size
- [MAX_TENSORS]; /**< output per-element size (in bytes) */
- uint32_t output_dims[MAX_TENSORS]
- [MAX_RANK]; /**< output dimensions (N, H, W, C) */
-
- uint32_t output_emod_y
- [MAX_TENSORS]; /**< output addressing info (emod_y) */
- uint32_t output_emod_z
- [MAX_TENSORS]; /**< output addressing info (emod_z) */
-
- uint32_t output_quant_z
- [MAX_TENSORS]; /**< output quantization parameter (zero-point) */
- float output_quant_s
- [MAX_TENSORS]; /**< output quantization parameter (scale) */
+
+ uint32_t output_num;
+ /**< Number of output tensors (<= MAX_TENSORS) */
+ uint32_t output_offsets[MAX_TENSORS];
+ /**< offsets for output tensors; each tensor would be not contiguous */
+ uint32_t output_elem_size[MAX_TENSORS];
+ /**< output per-element size (in bytes) */
+ uint32_t output_dims[MAX_TENSORS][MAX_RANK];
+ /**< output dimensions (N, H, W, C) */
+
+ uint32_t output_emod_y[MAX_TENSORS];
+ /**< output addressing info (emod_y) */
+ uint32_t output_emod_z[MAX_TENSORS];
+ /**< output addressing info (emod_z) */
+
+ uint32_t output_quant_z[MAX_TENSORS];
+ /**< output quantization parameter (zero-point) */
+ float output_quant_s[MAX_TENSORS];
+ /**< output quantization parameter (scale) */
};
struct {
/**
*/
/** segments to hold input/weight/output data */
- uint32_t segment_num; /**< number of total segments */
- uint32_t segment_size[MAX_SEGMENTS]; /**< size of each segment */
+ uint32_t segment_num;
+ /**< number of total segments */
+ uint32_t segment_size[MAX_SEGMENTS];
+ /**< size of each segment */
/** model weight segment */
- uint32_t weight_seg_idx; /**< segment index for model weight */
+ uint32_t weight_seg_idx;
+ /**< segment index for model weight */
/** input tensor segment */
- uint32_t
- input_seg_num; /**< Number of input tensors (<= MAX_TENSORS) */
- uint32_t input_seg_idx
- [MAX_TENSORS]; /**< segment index for input tensors */
- uint32_t input_seg_off
- [MAX_TENSORS]; /**< segment offset for input tensors */
- uint32_t input_seg_dims
- [MAX_TENSORS]
- [MAX_RANK]; /**< input tensor dimensions (N, H, W, C) */
-
- uint32_t input_seg_emod_y
- [MAX_TENSORS]; /**< input tensor addressing info (emod_y) */
- uint32_t input_seg_emod_z
- [MAX_TENSORS]; /**< input tensor addressing info (emod_z) */
-
- data_type input_seg_quant_type
- [MAX_TENSORS]; /**< input quantization data type */
- int32_t input_seg_quant_z
- [MAX_TENSORS]; /**< input quantization parameter (zero-point) */
- float input_seg_quant_s
- [MAX_TENSORS]; /**< input quantization parameter (scale) */
+ uint32_t input_seg_num;
+ /**< Number of input tensors (<= MAX_TENSORS) */
+ uint32_t input_seg_idx[MAX_TENSORS];
+ /**< segment index for input tensors */
+ uint32_t input_seg_off[MAX_TENSORS];
+ /**< segment offset for input tensors */
+ uint32_t input_seg_dims[MAX_TENSORS][MAX_RANK];
+ /**< input tensor dimensions (N, H, W, C) */
+
+ uint32_t input_seg_emod_y[MAX_TENSORS];
+ /**< input tensor addressing info (emod_y) */
+ uint32_t input_seg_emod_z[MAX_TENSORS];
+ /**< input tensor addressing info (emod_z) */
+
+ data_type input_seg_quant_type[MAX_TENSORS];
+ /**< input quantization data type */
+ int32_t input_seg_quant_z[MAX_TENSORS];
+ /**< input quantization parameter (zero-point) */
+ float input_seg_quant_s[MAX_TENSORS];
+ /**< input quantization parameter (scale) */
/** output tensor segment */
- uint32_t
- output_seg_num; /**< Number of output tensors (<= MAX_TENSORS) */
- uint32_t output_seg_idx
- [MAX_TENSORS]; /**< segment index for output tensors */
- uint32_t output_seg_off
- [MAX_TENSORS]; /**< segment offset for output tensors */
- uint32_t output_seg_dims
- [MAX_TENSORS]
- [MAX_RANK]; /**< output tensor dimensions (N, H, W, C) */
-
- uint32_t output_seg_emod_y
- [MAX_TENSORS]; /**< output tensor addressing info (emod_y) */
- uint32_t output_seg_emod_z
- [MAX_TENSORS]; /**< output tensor addressing info (emod_z) */
-
- data_type output_seg_quant_type
- [MAX_TENSORS]; /**< output quantization data type */
- int32_t output_seg_quant_z
- [MAX_TENSORS]; /**< output quantization parameter (zero-point) */
- float output_seg_quant_s
- [MAX_TENSORS]; /**< output quantization parameter (scale) */
+ uint32_t output_seg_num;
+ /**< Number of output tensors (<= MAX_TENSORS) */
+ uint32_t output_seg_idx[MAX_TENSORS];
+ /**< segment index for output tensors */
+ uint32_t output_seg_off[MAX_TENSORS];
+ /**< segment offset for output tensors */
+ uint32_t output_seg_dims[MAX_TENSORS][MAX_RANK];
+ /**< output tensor dimensions (N, H, W, C) */
+
+ uint32_t output_seg_emod_y[MAX_TENSORS];
+ /**< output tensor addressing info (emod_y) */
+ uint32_t output_seg_emod_z[MAX_TENSORS];
+ /**< output tensor addressing info (emod_z) */
+
+ data_type output_seg_quant_type[MAX_TENSORS];
+ /**< output quantization data type */
+ int32_t output_seg_quant_z[MAX_TENSORS];
+ /**< output quantization parameter (zero-point) */
+ float output_seg_quant_s[MAX_TENSORS];
+ /**< output quantization parameter (scale) */
/** DSP-specific variables */
- uint32_t
- dspm_size; /**< The data scratch-pad memory (dspm) size of the DSP */
+ uint32_t dspm_size;
+ /**< The data scratch-pad memory (dspm) size of the DSP */
/** vISA instructions */
- uint32_t
- visa_num_plus_one; /**< Number of vISA insts + 1 (i.e., unknown if zero) */
+ uint32_t visa_num_plus_one;
+ /**< Number of vISA insts + 1 (i.e., unknown if zero) */
};
/** If npubinfmt should be changed, append here as another version */
};
* @brief Extended metadata for profiling (obtained from a compiler)
*/
typedef struct {
- uint32_t
- total_size; /**< actual size of extended metadata, not 4K-multiplied one */
-
- uint32_t node_table_size; /**< size of a node table (node ID to node name) */
- uint32_t visa_table_size; /**< size of a visa table (visa ID to node ID) */
-
- uint32_t node_entry_num; /**< total number of node entries */
- uint32_t
- visa_entry_num; /**< total number of visa entries (i.e., number of vISA insts) */
+ uint32_t total_size;
+ /**< actual size of extended metadata, not 4K-multiplied one */
+
+ uint32_t node_table_size;
+ /**< size of a node table (node ID to node name) */
+ uint32_t visa_table_size;
+ /**< size of a visa table (visa ID to node ID) */
+
+ uint32_t node_entry_num;
+ /**< total number of node entries */
+ uint32_t visa_entry_num;
+ /**< total number of visa entries (i.e., number of vISA insts) */
/**
* The below shows the data format that 'entry_data' should have (little endian).