Skip to main content

EvTensorAbi.h File

Mirrored EV-side tensor ABI used to communicate with EV74 kernels. More...

Included Headers

#include <stdint.h>

Classes Index

structsima_ev_abi_header

Common header at the start of every per-op config block. More...

structsima_ev_storage_desc

Device-visible storage backing a tensor descriptor. More...

structsima_ev_strided_desc

Logical strided tensor view (rank + sizes + byte strides). More...

structsima_ev_tiled_desc

Physical tiled tensor view. More...

structsima_ev_quant_desc

Optional quantization metadata. More...

structsima_ev_tensor_desc

Full per-tensor descriptor: dtype, layout, storage, optional quant. More...

structsima_ev_tess_config_v1

Tess (tessellate) op config: 1 input, 1 output. More...

structsima_ev_detess_config_v1

Detess (detessellate) op config: 1 input, 1 output. More...

structsima_ev_quantize_config_v1

Quantize op config: 1 input, 1 output, plus rounding/saturation modes. More...

structsima_ev_dequantize_config_v1

Dequantize op config: 1 input, 1 output. More...

structsima_ev_tensor_list_v1

Multi-tensor IO shell used by kernels like detessdequant. More...

structsima_ev_detessdequant_params_v1

Per-output detessdequant parameters. More...

structsima_ev_detessdequant_config_v1

DetessDequant op config: many inputs, many outputs, per-output params. More...

structsima_ev_roi_v1

Region-of-interest rectangle, in pixels. More...

structsima_ev_preproc_config_v1

Preproc op config: 1 input image, 1 output tensor, plus crop/resize/normalize. More...

Enumerations Index

anonymous enum { ... }

ABI-wide capacity constants and version identifier. More...

enumsima_ev_op_type { ... }

Operation-type tag carried in sima_ev_abi_header::op_type. More...

enumsima_ev_addr_space { ... }

Address-space selector for sima_ev_storage_desc::addr. More...

enumsima_ev_dtype { ... }

Element types the ABI can describe. More...

enumsima_ev_layout_kind { ... }

Layout family carried in sima_ev_tensor_desc::logical_kind/physical_kind. More...

enumsima_ev_axis_semantic { ... }

Optional per-axis semantic tag (advisory metadata). More...

enumsima_ev_quant_scheme { ... }

Quantization scheme tag for sima_ev_quant_desc::scheme. More...

enumsima_ev_round_mode { ... }

Rounding mode used by quantize/cast kernels. More...

Description

Mirrored EV-side tensor ABI used to communicate with EV74 kernels.

This header captures a candidate common ABI for EV kernels so host and firmware can converge on a single tensor/storage contract instead of per-graph ad hoc structs. It is currently a draft proposal — not yet wired into the live EV runtime — but it documents the shape of the per-op config blocks (tess, detess, quantize/dequantize, detessdequant, preproc) and the shared tensor/storage descriptor types they all reference.

The header is C-callable so firmware-side code can include it directly. All values are POD; layout is fixed by the structs themselves.

Enumerations

anonymous enum

anonymous enum

ABI-wide capacity constants and version identifier.

Enumeration values
SIMA_EV_ABI_VERSION_1Current ABI version tag (carried in sima_ev_abi_header) (= 1)
SIMA_EV_MAX_RANKMaximum tensor rank supported by descriptors (= 8)
SIMA_EV_MAX_IOMaximum number of inputs/outputs per multi-IO kernel (= 32)

Definition at line 34 of file EvTensorAbi.h.

sima_ev_addr_space

enum sima_ev_addr_space

Address-space selector for sima_ev_storage_desc::addr.

Enumeration values
SIMA_EV_ADDR_BUSBus address (canonical long-term) (= 0)
SIMA_EV_ADDR_PHYSPhysical address (transitional) (= 1)

Definition at line 54 of file EvTensorAbi.h.

sima_ev_axis_semantic

enum sima_ev_axis_semantic

Optional per-axis semantic tag (advisory metadata).

Enumeration values
SIMA_EV_AXIS_UNKNOWN (= 0)
SIMA_EV_AXIS_NBatch (= 1)
SIMA_EV_AXIS_CChannel (= 2)
SIMA_EV_AXIS_DDepth (= 3)
SIMA_EV_AXIS_HHeight (= 4)
SIMA_EV_AXIS_WWidth (= 5)

Definition at line 81 of file EvTensorAbi.h.

sima_ev_dtype

enum sima_ev_dtype

Element types the ABI can describe.

Enumeration values
SIMA_EV_DTYPE_INVALID (= 0)
SIMA_EV_DTYPE_INT8 (= 1)
SIMA_EV_DTYPE_INT16 (= 2)
SIMA_EV_DTYPE_INT32 (= 3)
SIMA_EV_DTYPE_BF16 (= 4)
SIMA_EV_DTYPE_FP16 (= 5)
SIMA_EV_DTYPE_FP32 (= 6)
SIMA_EV_DTYPE_UINT8 (= 7)
SIMA_EV_DTYPE_UINT16 (= 8)
SIMA_EV_DTYPE_UINT32 (= 9)

Definition at line 60 of file EvTensorAbi.h.

sima_ev_layout_kind

enum sima_ev_layout_kind

Layout family carried in sima_ev_tensor_desc::logical_kind/physical_kind.

Enumeration values
SIMA_EV_LAYOUT_STRIDEDStandard rank/sizes/strides view (= 0)
SIMA_EV_LAYOUT_TILEDTiled view with explicit tile geometry (= 1)
SIMA_EV_LAYOUT_OPAQUEOpaque blob (kernel-private layout) (= 2)

Definition at line 74 of file EvTensorAbi.h.

