| { |
| "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] |
| } |
| } |
| } |
| } |
| ] |
| } |
|
|