aboutsummaryrefslogtreecommitdiff
path: root/scripts/schemavalidation/datagen-config.schema.json
blob: 19e8b62736cacdcbfb81e1147b7008360adb1f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
 {
    "$comment": "Copyright (c) 2023-2024, ARM Limited.",
    "$comment": "SPDX-License-Identifier: Apache-2.0",
    "$id": "datagen-config.schema.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "datagen-config",
    "description": "Data generator configuration for generating TOSA tensor data",
    "type": "object",
    "properties": {
        "version": {
            "description": "version string X.Y of this config data",
            "type": "string"
        },
        "tensors": {
            "type": "object",
            "description": "dictionary of input tensors - keys are the tosa network names",
            "patternProperties":
            {
                "^.*$":
                {
                    "description": "per named tensor config for data generation",
                    "type": "object",
                    "properties": {
                        "generator": {
                            "description": "data generator name - PSEUDO_RANDOM, DOT_PRODUCT, FULL_RANGE, BOUNDARY, or SPECIAL",
                            "type": "string"
                        },
                        "data_type": {
                            "description": "tensor data type, such as: BOOL, INT16, FP32",
                            "type": "string"
                        },
                        "input_type": {
                            "description": "input is variable or constant",
                            "type": "string"
                        },
                        "shape": {
                            "description": "tensor shape array (rank 0 should be [])",
                            "type": "array",
                            "items": {
                                "description": "shape dimension",
                                "type": "integer",
                                "minimum": 1
                            }
                        },
                        "op": {
                            "description": "operator name the tensor is initially used with",
                            "type": "string"
                        },
                        "input_pos": {
                            "description": "tensor input position for the operator (starts at 0)",
                            "type": "integer",
                            "minimum": 0
                        },
                        "pseudo_random_info": {
                            "description": "info required for the PSEUDO_RANDOM generator",
                            "type": "object",
                            "properties":
                            {
                                "rng_seed": {
                                    "description": "random number generator seed",
                                    "type": "integer"
                                },
                                "range": {
                                    "type": "array",
                                    "description": "range of random numbers from low to high inclusively",
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "items": {
                                        "description": "[low value, high value] as strings to allow ints and floats",
                                        "type": "string"
                                    }
                                },
                                "round": {
                                    "type": "boolean",
                                    "description": "force rounding of all values"
                                }
                            },
                            "additionalProperties": false,
                            "required": [ "rng_seed" ]
                        },
                        "dot_product_info": {
                            "description": "info required for the DOT_PRODUCT generator",
                            "type": "object",
                            "properties":
                            {
                                "s": {
                                    "description": "test set 0 to 5 or -1 for other data",
                                    "type": "integer"
                                },
                                "ks": {
                                    "description": "kernel size for this dot product operation",
                                    "type": "integer",
                                    "minimum": 0
                                },
                                "acc_type": {
                                    "description": "operator accumulator type (like tensor data_type)",
                                    "type": "string"
                                },
                                "kernel": {
                                    "type": "array",
                                    "description": "kernel x, y (and z) sizes",
                                    "minItems": 2,
                                    "maxItems": 3,
                                    "items": {
                                        "description": "kernel dimension",
                                        "type": "integer",
                                        "minimum": 1
                                    }
                                },
                                "axis": {
                                    "description": "axis dimension (for reduce_sum)",
                                    "type": "integer",
                                    "minimum": 0
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "s",
                                "ks",
                                "acc_type"
                            ]
                        },
                        "full_range_info": {
                            "description": "info required for the FULL_RANGE generator",
                            "type": "object",
                            "properties":
                            {
                                "start_val": {
                                    "description": "starting value of the test data",
                                    "type": "integer",
                                    "minimum": 0
                                }
                            },
                            "additionalProperties": false,
                            "required": [ ]
                        },
                        "fixed_data_info": {
                            "description": "info required for FIXED_DATA generator",
                            "type": "object",
                            "properties":
                            {
                                "data": {
                                    "description": "flattened fixed data",
                                    "type": "array",
                                    "items": {
                                        "description": "integer tensor data",
                                        "type": "integer"
                                    }
                                }
                            },
                            "additionalProperties": false,
                            "required": [ "data" ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "generator",
                        "data_type",
                        "input_type",
                        "shape",
                        "op",
                        "input_pos"
                    ]
                }
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "version",
        "tensors"
    ]
}