{ "op": "com.microsoft.BiasAdd", "cases": [ { "name": "dispatch_cliff_scalar_f32", "inputs": { "X": { "dtype": "float32", "shape": [1, 5592321, 3], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } }, "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -1.0, 2.0] } }, "skip": { "dtype": "float32", "shape": [1, 5592321, 3], "data": { "kind": "constant", "value": 0.25 } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 5592321, 3], "tolerance": 0.00001 } } }, { "name": "ort_fused_skip_bias_channels", "provenance": { "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc", "test": "BiasAddTest.BiasAddTest_HiddenSize_320", "notes": "Small deterministic projection of the ORT fused skip+bias channel pattern." }, "inputs": { "X": { "dtype": "float32", "shape": [2, 2, 3], "data": { "kind": "values", "values": [-1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, -2.0, -3.0, -4.0] } }, "bias": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.5, -1.0, 2.0] } }, "skip": { "dtype": "float32", "shape": [2, 2, 3], "data": { "kind": "values", "values": [10.0, 10.0, 10.0, -1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [2, 2, 3], "data": { "kind": "values", "values": [9.5, 9.0, 13.0, 1.5, 1.0, 5.0, 5.5, 6.0, 11.0, 1.5, 0.0, 3.0] } } } }, { "name": "ort_fused_skip_bias_singleton_image_f16", "provenance": { "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc", "test": "BiasAddTest.BiasAddTest_HiddenSize_640", "notes": "Small deterministic float16 projection of the ORT singleton image-size path." }, "inputs": { "X": { "dtype": "float16", "shape": [2, 1, 4], "data": { "kind": "values", "values": [-1.0, -0.5, 0.5, 1.0, 2.0, -2.0, 0.25, -0.25] } }, "bias": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.5, -1.0, 1.5, -0.5] } }, "skip": { "dtype": "float16", "shape": [2, 1, 4], "data": { "kind": "values", "values": [1.0, 2.0, -1.0, -2.0, -0.5, 0.5, 1.0, -1.0] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [2, 1, 4], "data": { "kind": "values", "values": [0.5, 0.5, 1.0, -1.5, 2.0, -2.5, 2.75, -1.75] } } } }, { "name": "ort_fused_skip_bias_vec4_f32", "provenance": { "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc", "test": "BiasAddTest.BiasAddTest_HiddenSize_1280", "notes": "Small deterministic projection with hidden size divisible by 4, matching the ORT channel-bias pattern and exercising the vec4 path." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "values", "values": [-4.0, -1.0, 0.0, 2.0, 5.0, 6.0, -7.0, 8.0] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.5, -0.25, 1.0, -2.0] } }, "skip": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "values", "values": [10.0, 0.0, -1.0, 1.0, -5.0, 2.0, 3.0, -4.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0, "data": { "kind": "values", "values": [6.5, -1.25, 0.0, 1.0, 0.5, 7.75, -3.0, 2.0] } } } }, { "name": "f32_hidden320_vec4_compact", "inputs": { "X": { "dtype": "float32", "shape": [2, 16, 320], "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.5 } }, "bias": { "dtype": "float32", "shape": [320], "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.17, "scale": 0.25 } }, "skip": { "dtype": "float32", "shape": [2, 16, 320], "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.11, "scale": 0.25 } } }, "outputs": { "Y": { "dtype": "float32", "shape": [2, 16, 320], "tolerance": 0.000001 } } }, { "name": "ort_fused_skip_bias_scalar_f16", "provenance": { "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc", "test": "BiasAddTest.BiasAddTest_HiddenSize_768", "notes": "Small deterministic float16 projection with hidden size not divisible by 4, so the scalar path covers ORT's fused skip+bias pattern." }, "inputs": { "X": { "dtype": "float16", "shape": [1, 3, 3], "data": { "kind": "values", "values": [0.5, -0.5, 1.0, 2.0, -2.0, 0.25, -0.25, 4.0, -4.0] } }, "bias": { "dtype": "float16", "shape": [3], "data": { "kind": "values", "values": [0.25, -1.5, 2.0] } }, "skip": { "dtype": "float16", "shape": [1, 3, 3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, -1.0, -2.0, -3.0, 0.5, -0.5, 1.0] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 3, 3], "tolerance": 0, "data": { "kind": "values", "values": [1.75, 0.0, 6.0, 1.25, -5.5, -0.75, 0.5, 2.0, -1.0] } } } }, { "name": "ort_fused_skip_bias_image3_vec4_f32", "provenance": { "source": "onnxruntime/test/contrib_ops/bias_add_op_test.cc", "test": "BiasAddTest.BiasAddTest_HiddenSize_1536", "notes": "Small deterministic projection of ORT's batch=1, image_size=3, channel-bias path with hidden size divisible by 4." }, "inputs": { "X": { "dtype": "float32", "shape": [1, 3, 4], "data": { "kind": "values", "values": [-2.0, -1.0, 0.0, 1.0, 2.0, 3.0, -3.0, -2.0, 4.0, -4.0, 0.5, -0.5] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.25, -0.5, 1.5, -1.25] } }, "skip": { "dtype": "float32", "shape": [1, 3, 4], "data": { "kind": "values", "values": [10.0, 0.0, -10.0, 2.0, -1.0, 1.0, 3.0, -3.0, 0.5, -0.5, 2.0, -2.0] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 3, 4], "tolerance": 0, "data": { "kind": "values", "values": [8.25, -1.5, -8.5, 1.75, 1.25, 3.5, 1.5, -6.25, 4.75, -5.0, 4.0, -3.75] } } } }, { "name": "empty_zero_dim", "inputs": { "X": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }, "bias": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } }, "skip": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 0, 4], "tolerance": 0 } } }, { "name": "empty_zero_dim_f16", "inputs": { "X": { "dtype": "float16", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }, "bias": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } }, "skip": { "dtype": "float16", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } } }, "outputs": { "Y": { "dtype": "float16", "shape": [1, 0, 4], "tolerance": 0 } } }, { "name": "empty_zero_hidden", "inputs": { "X": { "dtype": "float32", "shape": [1, 2, 0], "data": { "kind": "values", "values": [] } }, "bias": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } }, "skip": { "dtype": "float32", "shape": [1, 2, 0], "data": { "kind": "values", "values": [] } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 2, 0], "tolerance": 0 } } }, { "name": "scalar_hidden5_bias_broadcast_row_wrap", "inputs": { "X": { "dtype": "float32", "shape": [1, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } }, "bias": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.5, -1.0, 2.0, -0.25, 1.5] } }, "skip": { "dtype": "float32", "shape": [1, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": -1.0 } } }, "outputs": { "Y": { "dtype": "float32", "shape": [1, 3, 5], "tolerance": 0.000001 } } } ] }