File size: 10,052 Bytes
1098d2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{
  "op": "com.microsoft.BiasGelu",
  "cases": [
    {
      "name": "dispatch_cliff_vec4_f32",
      "requires": { "limits": { "maxBufferSize": 268435488, "maxStorageBufferBindingSize": 268435488 } },
      "provenance": {
        "notes": "Its largest tensor is 268435488 bytes, so the case needs an adapter whose maxBufferSize and maxStorageBufferBindingSize both reach it — declared, because the WebGPU guaranteed minimums (256 MiB / 128 MiB) do not, and a device at them must report the case inapplicable rather than fail allocating it."
      },
      "inputs": {
        "A": { "dtype": "float32", "shape": [8388609, 8], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
        "B": {
          "dtype": "float32",
          "shape": [8],
          "data": { "kind": "values", "values": [0.25, -0.25, 0.5, -0.5, 0.1, -0.1, 0.0, 1.0] }
        }
      },
      "outputs": { "C": { "dtype": "float32", "shape": [8388609, 8], "tolerance": 0.0001 } }
    },
    {
      "name": "ort_float32_rank2_bias_vector",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "Small deterministic rank-2 instance of ORT's bias-vector GELU coverage."
      },
      "inputs": {
        "A": {
          "dtype": "float32",
          "shape": [2, 4],
          "data": { "kind": "values", "values": [-1.5, -0.5, 0.5, 1.5, 2.0, -2.0, 0.25, -0.25] }
        },
        "B": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.25, -0.25, 0.5, -0.5] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [2, 4],
          "tolerance": 0.000001,
          "data": {
            "kind": "values",
            "values": [-0.13206221, -0.16997051, 0.8413447, 0.8413447, 2.222495, -0.02750505, 0.5800295, -0.16997051]
          }
        }
      }
    },
    {
      "name": "ort_float16_rank2_bias_vector",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.MLFloat16",
        "notes": "Compact deterministic f16 projection of ORT's bias-vector GELU coverage."
      },
      "inputs": {
        "A": {
          "dtype": "float16",
          "shape": [2, 4],
          "data": { "kind": "values", "values": [-1.5, -0.5, 0.5, 1.5, 2.0, -2.0, 0.25, -0.25] }
        },
        "B": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.25, -0.25, 0.5, -0.5] } }
      },
      "outputs": {
        "C": {
          "dtype": "float16",
          "shape": [2, 4],
          "tolerance": 0.001,
          "data": {
            "kind": "values",
            "values": [-0.1320623, -0.16997046, 0.8413447, 0.8413447, 2.222495, -0.02750498, 0.58002954, -0.16997046]
          }
        }
      }
    },
    {
      "name": "ort_float32_rank3_bias_vector",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "Small deterministic rank-3 instance of ORT's bias-vector GELU coverage."
      },
      "inputs": {
        "A": {
          "dtype": "float32",
          "shape": [2, 2, 3],
          "data": { "kind": "values", "values": [-1.0, 0.0, 1.0, 2.0, -2.0, 0.5, -0.5, 0.25, -0.25, 3.0, -3.0, 0.0] }
        },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -0.5, 0.25] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [2, 2, 3],
          "tolerance": 0.000001,
          "data": {
            "kind": "values",
            "values": [-0.15426877, -0.15426877, 1.1179378, 2.4844761, -0.015524104, 0.58002949, 0.0, -0.10032342, 0.0, 3.4991858, -0.00081422925, 0.14967658]
          }
        }
      }
    },
    {
      "name": "ort_float32_rank4_bias_vector",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "Small deterministic rank-4 instance of ORT's bias-vector GELU coverage."
      },
      "inputs": {
        "A": {
          "dtype": "float32",
          "shape": [1, 2, 2, 3],
          "data": { "kind": "values", "values": [-1.0, 0.0, 1.0, 2.0, -2.0, 0.5, -0.5, 0.25, -0.25, 3.0, -3.0, 0.0] }
        },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.25, -0.25, 0.5] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [1, 2, 2, 3],
          "tolerance": 0.000001,
          "data": {
            "kind": "values",
            "values": [-0.16997051, -0.10032342, 1.3997892, 2.2224948, -0.027505063, 0.8413447, -0.10032342, 0.0, 0.14967658, 3.2481246, -0.0018753314, 0.34573123]
          }
        }
      }
    },
    {
      "name": "ort_float32_empty_middle_dim",
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "Additional edge: empty tensors should preserve shape and produce no values."
      },
      "inputs": {
        "A": { "dtype": "float32", "shape": [2, 0, 4], "data": { "kind": "values", "values": [] } },
        "B": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.25, -0.25, 0.5, -0.5] } }
      },
      "outputs": { "C": { "dtype": "float32", "shape": [2, 0, 4], "data": { "kind": "values", "values": [] } } }
    },
    {
      "name": "empty_zero_hidden",
      "provenance": {
        "notes": "Zero-length last (bias-broadcast) axis: the bias vector itself is empty, so no kernel may size a binding from the hidden extent."
      },
      "inputs": {
        "A": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } },
        "B": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } }
      },
      "outputs": { "C": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } }
    },
    {
      "name": "f32_subnormal_linear_region_zero_bias_vec4_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly."
      },
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "BiasGelu with zero bias reduces to exact erf-form GELU; finite subnormal inputs should produce the x/2 linear-region tail through the vec4 bias path."
      },
      "inputs": {
        "A": {
          "dtype": "float32",
          "shape": [1, 4],
          "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38, -1e-38] }
        },
        "B": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [1, 4],
          "tolerance": 2e-45,
          "data": {
            "kind": "values",
            "values": [4.99997305055738e-41, -4.99997305055738e-41, 4.999999675228202e-39, -4.999999675228202e-39]
          }
        }
      }
    },
    {
      "name": "f32_subnormal_linear_region_zero_bias_scalar_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly."
      },
      "provenance": {
        "source": "onnxruntime/test/contrib_ops/element_wise_ops_test.cc",
        "test": "BiasGeluTest.Float",
        "notes": "Scalar-path companion for BiasGelu subnormal linear-region behavior with zero bias."
      },
      "inputs": {
        "A": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38] } },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.0, 0.0, 0.0] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [1, 3],
          "tolerance": 2e-45,
          "data": { "kind": "values", "values": [4.99997305055738e-41, -4.99997305055738e-41, 4.999999675228202e-39] }
        }
      }
    },
    {
      "name": "scalar_dispatch_cliff_2d_fold",
      "inputs": {
        "A": { "dtype": "float32", "shape": [8388609, 3], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.1, -0.1, 0.3] } }
      },
      "outputs": { "C": { "dtype": "float32", "shape": [8388609, 3], "tolerance": 0.0001 } }
    },
    {
      "name": "scalar_rank1_odd_hidden_bias_broadcast",
      "inputs": {
        "A": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.5, -1.5, 0.7] } },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.2, -0.2, 0.3] } }
      },
      "outputs": {
        "C": {
          "dtype": "float32",
          "shape": [3],
          "tolerance": 0.000001,
          "data": { "kind": "values", "values": [1.62423876, -0.07576124, 0.84134474] }
        }
      }
    },
    {
      "name": "scalar_numel_div4_but_last_dim_not",
      "inputs": {
        "A": {
          "dtype": "float32",
          "shape": [4, 3],
          "data": { "kind": "values", "values": [-1.0, 0.5, 2.0, 1.5, -0.5, -1.5, 0.0, 1.0, -2.0, 0.25, -0.25, 0.75] }
        },
        "B": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.2, -0.3, 0.1] } }
      },
      "outputs": { "C": { "dtype": "float32", "shape": [4, 3], "tolerance": 0.000001 } }
    }
  ]
}