sima_ev_op_type

enum sima_ev_op_type

Operation-type tag carried in sima_ev_abi_header::op_type.

Enumeration values
SIMA_EV_OP_INVALIDInvalid/unset (= 0)
SIMA_EV_OP_TESSTessellate (= 1)
SIMA_EV_OP_DETESSDetessellate (= 2)
SIMA_EV_OP_QUANTIZEQuantize (= 3)
SIMA_EV_OP_DEQUANTIZEDequantize (= 4)
SIMA_EV_OP_QUANTTESSFused quantize + tessellate (= 5)
SIMA_EV_OP_DETESSDEQUANTFused detessellate + dequantize (= 6)
SIMA_EV_OP_PREPROCImage preprocessing (= 7)
SIMA_EV_OP_CASTElement-type cast (e.g., BF16 ↔ FP32) (= 8)

Definition at line 41 of file EvTensorAbi.h.

sima_ev_quant_scheme

enum sima_ev_quant_scheme

Quantization scheme tag for sima_ev_quant_desc::scheme.

Enumeration values
SIMA_EV_QUANT_NONENo quantization (other fields zeroed) (= 0)
SIMA_EV_QUANT_PER_TENSOR_AFFINESingle (scale, zero-point) for the whole tensor (= 1)
SIMA_EV_QUANT_PER_AXIS_AFFINEPer-axis (scale, zero-point) arrays (= 2)

Definition at line 91 of file EvTensorAbi.h.

sima_ev_round_mode

enum sima_ev_round_mode

Rounding mode used by quantize/cast kernels.

Enumeration values
SIMA_EV_ROUND_DEFAULT (= 0)
SIMA_EV_ROUND_TO_ZERO (= 1)
SIMA_EV_ROUND_TO_EVEN (= 2)
SIMA_EV_ROUND_TO_POS_INF (= 3)
SIMA_EV_ROUND_TO_NEG_INF (= 4)

Definition at line 98 of file EvTensorAbi.h.

File Listing

The file content with the documentation metadata removed is:

1
16#pragma once
17
18#ifdef __cplusplus
19#include <cstdint>
20extern "C" {
21#else
22#include <stdint.h>
23#endif
24
25/*
26 * Draft proposal only.
27 *
28 * This header is not wired into the live EV runtime yet. It captures a
29 * candidate common ABI for EV kernels so host and firmware can converge on one
30 * tensor/storage contract instead of per-graph ad hoc structs.
31 */
32
34enum {
38};
39
51};
52
57};
58
71};
72
78};
79
88};
89
95};
96
104};
105
113 uint16_t abi_version;
114 uint16_t op_type;
115 uint32_t flags;
116 uint32_t num_inputs;
117 uint32_t num_outputs;
118 uint32_t reserved[2];
119};
120
121/*
122 * Device-visible storage. For long-term consistency, BUS should be the
123 * canonical address space, but the field remains explicit during migration.
124 */
133 uint64_t addr;
134 uint64_t nbytes;
135 uint32_t addr_space;
136 uint32_t alignment_bytes;
138 uint64_t reserved0;
139};
140
141/*
142 * Logical tensor view, intentionally close to PyTorch semantics: rank, sizes,
143 * and byte strides are authoritative. Axis semantics are advisory metadata for
144 * validation, debugging, and kernels that want explicit N/C/D/H/W naming.
145 */
154 uint32_t rank;
156 uint8_t reserved0[4];
159};
160
161/*
162 * Physical tiled view. This is separate from the logical view because a tiled
163 * EV buffer is not just a dense tensor with different strides: it also has tile
164 * shape, tile traversal order, inner blocking, and per-tile alignment rules.
165 */
174 uint32_t rank;
178 uint8_t reserved0[4];
181 uint32_t flags;
182};
183
184/*
185 * Optional quantization metadata. Kernels that do not use quantization should
186 * set scheme=SIMA_EV_QUANT_NONE and leave the remaining fields zeroed.
187 */
196 uint32_t scheme;
197 uint32_t quant_axis;
198 float scale;
199 int32_t zero_point;
200 uint64_t scale_addr;
201 uint64_t zero_point_addr;
202 uint32_t param_count;
203 uint32_t reserved0;
204};
205
214 uint32_t dtype;
215 uint32_t logical_kind;
216 uint32_t physical_kind;
217 uint32_t flags;
220 union {
221 struct sima_ev_strided_desc strided;
222 struct sima_ev_tiled_desc tiled;
225};
226
227/*
228 * Single-input/single-output transforms.
229 */
235};
236
242};
243
249 uint32_t round_mode;
250 uint32_t saturate_mode;
251 uint32_t reserved[2];
252};
253
259 uint32_t reserved[4];
260};
261
262/*
263 * Shared multi-IO shell for kernels such as detessdequant that naturally operate
264 * on many heads/tensors per dispatch.
265 */
272 uint32_t count;
273 uint32_t reserved[3];
275};
276
279 uint32_t fp16_output;
280 uint32_t round_mode;
281 uint32_t reserved[2];
282};
283
290};
291
292/*
293 * Example preproc payload. Preproc is intentionally kept as a small per-op
294 * wrapper over the shared tensor descriptors rather than forcing all kernels
295 * into a single giant transform struct.
296 */
299 int32_t x;
300 int32_t y;
301 int32_t width;
302 int32_t height;
303};
304
317 int32_t resize_width;
318 int32_t resize_height;
319 uint32_t color_in;
320 uint32_t color_out;
321 float normalize_scale[4];
322 float normalize_bias[4];
323};
324
325#ifdef __cplusplus
326} /* extern "C" */
327#endif

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.