{ "op": "com.microsoft.FastGelu", "fixtureArrays": { "ort_float16_hidden8_with_bias_input_X": [0.8, -0.5, 0, 1, 1.3, 2.1, -0.2, 1.1, 0.5, 0.2, 0.3, -0.6, 3.1, 2.2, -1.1, 0] }, "cases": [ { "name": "dispatch_cliff_scalar_no_bias", "inputs": { "X": { "dtype": "float32", "shape": [16777, 1001], "data": { "kind": "linspace", "start": -3.0, "end": 3.0 } } }, "outputs": { "Y": { "dtype": "float32", "shape": [16777, 1001], "tolerance": 0.0001 } } }, { "name": "ort_float32_with_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat32" }, "inputs": { "X": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [-0.5, 0.6, 1.2, 2.1] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.18537092, 0.05398276, 1.0617028, 3.0973732, 0.0, 0.6304317, 1.3995715, 1.3995714] } } } }, { "name": "ort_float32_without_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat32" }, "inputs": { "X": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.6304317, -0.154286, 0.0, 0.841192, 0.345714, 0.11585142, 0.18537092, -0.16458479] } } } }, { "name": "ort_float32_zero_sequence_with_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithNullInput" }, "inputs": { "X": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [-0.5, 0.6, 1.2, 2.1] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } } } }, { "name": "f32_scalar_no_bias_zero_sequence", "provenance": { "notes": "Bias-free twin of ort_float32_zero_sequence_with_bias. An empty X fails the numel > 0 guard both vec4 routes carry, so the plain scalar no-bias kernel is the only one left." }, "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": "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": { "X": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } }, "bias": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } } }, { "name": "ort_float16_hidden2_with_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat16_2" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.8, -0.5, 0.5, 0.2] } }, "bias": { "dtype": "float16", "shape": [2], "data": { "kind": "values", "values": [-0.5, 0.6] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 2], "tolerance": 0.001, "data": { "kind": "values", "values": [0.1851806640625, 0.054046630859375, 0.0, 0.63037109375] } } } }, { "name": "ort_float16_hidden2_without_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat16_2" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.8, -0.5, 0.5, 0.2] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 2], "tolerance": 0.001, "data": { "kind": "values", "values": [0.63037109375, -0.154296875, 0.345703125, 0.11578369140625] } } } }, { "name": "ort_float16_hidden4_with_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat16_4" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 4], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } }, "bias": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [-0.5, 0.6, 1.2, 2.1] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 4], "tolerance": 0.001, "data": { "kind": "values", "values": [0.1851806640625, 0.054046630859375, 1.0615234375, 3.09765625, 0.0, 0.63037109375, 1.3994140625, 1.3994140625] } } } }, { "name": "ort_float16_hidden4_without_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat16_4" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 4], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 4], "tolerance": 0.001, "data": { "kind": "values", "values": [0.63037109375, -0.154296875, 0.0, 0.84130859375, 0.345703125, 0.1158447265625, 0.1854248046875, -0.16455078125] } } } }, { "name": "ort_float16_hidden8_with_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat16_8" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 8], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_float16_hidden8_with_bias_input_X" } } }, "bias": { "dtype": "float16", "shape": [8], "data": { "kind": "values", "values": [-0.5, 0.6, 1.2, 2.1, 1.3, -1.0, 0.0, 3.1] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 8], "tolerance": 0.001, "data": { "kind": "values", "values": [0.1851806640625, 0.054046630859375, 1.0615234375, 3.09765625, 2.587890625, 0.9501953125, -0.0841064453125, 4.19921875, 0.0, 0.63037109375, 1.3994140625, 1.3994140625, 4.3984375, 1.060546875, -0.1494140625, 3.09765625] } } } }, { "name": "ort_float16_hidden8_without_bias", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat16_8" }, "inputs": { "X": { "dtype": "float16", "shape": [1, 2, 8], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_float16_hidden8_with_bias_input_X" } } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 2, 8], "tolerance": 0.001, "data": { "kind": "values", "values": [0.63037109375, -0.154296875, 0.0, 0.84130859375, 1.173828125, 2.0625, -0.0841064453125, 0.9501953125, 0.345703125, 0.1158447265625, 0.1854248046875, -0.16455078125, 3.09765625, 2.16796875, -0.1494140625, 0.0] } } } }, { "name": "float32_extreme_saturation_edges", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "notes": "Extra edge case for the tanh approximation: large negative values saturate to signed-zero-ish outputs while large positives pass through." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 9], "data": { "kind": "values", "values": [-20.0, -10.0, -5.0, -2.0, 0.0, 2.0, 5.0, 10.0, 20.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 9], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.0, 0.0, -2.9802322e-7, -0.045402348, 0.0, 1.9545977, 4.9999995, 10.0, 20.0] } } } }, { "name": "f32_subnormal_linear_region_no_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/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat32", "notes": "Near zero, tanh-approx FastGelu is approximately x/2; finite subnormal tails should survive the vec4 no-bias path." }, "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_no_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/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithoutBiasFloat32", "notes": "Scalar-path companion for FastGelu's near-zero x/2 subnormal 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": "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/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat32", "notes": "Bias-path companion: zero bias reduces FastGelu to the same near-zero x/2 behavior, but exercises the vec4 bias-broadcast kernel variant." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38, -1e-38] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } } }, "outputs": { "Y": { "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/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat32", "notes": "Scalar bias-broadcast companion for FastGelu subnormal linear-region behavior with zero bias." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-38] } }, "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.0, 0.0, 0.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 3], "tolerance": 2e-45, "data": { "kind": "values", "values": [4.99997305055738e-41, -4.99997305055738e-41, 4.999999675228202e-39] } } } }, { "name": "rank4_last_dim_bias_broadcast", "provenance": { "source": "onnxruntime/test/contrib_ops/fastgelu_op_test.cc", "test": "FastGeluTest.FastGeluWithBiasFloat32", "notes": "Compact rank-4 projection of ORT's last-dimension bias behavior." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 1, 2, 3], "data": { "kind": "values", "values": [-2.0, -1.0, 0.0, 1.0, 2.0, 3.0] } }, "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -0.25, 1.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 1, 2, 3], "tolerance": 0.000001, "data": { "kind": "values", "values": [-0.10042842, -0.1322858, 0.841192, 1.3995715, 1.6797954, 3.9999297] } } } }, { "name": "f32_scalar_bias_odd_hidden", "inputs": { "X": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 0.5, 0.2, 0.3] } }, "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [-0.5, 0.6, 1.2] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.18537092, 0.05398275, 1.06170277, 0.0, 0.63043169, 1.39957158] } } } }, { "name": "f32_scalar_no_bias_numel_not_div4", "inputs": { "X": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, -2.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [5], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.63043169, -0.15428599, 0.0, 0.84119199, -0.04540231] } } } }, { "name": "f32_tanh_vs_erf_distinguisher", "inputs": { "X": { "dtype": "float32", "shape": [1, 5], "data": { "kind": "values", "values": [-2.0, -1.0, 0.0, 1.0, 2.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 5], "tolerance": 0.0001, "data": { "kind": "values", "values": [-0.04540231, -0.15880801, 0.0, 0.84119199, 1.95459769] } } } } ] }