File size: 8,880 Bytes
a44211c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{
  "op": "com.microsoft.BiasAdd",
  "cases": [
    {
      "name": "dispatch_cliff_scalar_f32",
      "inputs": {
        "X": { "dtype": "float32", "shape": [1, 5592321, 3], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } },
        "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -1.0, 2.0] } },
        "skip": { "dtype": "float32", "shape": [1, 5592321, 3], "data": { "kind": "constant", "value": 0.25 } }
      },
      "outputs": { "Y": { "dtype": "float32", "shape": [1, 5592321, 3], "tolerance": 0.00001 } }
    },
    {
      "name": "ort_fused_skip_bias_channels",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc",
        "test": "BiasAddTest.BiasAddTest_HiddenSize_320",
        "notes": "Small deterministic projection of the ORT fused skip+bias channel pattern."
      },
      "inputs": {
        "X": {
          "dtype": "float32",
          "shape": [2, 2, 3],
          "data": { "kind": "values", "values": [-1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, -2.0, -3.0, -4.0] }
        },
        "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -1.0, 2.0] } },
        "skip": {
          "dtype": "float32",
          "shape": [2, 2, 3],
          "data": { "kind": "values", "values": [10.0, 10.0, 10.0, -1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
        }
      },
      "outputs": {
        "Y": {
          "dtype": "float32",
          "shape": [2, 2, 3],
          "data": { "kind": "values", "values": [9.5, 9.0, 13.0, 1.5, 1.0, 5.0, 5.5, 6.0, 11.0, 1.5, 0.0, 3.0] }
        }
      }
    },
    {
      "name": "ort_fused_skip_bias_singleton_image_f16",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc",
        "test": "BiasAddTest.BiasAddTest_HiddenSize_640",
        "notes": "Small deterministic float16 projection of the ORT singleton image-size path."
      },
      "inputs": {
        "X": {
          "dtype": "float16",
          "shape": [2, 1, 4],
          "data": { "kind": "values", "values": [-1.0, -0.5, 0.5, 1.0, 2.0, -2.0, 0.25, -0.25] }
        },
        "bias": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.5, -1.0, 1.5, -0.5] } },
        "skip": {
          "dtype": "float16",
          "shape": [2, 1, 4],
          "data": { "kind": "values", "values": [1.0, 2.0, -1.0, -2.0, -0.5, 0.5, 1.0, -1.0] }
        }
      },
      "outputs": {
        "Y": {
          "dtype": "float16",
          "shape": [2, 1, 4],
          "data": { "kind": "values", "values": [0.5, 0.5, 1.0, -1.5, 2.0, -2.5, 2.75, -1.75] }
        }
      }
    },
    {
      "name": "ort_fused_skip_bias_vec4_f32",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc",
        "test": "BiasAddTest.BiasAddTest_HiddenSize_1280",
        "notes": "Small deterministic projection with hidden size divisible by 4, matching the ORT channel-bias pattern and exercising the vec4 path."
      },
      "inputs": {
        "X": {
          "dtype": "float32",
          "shape": [1, 2, 4],
          "data": { "kind": "values", "values": [-4.0, -1.0, 0.0, 2.0, 5.0, 6.0, -7.0, 8.0] }
        },
        "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.5, -0.25, 1.0, -2.0] } },
        "skip": {
          "dtype": "float32",
          "shape": [1, 2, 4],
          "data": { "kind": "values", "values": [10.0, 0.0, -1.0, 1.0, -5.0, 2.0, 3.0, -4.0] }
        }
      },
      "outputs": {
        "Y": {
          "dtype": "float32",
          "shape": [1, 2, 4],
          "tolerance": 0,
          "data": { "kind": "values", "values": [6.5, -1.25, 0.0, 1.0, 0.5, 7.75, -3.0, 2.0] }
        }
      }
    },
    {
      "name": "f32_hidden320_vec4_compact",
      "inputs": {
        "X": {
          "dtype": "float32",
          "shape": [2, 16, 320],
          "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.5 }
        },
        "bias": {
          "dtype": "float32",
          "shape": [320],
          "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.17, "scale": 0.25 }
        },
        "skip": {
          "dtype": "float32",
          "shape": [2, 16, 320],
          "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.11, "scale": 0.25 }
        }
      },
      "outputs": { "Y": { "dtype": "float32", "shape": [2, 16, 320], "tolerance": 0.000001 } }
    },
    {
      "name": "ort_fused_skip_bias_scalar_f16",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc",
        "test": "BiasAddTest.BiasAddTest_HiddenSize_768",
        "notes": "Small deterministic float16 projection with hidden size not divisible by 4, so the scalar path covers ORT's fused skip+bias pattern."
      },
      "inputs": {
        "X": {
          "dtype": "float16",
          "shape": [1, 3, 3],
          "data": { "kind": "values", "values": [0.5, -0.5, 1.0, 2.0, -2.0, 0.25, -0.25, 4.0, -4.0] }
        },
        "bias": { "dtype": "float16", "shape": [3], "data": { "kind": "values", "values": [0.25, -1.5, 2.0] } },
        "skip": {
          "dtype": "float16",
          "shape": [1, 3, 3],
          "data": { "kind": "values", "values": [1.0, 2.0, 3.0, -1.0, -2.0, -3.0, 0.5, -0.5, 1.0] }
        }
      },
      "outputs": {
        "Y": {
          "dtype": "float16",
          "shape": [1, 3, 3],
          "tolerance": 0,
          "data": { "kind": "values", "values": [1.75, 0.0, 6.0, 1.25, -5.5, -0.75, 0.5, 2.0, -1.0] }
        }
      }
    },
    {
      "name": "ort_fused_skip_bias_image3_vec4_f32",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc",
        "test": "BiasAddTest.BiasAddTest_HiddenSize_1536",
        "notes": "Small deterministic projection of ORT's batch=1, image_size=3, channel-bias path with hidden size divisible by 4."
      },
      "inputs": {
        "X": {
          "dtype": "float32",
          "shape": [1, 3, 4],
          "data": { "kind": "values", "values": [-2.0, -1.0, 0.0, 1.0, 2.0, 3.0, -3.0, -2.0, 4.0, -4.0, 0.5, -0.5] }
        },
        "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.25, -0.5, 1.5, -1.25] } },
        "skip": {
          "dtype": "float32",
          "shape": [1, 3, 4],
          "data": { "kind": "values", "values": [10.0, 0.0, -10.0, 2.0, -1.0, 1.0, 3.0, -3.0, 0.5, -0.5, 2.0, -2.0] }
        }
      },
      "outputs": {
        "Y": {
          "dtype": "float32",
          "shape": [1, 3, 4],
          "tolerance": 0,
          "data": {
            "kind": "values",
            "values": [8.25, -1.5, -8.5, 1.75, 1.25, 3.5, 1.5, -6.25, 4.75, -5.0, 4.0, -3.75]
          }
        }
      }
    },
    {
      "name": "empty_zero_dim",
      "inputs": {
        "X": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } },
        "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } },
        "skip": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }
      },
      "outputs": { "Y": { "dtype": "float32", "shape": [1, 0, 4], "tolerance": 0 } }
    },
    {
      "name": "empty_zero_dim_f16",
      "inputs": {
        "X": { "dtype": "float16", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } },
        "bias": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } },
        "skip": { "dtype": "float16", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }
      },
      "outputs": { "Y": { "dtype": "float16", "shape": [1, 0, 4], "tolerance": 0 } }
    },
    {
      "name": "empty_zero_hidden",
      "inputs": {
        "X": { "dtype": "float32", "shape": [1, 2, 0], "data": { "kind": "values", "values": [] } },
        "bias": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } },
        "skip": { "dtype": "float32", "shape": [1, 2, 0], "data": { "kind": "values", "values": [] } }
      },
      "outputs": { "Y": { "dtype": "float32", "shape": [1, 2, 0], "tolerance": 0 } }
    },
    {
      "name": "scalar_hidden5_bias_broadcast_row_wrap",
      "inputs": {
        "X": { "dtype": "float32", "shape": [1, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
        "bias": {
          "dtype": "float32",
          "shape": [5],
          "data": { "kind": "values", "values": [0.5, -1.0, 2.0, -0.25, 1.5] }
        },
        "skip": { "dtype": "float32", "shape": [1, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": -1.0 } }
      },
      "outputs": { "Y": { "dtype": "float32", "shape": [1, 3, 5], "tolerance": 0.000001 } }
    }
  ]
}