blob: 01f9fadd417342d0620bd91cefed8bd39acd4286 [file] [log] [blame]
Jeremy Johnson77fc6142023-09-04 17:04:21 +01001 {
2 "$comment": "Copyright (c) 2023, ARM Limited.",
3 "$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": {
25 "description": "data generator name - PSEUDO_RANDOM, DOT_PRODUCT or OP_SPECIFIC",
26 "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 }
72 }
73 },
74 "additionalProperties": false,
75 "required": [ "rng_seed" ]
76 },
77 "dot_product_info": {
78 "description": "info required for the DOT_PRODUCT generator",
79 "type": "object",
80 "properties":
81 {
82 "s": {
83 "description": "test set 0 to 5 or -1 for other data",
84 "type": "integer"
85 },
86 "ks": {
87 "description": "kernel size for this dot product operation",
88 "type": "integer"
89 },
90 "acc_type": {
91 "description": "operator accumulator type (like tensor data_type)",
92 "type": "string"
93 },
94 "kernel": {
95 "type": "array",
96 "description": "kernel x, y sizes (for avg_pool2d)",
97 "minItems": 2,
98 "maxItems": 2,
99 "items": {
100 "description": "kernel dimension",
101 "type": "integer",
102 "minimum": 1
103 }
104 },
105 "axis": {
106 "description": "axis dimension (for reduce_sum)",
107 "type": "integer",
108 "minimum": 0
109 }
110 },
111 "additionalProperties": false,
112 "required": [
113 "s",
114 "ks",
115 "acc_type"
116 ]
117 },
118 "op_specific_info": {
119 "description": "info required for the OP_SPECIFIC generator",
120 "type": "object",
121 "properties":
122 {
123 "sub_generator": {
124 "description": "sub generator type for this op - FULL, SPECIAL or BOUNDARY",
125 "type": "string"
126 },
127 "offset": {
128 "description": "starting offset within the test data",
129 "type": "integer",
130 "minimum": 0
131 },
132 "attributes": {
133 "description": "attribute data from the op needed to compute the data",
134 "type": "object",
135 "properties": {
136 "TBD": {
137 "description": "Probably needed for RESCALE and MUL",
138 "type": "string"
139 }
140 }
141 }
142 },
143 "additionalProperties": false,
144 "required": [ "sub_generator" ]
145 }
146 },
147 "additionalProperties": false,
148 "required": [
149 "generator",
150 "data_type",
151 "input_type",
152 "shape",
153 "op",
154 "input_pos"
155 ]
156 }
157 }
158 }
159 },
160 "additionalProperties": false,
161 "required": [
162 "version",
163 "tensors"
164 ]
165}