File size: 7,141 Bytes
9ca4c42 | 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 | {
"op": "com.microsoft.Gelu",
"cases": [
{
"name": "dispatch_cliff_scalar_f32",
"inputs": {
"X": { "dtype": "float32", "shape": [16776961], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } }
},
"outputs": { "Y": { "dtype": "float32", "shape": [16776961], "tolerance": 0.0001 } }
},
{
"name": "ort_float32_erf_extreme_edges",
"provenance": {
"source": "onnxruntime/test/contrib_ops/activation_op_test.cc",
"test": "ActivationOpTest.Gelu",
"notes": "Exact erf-form GELU with large finite values that should saturate to zero/pass-through without overflowing."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [1, 1, 9],
"data": { "kind": "values", "values": [-1000.0, -100.0, -10.0, -1.0, 0.0, 1.0, 10.0, 100.0, 1000.0] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [1, 1, 9],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.0, 0.0, 0.0, -0.15865525603294373, 0.0, 0.8413447141647339, 10.0, 100.0, 1000.0]
}
}
}
},
{
"name": "ort_float32_nonfinite_edges",
"provenance": {
"source": "onnxruntime/test/contrib_ops/activation_op_test.cc",
"test": "ActivationOpTest.Gelu_bfloat16",
"notes": "Float32 counterpart of ORT's nonfinite activation coverage; -Infinity produces NaN under the exact erf expression."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": ["-Infinity", "Infinity", "NaN", 0.0, 0.0] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [5],
"allowNaN": true,
"data": { "kind": "values", "values": ["NaN", "Infinity", "NaN", 0.0, 0.0] }
}
}
},
{
"name": "ort_float32_empty_rank3",
"provenance": {
"source": "onnxruntime/test/contrib_ops/activation_op_test.cc",
"notes": "Empty tensors should preserve shape and produce no values."
},
"inputs": { "X": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } } },
"outputs": { "Y": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } } }
},
{
"name": "f32_subnormal_linear_region_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/activation_op_test.cc",
"test": "ActivationOpTest.Gelu",
"notes": "Near zero, exact erf-form GELU is approximately x/2; the com.microsoft path should preserve finite subnormal outputs."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38, -1e-38] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [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_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/activation_op_test.cc",
"test": "ActivationOpTest.Gelu",
"notes": "Scalar-path companion for com.microsoft.Gelu subnormal linear-region behavior."
},
"inputs": {
"X": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38] } }
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [3],
"tolerance": 2e-45,
"data": { "kind": "values", "values": [4.99997305055738e-41, -4.99997305055738e-41, 4.999999675228202e-39] }
}
}
},
{
"name": "rank0_negative_scalar",
"provenance": {
"source": "onnxruntime/test/contrib_ops/activation_op_test.cc",
"test": "ActivationOpTest.Gelu",
"notes": "Additional edge: scalar tensors use the same exact erf-form GELU path."
},
"inputs": { "X": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-0.5] } } },
"outputs": {
"Y": {
"dtype": "float32",
"shape": [],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [-0.15426877] }
}
}
},
{
"name": "vec4_f32_4x8",
"inputs": {
"X": {
"dtype": "float32",
"shape": [4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 2.0 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [4, 8], "tolerance": 0.00001 } }
},
{
"name": "vec4_f16_4x8",
"inputs": {
"X": {
"dtype": "float16",
"shape": [4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 2.0 }
}
},
"outputs": { "Y": { "dtype": "float16", "shape": [4, 8], "tolerance": 0.01 } }
},
{
"name": "scalar_numel_not_div4_inline",
"inputs": {
"X": {
"dtype": "float32",
"shape": [6],
"data": { "kind": "values", "values": [1.5, -1.5, 0.7, -0.7, 0.3, -0.3] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [6],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [1.39978915, -0.10021085, 0.53062549, -0.16937451, 0.18537341, -0.11462659]
}
}
}
},
{
"name": "vec4_odd_last_dim_still_routes_vec4",
"inputs": {
"X": {
"dtype": "float32",
"shape": [6, 2],
"data": { "kind": "values", "values": [-1.0, 0.5, 1.0, -0.5, 2.0, -2.0, 0.0, 1.5, -1.5, 0.25, -0.25, 0.75] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [6, 2],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [-0.15865527, 0.34573123, 0.84134471, -0.15426877, 1.95449984, -0.04550013, 0.0, 1.39978909, -0.10021085, 0.14967656, -0.10032343, 0.58002955]
}
}
}
}
]
}
|