| { |
| "op": "com.microsoft.SkipLayerNormalization", |
| "fixtureArrays": { |
| "ort_batch2_bias_flattened_tokens_input_skipT": [0.1, -0.2, 0.3, 1, 0.5, 0.1, 0.4, 1.6, 1.8, -0.3, 0, 1, -0.5, 0.4, 0.8, -0.6], |
| "ort_batch2_flattened_tokens_input_inputT": [0.8, -0.5, 0, 1, 0.5, 0.2, 0.3, -0.6, 0.8, -0.5, 0, 1, 0.5, 0.2, 0.3, -0.6], |
| "ort_batch2_skip_broadcast_no_batch_size_output_outputT": [0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438, 0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438] |
| }, |
| "cases": [ |
| { |
| "name": "rank3_exact_skip_shape", |
| "provenance": { |
| "source": "onnxruntime/contrib_ops/cpu/bert/skip_layer_norm.cc", |
| "notes": "Pins the public rank-3 same-shape skip mode independently of the two documented broadcast forms." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [2, 2, 4], "data": { "kind": "linspace", "start": -1.5, "end": 1.5 } }, |
| "skipT": { "dtype": "float32", "shape": [2, 2, 4], "data": { "kind": "linspace", "start": 0.75, "end": -0.25 } }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 0.5, 1.5, -0.25] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, -0.2, 0.3, -0.4] } } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [2, 2, 4], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "no_bias", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13, "scale": 0.1 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.00002 }, |
| "residualT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "f32_epsilon_zero_explicit_tiny_variance", |
| "attrs": { "epsilon": 0 }, |
| "provenance": { |
| "source": "onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.h", |
| "test": "GetAttrOrDefault epsilon semantics", |
| "notes": "An explicit epsilon=0.0 must be honored, not replaced by the 1e-12 schema default via a truthiness fallback. The 1e-7-scale rows make that difference numerically observable." |
| }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 1e-7 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 1e-7 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13, "scale": 0.1 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001 }, |
| "residualT": { "dtype": "float32", "shape": [3, 8], "tolerance": 1e-9 } |
| } |
| }, |
| { |
| "name": "bias", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13, "scale": 0.1 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.17, "scale": 0.08 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.00002 }, |
| "residualT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "zero_variance_returns_beta", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [5.0, 5.0, 5.0, 5.0, -3.0, -3.0, -3.0, -3.0] } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0, 7.0, 7.0, 7.0, 7.0] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [10.0, -2.0, 3.0, 4.0] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.5, -1.0, 2.0, -3.0] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, |
| "residualT": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "hidden_size_one_bias_path", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [2.0, -4.0, 0.5] } }, |
| "skipT": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [3.0, 1.0, -0.5] } }, |
| "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } }, |
| "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } }, |
| "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 1], "tolerance": 0.000001 }, |
| "residualT": { "dtype": "float32", "shape": [3, 1], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "hidden_size_one_bias_output_only", |
| "provenance": { |
| "notes": "Pins the scalar hidden-size-one closed form when the optional residual sum is not requested." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [2.0] } }, |
| "skipT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [3.0] } }, |
| "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } }, |
| "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } }, |
| "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "hidden_size_one_no_beta_output_only", |
| "provenance": { |
| "notes": "Pins the supported no-beta hidden-size-one closed form: every centered value is zero, so the output is zero." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [2.0] } }, |
| "skipT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [3.0] } }, |
| "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "hidden_size_one_bias_rows65535_dispatch_edge", |
| "provenance": { |
| "notes": "Correctness sibling for the low-occupancy hidden=1 benchmark at rows=65535, the maximum single-dimension workgroup count edge." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [65535, 1], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [65535, 1], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, |
| "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, |
| "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [65535, 1], "tolerance": 0.000001 }, |
| "residualT": { "dtype": "float32", "shape": [65535, 1], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "large_mean_small_variance_centered", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [1, 4], |
| "data": { "kind": "values", "values": [40000.0, 40001.0, 40002.0, 40003.0] } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [1, 4], |
| "data": { "kind": "values", "values": [-39999.0, -40000.0, -40001.0, -40002.0] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, -1.0, 0.5] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.5, -0.25, 1.0] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [1, 4], "tolerance": 0.000001 }, |
| "residualT": { "dtype": "float32", "shape": [1, 4], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "ort_zero_tokens_null_input", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormNullInput", |
| "notes": "ORT shape [1, 0, 4] is represented as lowered token rows [0, 4]." |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "skipT": { "dtype": "float32", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [0, 4], "tolerance": 0 }, |
| "residualT": { "dtype": "float32", "shape": [0, 4], "tolerance": 0 } |
| } |
| }, |
| { |
| "name": "ort_batch1_flattened_tokens", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch1", |
| "notes": "ORT shape [1, 2, 4] is represented as [2, 4] tokens by this lowered kernel. Epsilon is omitted to exercise the schema default of 1e-12." |
| }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.1, -0.2, 0.3, 1.0, 0.5, 0.1, 0.4, 1.6] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.00002 }, |
| "residualT": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "ort_batch2_bias_flattened_tokens", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch2_Bias", |
| "notes": "ORT shape [2, 2, 4] is represented as [4, 4] tokens by this lowered kernel." |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [4, 4], |
| "data": { |
| "kind": "values", |
| "values": [0.7, -0.4, -0.2, 1.2, 0.4, 0.3, 0.1, -0.4, 0.7, -0.4, -0.2, 1.2, 0.4, 0.3, 0.1, -0.4] |
| } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [4, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/ort_batch2_bias_flattened_tokens_input_skipT" } |
| } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } }, |
| "biasT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, -0.1, 0.2, -0.2] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.00002 }, |
| "residualT": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "ort_batch2_flattened_tokens", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch2", |
| "notes": "ORT shape [2, 2, 4] is represented as [4, 4] tokens by this lowered kernel." |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [4, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/ort_batch2_bias_flattened_tokens_input_skipT" } |
| } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.00002 }, |
| "residualT": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "large_hidden_320_no_bias", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 320], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 320], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [320], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.007, "cosStep": 0.041 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [320], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.013 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [2, 320], "tolerance": 0.0002 }, |
| "residualT": { "dtype": "float32", "shape": [2, 320], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "large_hidden_320_bias", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 320], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.029 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 320], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.037 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [320], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.029, "cosStep": 0.017 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [320], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.023, "cosStep": 0.011 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [320], |
| "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.031, "cosStep": 0.007 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [2, 320], "tolerance": 0.0002 }, |
| "residualT": { "dtype": "float32", "shape": [2, 320], "tolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "ort_batch2_skip_broadcast_no_batch_size", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch2_Skip_Broadcast_No_Batch_Size" |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.1, -0.2, 0.3, 1.0, 0.5, 0.1, 0.4, 1.6] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } } |
| }, |
| "outputs": { |
| "outputT": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "tolerance": 0.00002, |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/ort_batch2_skip_broadcast_no_batch_size_output_outputT" } |
| } |
| } |
| } |
| }, |
| { |
| "name": "ort_batch1_no_beta_flattened_tokens", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch1_NoBeta", |
| "notes": "ORT shape [1, 2, 4] is represented as [2, 4] tokens by this lowered fixture, with beta omitted." |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.1, -0.2, 0.3, 1.0, 0.5, 0.1, 0.4, 1.6] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } } |
| }, |
| "outputs": { |
| "outputT": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "tolerance": 0.00002, |
| "data": { |
| "kind": "values", |
| "values": [0.0843385934829712, -0.27090578377246854, -1.3289716482162477, 3.092415237426758, 0.2611165225505829, -0.3133398056030273, -0.6963100373744965, 1.9148544311523439] |
| } |
| } |
| } |
| }, |
| { |
| "name": "no_beta_output_only_hidden6_unaligned_row", |
| "provenance": { |
| "notes": "Only coverage for the scalar no_beta_output_only_row variant: beta omitted with output as the sole output picks the no-beta output-only pair, and hidden=6 is not a multiple of 4, so the vec4 sibling's vec4Aligned guard is false and the row kernel is selected on every tier." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [2, 6], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "beta_no_bias_output_only", |
| "provenance": { |
| "notes": "Exercises beta with all three optional auxiliary outputs absent, using a vec4-aligned hidden size of 8." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.1 } |
| } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "beta_no_bias_output_only_hidden6_unaligned_row", |
| "provenance": { |
| "notes": "Row-kernel arm of beta_no_bias_output_only: hidden=6 fails vec4Aligned, so the scalar sibling is selected on every tier." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.37 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.43 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.1 } |
| } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [2, 6], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "beta_bias_output_only", |
| "provenance": { |
| "notes": "bias + beta with no optional outputs uses six storage buffers instead of the nine required when all optional outputs are present. It therefore remains valid at WebGPU's guaranteed minimum of eight storage buffers." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.1 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.47, "scale": 0.3 } |
| } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "beta_bias_output_only_hidden6_unaligned_row", |
| "provenance": { |
| "notes": "Row-kernel arm of beta_bias_output_only: hidden=6 fails vec4Aligned. 6 storage buffers." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.37 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.43 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.2 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.1 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [6], |
| "data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.47, "scale": 0.3 } |
| } |
| }, |
| "outputs": { "outputT": { "dtype": "float32", "shape": [2, 6], "tolerance": 0.00002 } } |
| }, |
| { |
| "name": "ort_batch2_skip_broadcast_batch_size_one", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", |
| "test": "SkipLayerNormTest.SkipLayerNormBatch2_Skip_Broadcast_Batch_Size_1" |
| }, |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [1, 2, 4], |
| "data": { "kind": "values", "values": [0.1, -0.2, 0.3, 1.0, 0.5, 0.1, 0.4, 1.6] } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } } |
| }, |
| "outputs": { |
| "outputT": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "tolerance": 0.00002, |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/ort_batch2_skip_broadcast_no_batch_size_output_outputT" } |
| } |
| } |
| } |
| }, |
| { |
| "name": "f16_hidden768_bias_residual", |
| "requires": { "features": ["shader-f16"] }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float16", |
| "shape": [4, 768], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float16", |
| "shape": [4, 768], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { |
| "dtype": "float16", |
| "shape": [768], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.007, "cosStep": 0.041 } |
| }, |
| "betaT": { |
| "dtype": "float16", |
| "shape": [768], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.013 } |
| }, |
| "biasT": { |
| "dtype": "float16", |
| "shape": [768], |
| "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.031, "cosStep": 0.007 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float16", "shape": [4, 768], "tolerance": 0.01 }, |
| "residualT": { "dtype": "float16", "shape": [4, 768], "tolerance": 0.005 } |
| } |
| }, |
| { |
| "name": "f32_hidden768_no_bias_residual", |
| "provenance": { |
| "notes": "Compact companion for bench cases skip-layernorm-f32-4096x768 and skip-layernorm-f32-4096x768-hidden768-aligned-sibling, where reduced tiers expose a subgroup fallback gap." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [4, 768], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [4, 768], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [768], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.007, "cosStep": 0.041 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [768], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.013 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [4, 768], "tolerance": 0.0002 }, |
| "residualT": { "dtype": "float32", "shape": [4, 768], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "f32_hidden2048_bias_residual", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [2, 2048], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.029 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [2, 2048], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.037 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [2048], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.029, "cosStep": 0.017 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [2048], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.023, "cosStep": 0.011 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [2048], |
| "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.031, "cosStep": 0.007 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [2, 2048], "tolerance": 0.0005 }, |
| "residualT": { "dtype": "float32", "shape": [2, 2048], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "f32_hidden1025_bias_residual", |
| "provenance": { |
| "notes": "Compact companion for bench case skip-layernorm-f32-bias-8192x1025-unaligned-twopass-fallback, preserving the odd hidden-size bias path." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 1025], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.029 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 1025], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.037 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [1025], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.029, "cosStep": 0.017 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [1025], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.023, "cosStep": 0.011 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [1025], |
| "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.031, "cosStep": 0.007 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 1025], "tolerance": 0.0005 }, |
| "residualT": { "dtype": "float32", "shape": [3, 1025], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "f32_hidden770_unaligned_beta_bias_scalar_subgroup", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [3, 770], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [3, 770], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [770], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.007, "cosStep": 0.041 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [770], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.013 } |
| }, |
| "biasT": { |
| "dtype": "float32", |
| "shape": [770], |
| "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.031, "cosStep": 0.007 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [3, 770], "tolerance": 0.0002 }, |
| "residualT": { "dtype": "float32", "shape": [3, 770], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "f32_rows1_hidden4096_decode", |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [1, 4096], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [1, 4096], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { |
| "dtype": "float32", |
| "shape": [4096], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "offset": 1.0, "sinStep": 0.007, "cosStep": 0.041 } |
| }, |
| "betaT": { |
| "dtype": "float32", |
| "shape": [4096], |
| "data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.013 } |
| } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [1, 4096], "tolerance": 0.0005 }, |
| "residualT": { "dtype": "float32", "shape": [1, 4096], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "empty_tokens_bias_residual_twopass", |
| "attrs": { "epsilon": 1e-12 }, |
| "inputs": { |
| "inputT": { "dtype": "float32", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "skipT": { "dtype": "float32", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.3, 0.2, 4.0, 2.2] } }, |
| "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.2, 0.1, 0.4, 1.6] } }, |
| "biasT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, -0.1, 0.2, -0.2] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [0, 4], "tolerance": 0 }, |
| "residualT": { "dtype": "float32", "shape": [0, 4], "tolerance": 0 } |
| } |
| }, |
| { |
| "name": "rows65537_hidden3_fold_lastrow_guard", |
| "provenance": { |
| "notes": "Pins the two-dimensional dispatch fold and final-row guard with 65,537 hidden-size-3 rows; near-constant rows exercise float32 one-pass variance while the residual sum remains exact." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [65537, 3], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [65537, 3], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, -1.0] } }, |
| "betaT": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -0.25, 1.0] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [65537, 3], "tolerance": 0.0021 }, |
| "residualT": { "dtype": "float32", "shape": [65537, 3], "tolerance": 0.000002 } |
| } |
| }, |
| { |
| "name": "hidden_size_one_bias_many_rows", |
| "provenance": { |
| "notes": "Compact correctness sibling for the hidden-size-one low-occupancy benchmark; many rows with hidden=1 keep the variance-zero bias path honest without using benchmark-scale dimensions." |
| }, |
| "attrs": { "epsilon": 0.00001 }, |
| "inputs": { |
| "inputT": { |
| "dtype": "float32", |
| "shape": [257, 1], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "skipT": { |
| "dtype": "float32", |
| "shape": [257, 1], |
| "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.023 } |
| }, |
| "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.25] } }, |
| "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.5] } }, |
| "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } |
| }, |
| "outputs": { |
| "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0.000001 }, |
| "residualT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0.000001 } |
| } |
| } |
| ] |
| } |
|
|