blob: 6046873cbaedf57cd698f2e9780cc9696201a1be [file] [log] [blame]
Jeremy Johnson77fc6142023-09-04 17:04:21 +01001 {
Won Jeon64e4bfe2024-01-18 06:31:55 +00002 "$comment": "Copyright (c) 2023-2024, ARM Limited.",
Jeremy Johnson77fc6142023-09-04 17:04:21 +01003 "$comment": "SPDX-License-Identifier: Apache-2.0",
4 "$id": "datagen-config.schema.json",
5 "$schema": "https://json-schema.org/draft/2020-12/schema",
6 "title": "datagen-config",
7 "description": "Data generator configuration for generating TOSA tensor data",
8 "type": "object",
9 "properties": {
10 "version": {
11 "description": "version string X.Y of this config data",
12 "type": "string"
13 },
14 "tensors": {
15 "type": "object",
16 "description": "dictionary of input tensors - keys are the tosa network names",
17 "patternProperties":
18 {
19 "^.*$":
20 {
21 "description": "per named tensor config for data generation",
22 "type": "object",
23 "properties": {
24 "generator": {
evacha014a205112024-03-08 16:39:24 +000025 "description": "data generator name - PSEUDO_RANDOM, DOT_PRODUCT, FULL_RANGE, BOUNDARY, or FP_SPECIAL",
Jeremy Johnson77fc6142023-09-04 17:04:21 +010026 "type": "string"
27 },
28 "data_type": {
29 "description": "tensor data type, such as: BOOL, INT16, FP32",
30 "type": "string"
31 },
32 "input_type": {
33 "description": "input is variable or constant",
34 "type": "string"
35 },
36 "shape": {
37 "description": "tensor shape array (rank 0 should be [])",
38 "type": "array",
39 "items": {
40 "description": "shape dimension",
41 "type": "integer",
42 "minimum": 1
43 }
44 },
45 "op": {
46 "description": "operator name the tensor is initially used with",
47 "type": "string"
48 },
49 "input_pos": {
50 "description": "tensor input position for the operator (starts at 0)",
51 "type": "integer",
52 "minimum": 0
53 },
54 "pseudo_random_info": {
55 "description": "info required for the PSEUDO_RANDOM generator",
56 "type": "object",
57 "properties":
58 {
59 "rng_seed": {
60 "description": "random number generator seed",
61 "type": "integer"
62 },
63 "range": {
64 "type": "array",
65 "description": "range of random numbers from low to high inclusively",
66 "minItems": 2,
67 "maxItems": 2,
68 "items": {
69 "description": "[low value, high value] as strings to allow ints and floats",
70 "type": "string"
71 }
Jeremy Johnson30476252023-11-20 16:15:30 +000072 },
73 "round": {
74 "type": "boolean",
75 "description": "force rounding of all values"
Jeremy Johnson77fc6142023-09-04 17:04:21 +010076 }
77 },
78 "additionalProperties": false,
79 "required": [ "rng_seed" ]
80 },
81 "dot_product_info": {
82 "description": "info required for the DOT_PRODUCT generator",
83 "type": "object",
84 "properties":
85 {
86 "s": {
87 "description": "test set 0 to 5 or -1 for other data",
88 "type": "integer"
89 },
90 "ks": {
91 "description": "kernel size for this dot product operation",
Jeremy Johnsond1a08ce2023-10-18 17:22:21 +010092 "type": "integer",
93 "minimum": 0
Jeremy Johnson77fc6142023-09-04 17:04:21 +010094 },
95 "acc_type": {
96 "description": "operator accumulator type (like tensor data_type)",
97 "type": "string"
98 },
99 "kernel": {
100 "type": "array",
Jeremy Johnsond1a08ce2023-10-18 17:22:21 +0100101 "description": "kernel x, y (and z) sizes",
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100102 "minItems": 2,
Jeremy Johnsond1a08ce2023-10-18 17:22:21 +0100103 "maxItems": 3,
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100104 "items": {
105 "description": "kernel dimension",
106 "type": "integer",
107 "minimum": 1
108 }
109 },
110 "axis": {
111 "description": "axis dimension (for reduce_sum)",
112 "type": "integer",
113 "minimum": 0
114 }
115 },
116 "additionalProperties": false,
117 "required": [
118 "s",
119 "ks",
120 "acc_type"
121 ]
122 },
evacha019c96eef2024-02-07 11:21:55 +0000123 "full_range_info": {
124 "description": "info required for the FULL_RANGE generator",
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100125 "type": "object",
126 "properties":
127 {
evacha019c96eef2024-02-07 11:21:55 +0000128 "start_val": {
129 "description": "starting value of the test data",
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100130 "type": "integer",
131 "minimum": 0
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100132 }
133 },
134 "additionalProperties": false,
evacha019c96eef2024-02-07 11:21:55 +0000135 "required": [ ]
Won Jeon64e4bfe2024-01-18 06:31:55 +0000136 },
evacha014a205112024-03-08 16:39:24 +0000137 "fp_special_info": {
138 "description": "info required for the FP_SPECIAL generator",
139 "type": "object",
140 "properties":
141 {
142 "start_idx": {
143 "description": "starting index for the test data",
144 "type": "integer",
145 "minimum": 0
146 }
147 },
148 "additionalProperties": false,
149 "required": [ ]
150 },
Won Jeon64e4bfe2024-01-18 06:31:55 +0000151 "fixed_data_info": {
152 "description": "info required for FIXED_DATA generator",
153 "type": "object",
154 "properties":
155 {
156 "data": {
157 "description": "flattened fixed data",
158 "type": "array",
159 "items": {
160 "description": "integer tensor data",
161 "type": "integer"
162 }
163 }
164 },
165 "additionalProperties": false,
166 "required": [ "data" ]
Jeremy Johnson77fc6142023-09-04 17:04:21 +0100167 }
168 },
169 "additionalProperties": false,
170 "required": [
171 "generator",
172 "data_type",
173 "input_type",
174 "shape",
175 "op",
176 "input_pos"
177 ]
178 }
179 }
180 }
181 },
182 "additionalProperties": false,
183 "required": [
184 "version",
185 "tensors"
186 ]
187}