Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 1 | { |
Won Jeon | 64e4bfe | 2024-01-18 06:31:55 +0000 | [diff] [blame] | 2 | "$comment": "Copyright (c) 2023-2024, ARM Limited.", |
Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 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 | } |
Jeremy Johnson | 3047625 | 2023-11-20 16:15:30 +0000 | [diff] [blame] | 72 | }, |
| 73 | "round": { |
| 74 | "type": "boolean", |
| 75 | "description": "force rounding of all values" |
Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 76 | } |
| 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 Johnson | d1a08ce | 2023-10-18 17:22:21 +0100 | [diff] [blame] | 92 | "type": "integer", |
| 93 | "minimum": 0 |
Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 94 | }, |
| 95 | "acc_type": { |
| 96 | "description": "operator accumulator type (like tensor data_type)", |
| 97 | "type": "string" |
| 98 | }, |
| 99 | "kernel": { |
| 100 | "type": "array", |
Jeremy Johnson | d1a08ce | 2023-10-18 17:22:21 +0100 | [diff] [blame] | 101 | "description": "kernel x, y (and z) sizes", |
Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 102 | "minItems": 2, |
Jeremy Johnson | d1a08ce | 2023-10-18 17:22:21 +0100 | [diff] [blame] | 103 | "maxItems": 3, |
Jeremy Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 104 | "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 | }, |
| 123 | "op_specific_info": { |
| 124 | "description": "info required for the OP_SPECIFIC generator", |
| 125 | "type": "object", |
| 126 | "properties": |
| 127 | { |
| 128 | "sub_generator": { |
| 129 | "description": "sub generator type for this op - FULL, SPECIAL or BOUNDARY", |
| 130 | "type": "string" |
| 131 | }, |
| 132 | "offset": { |
| 133 | "description": "starting offset within the test data", |
| 134 | "type": "integer", |
| 135 | "minimum": 0 |
| 136 | }, |
| 137 | "attributes": { |
| 138 | "description": "attribute data from the op needed to compute the data", |
| 139 | "type": "object", |
| 140 | "properties": { |
| 141 | "TBD": { |
| 142 | "description": "Probably needed for RESCALE and MUL", |
| 143 | "type": "string" |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | }, |
| 148 | "additionalProperties": false, |
| 149 | "required": [ "sub_generator" ] |
Won Jeon | 64e4bfe | 2024-01-18 06:31:55 +0000 | [diff] [blame] | 150 | }, |
| 151 | "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 Johnson | 77fc614 | 2023-09-04 17:04:21 +0100 | [diff] [blame] | 167 | } |
| 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 | } |