| { |
| "op": "com.microsoft.BiasSoftmax", |
| "cases": [ |
| { |
| "name": "inner_broadcast_consecutive_row_groups", |
| "provenance": { |
| "source": "onnxruntime/contrib_ops/cuda/math/bias_softmax_impl.cu", |
| "notes": "Distinguishes ORT's flattened inner-broadcast row grouping from both outer mode and NumPy right-aligned broadcasting." |
| }, |
| "attrs": { "axis": -1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [2, 3, 2], "data": { "kind": "constant", "value": 0.0 } }, |
| "bias": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [0.0, 2.0, 2.0, 0.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 3, 2], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.119202922022, 0.880797077978, 0.119202922022, 0.880797077978, 0.119202922022, 0.880797077978, 0.880797077978, 0.119202922022, 0.880797077978, 0.119202922022, 0.880797077978, 0.119202922022] |
| } |
| } |
| } |
| }, |
| { |
| "name": "outer_broadcast_cycles_bias_rows", |
| "provenance": { |
| "source": "onnxruntime/contrib_ops/cuda/math/bias_softmax_impl.cu", |
| "notes": "Uses the same non-NumPy-broadcastable shapes as the inner case and pins ORT's cyclic outer-broadcast row selection." |
| }, |
| "attrs": { "axis": -1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [2, 3, 2], "data": { "kind": "constant", "value": 0.0 } }, |
| "bias": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [0.0, 2.0, 2.0, 0.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 3, 2], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.119202922022, 0.880797077978, 0.880797077978, 0.119202922022, 0.119202922022, 0.880797077978, 0.880797077978, 0.119202922022, 0.119202922022, 0.880797077978, 0.880797077978, 0.119202922022] |
| } |
| } |
| } |
| }, |
| { |
| "name": "ort_inner_broadcast_full_suffix_softmax", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.InnerBroadcastFullBiasBatch", |
| "notes": "Small deterministic projection of ORT's suffix softmax semantics." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }, |
| "bias": { "dtype": "float32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [1, 2, 2], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { "kind": "values", "values": [0.03205860328, 0.087144318742, 0.23688281809, 0.643914259888] } |
| } |
| } |
| }, |
| { |
| "name": "ort_inner_broadcast_empty_bias_batch", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.InnerBroadcastEmptyBiasBatch", |
| "notes": "Compact deterministic projection where one bias batch broadcasts across two input batches." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "bias": { "dtype": "float32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.03205860328, 0.087144318742, 0.23688281809, 0.643914259888, 0.03205860328, 0.087144318742, 0.23688281809, 0.643914259888] |
| } |
| } |
| } |
| }, |
| { |
| "name": "ort_inner_broadcast_negative_axis", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.InnerBroadcastNegativeAxis", |
| "notes": "Small deterministic projection of ORT's negative-axis inner broadcast pattern." |
| }, |
| "attrs": { "axis": -2, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "bias": { "dtype": "float32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.03205860328, 0.087144318742, 0.23688281809, 0.643914259888, 0.03205860328, 0.087144318742, 0.23688281809, 0.643914259888] |
| } |
| } |
| } |
| }, |
| { |
| "name": "ort_outer_broadcast_negative_axis", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.OuterBroadcastNegativeAxis", |
| "notes": "Small deterministic projection of ORT's negative-axis outer broadcast pattern." |
| }, |
| "attrs": { "axis": -1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 2.0, 1.0, 0.0] } |
| } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.09003057317, 0.244728471055, 0.665240955775, 0.665240955775, 0.244728471055, 0.09003057317, 0.09003057317, 0.244728471055, 0.665240955775, 0.665240955775, 0.244728471055, 0.09003057317] |
| } |
| } |
| } |
| }, |
| { |
| "name": "ort_outer_broadcast_full_bias_batch", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.OuterBroadcastFullBiasBatch", |
| "notes": "Compact deterministic projection where every input batch has its own full bias row." |
| }, |
| "attrs": { "axis": -1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 2.0, 1.0, 0.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0] } |
| } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.09003057317, 0.244728471055, 0.665240955775, 0.665240955775, 0.244728471055, 0.09003057317, 0.09003057317, 0.244728471055, 0.665240955775, 0.665240955775, 0.244728471055, 0.09003057317] |
| } |
| } |
| } |
| }, |
| { |
| "name": "f32_large_gap_subnormal_tail_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 in f32; the 87.5-point logit gap makes the tail probability subnormal, which collapses to zero instead of ORT's positive subnormal value." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.InnerBroadcastFullBiasBatch", |
| "notes": "BiasSoftmax is a suffix softmax over data+bias; an 87.5-point gap leaves a valid positive subnormal probability tail in ORT CPU." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 2], "data": { "kind": "values", "values": [0.0, -87.5] } }, |
| "bias": { "dtype": "float32", "shape": [1, 2], "data": { "kind": "values", "values": [0.0, 0.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [1, 2], |
| "tolerance": 2e-45, |
| "relTolerance": 0, |
| "data": { "kind": "values", "values": [1.0, 9.982351397596697e-39] } |
| } |
| } |
| }, |
| { |
| "name": "ort_outer_broadcast_empty_bias_batch", |
| "provenance": { |
| "source": "onnxruntime/test/contrib_ops/bias_softmax_op_test.cc", |
| "test": "BiasSoftmaxTest.OuterBroadcastEmptyBiasBatch", |
| "notes": "Compact deterministic projection where one outer-broadcast bias row is reused for every input batch." |
| }, |
| "attrs": { "axis": -1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "bias": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [0.0, 1.0, 2.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [2, 2, 3], |
| "tolerance": 0.000001, |
| "relTolerance": 0.000001, |
| "data": { |
| "kind": "values", |
| "values": [0.09003057317, 0.244728471055, 0.665240955775, 0.09003057317, 0.244728471055, 0.665240955775, 0.09003057317, 0.244728471055, 0.665240955775, 0.09003057317, 0.244728471055, 0.665240955775] |
| } |
| } |
| } |
| }, |
| { |
| "name": "empty_zero_dim", |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [0, 2, 2], "data": { "kind": "values", "values": [] } }, |
| "bias": { "dtype": "float32", "shape": [0, 2, 2], "data": { "kind": "values", "values": [] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [0, 2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "f16_default_axis_two_element_row", |
| "attrs": { "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float16", "shape": [1, 2], "data": { "kind": "values", "values": [0.0, 0.0] } }, |
| "bias": { "dtype": "float16", "shape": [1, 2], "data": { "kind": "values", "values": [0.0, 0.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float16", |
| "shape": [1, 2], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [0.5, 0.5] } |
| } |
| } |
| }, |
| { |
| "name": "dispatch_cliff_rows_65537", |
| "provenance": { |
| "notes": "65,537 short rows cross the per-dimension workgroup limit. The selected packed route keeps the dispatch small and grid-strides; an all-variant run also retains coverage of the generic kernel's 2D-folded row reconstruction." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [65537, 4], |
| "data": { "kind": "cycle", "values": [0.1, 0.2, 0.3, 0.4, 0.5] } |
| }, |
| "bias": { "dtype": "float32", "shape": [65537, 4], "data": { "kind": "constant", "value": 0.0 } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [65537, 4], "tolerance": 0.0001 } } |
| }, |
| { |
| "name": "fully_masked_row_neg_inf_bias", |
| "provenance": { |
| "notes": "Fully additive-masked softmax row (bias = -Infinity over the whole suffix block). GPU (FLT_MAX-init online softmax), the TS reference, ai.onnx.Softmax, and ORT's WebGPU EP all emit 0 for a fully-masked row (a NaN would poison attention). Pinned to 0." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [1, 4], |
| "data": { "kind": "values", "values": ["-Infinity", "-Infinity", "-Infinity", "-Infinity"] } |
| } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [1, 4], |
| "tolerance": 0.000001, |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } |
| } |
| } |
| }, |
| { |
| "name": "axis0_full_reduce_single_block", |
| "provenance": { |
| "notes": "axis=0 => outer(data,0)=1 => one softmax block over the whole tensor (batchCount=1, blockSize=numel). ORT requires one complete flattened bias row, so bias has the full [4,6] shape." |
| }, |
| "attrs": { "axis": 0, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [4, 6], "data": { "kind": "linspace", "start": -3.0, "end": 3.0 } }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [4, 6], |
| "data": { |
| "kind": "values", |
| "values": [0.5, -0.5, 1.0, -1.0, 0.25, -0.25, 0.5, -0.5, 1.0, -1.0, 0.25, -0.25, 0.5, -0.5, 1.0, -1.0, 0.25, -0.25, 0.5, -0.5, 1.0, -1.0, 0.25, -0.25] |
| } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [4, 6], "tolerance": 0.000001, "relTolerance": 0.000001 } } |
| }, |
| { |
| "name": "bias_fold_skip_middle_dim_axis1", |
| "provenance": { |
| "notes": "bias [1,3,4] broadcast over batch axis of data [2,3,4], axis=1 (suffix softmax over 3*4=12). Exercises the compiled bias_index() fold when a size-1 bias axis is skipped and the reduction spans multiple axes. Truth from the TS reference." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [2, 3, 4], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } }, |
| "bias": { "dtype": "float32", "shape": [1, 3, 4], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } } |
| }, |
| "outputs": { |
| "output": { "dtype": "float32", "shape": [2, 3, 4], "tolerance": 0.000001, "relTolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "many_two_element_rows_axis1", |
| "provenance": { |
| "notes": "Compact companion for bench case biassoftmax-f32-launchbound-262144x2-axis1: many tiny softmax rows stress the scalar-row fallback and folded dispatch accounting." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [4096, 2], |
| "data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "bias": { "dtype": "float32", "shape": [1, 2], "data": { "kind": "values", "values": [0.125, -0.25] } } |
| }, |
| "outputs": { |
| "output": { "dtype": "float32", "shape": [4096, 2], "tolerance": 0.000001, "relTolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "longrow_split_inner_broadcast_axis1_4x65536_groups2", |
| "provenance": { |
| "notes": "A long split row with consecutive inner-broadcast groups checks that each group reads the correct bias row across the full reduction." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [4, 65536], |
| "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.0017, "cosStep": 0.0031 } |
| }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [2, 65536], |
| "data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.0011, "cosStep": 0.0023 } |
| } |
| }, |
| "outputs": { |
| "output": { "dtype": "float32", "shape": [4, 65536], "tolerance": 0.000001, "relTolerance": 0.00001 } |
| } |
| }, |
| { |
| "name": "longrow_split_f16_axis1_4x65536_groups2", |
| "provenance": { |
| "notes": "Exercises float16 storage on the split long-row path over 65536 elements. A -30-to-0 ramp concentrates probability mass so normal float16 outputs and underflowing tail zeros coexist, while the row statistics remain in float32 scratch." |
| }, |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { "dtype": "float16", "shape": [4, 65536], "data": { "kind": "linspace", "start": -30.0, "end": 0.0 } }, |
| "bias": { "dtype": "float16", "shape": [2, 65536], "data": { "kind": "constant", "value": 0.0 } } |
| }, |
| "outputs": { "output": { "dtype": "float16", "shape": [4, 65536], "tolerance": 1e-7, "relTolerance": 0.01 } } |
| }, |
| { |
| "name": "attn_rows_axis2_4x64x256", |
| "provenance": { |
| "notes": "Compact companion for bench case biassoftmax-f32-attn-32x512x512, preserving the attention-score layout with a broadcast bias over many axis-2 softmax rows." |
| }, |
| "attrs": { "axis": 2, "is_inner_broadcast": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [4, 64, 256], |
| "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.017, "cosStep": 0.031 } |
| }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [1, 64, 256], |
| "data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.011, "cosStep": 0.023 } |
| } |
| }, |
| "outputs": { |
| "output": { "dtype": "float32", "shape": [4, 64, 256], "tolerance": 0.000001, "relTolerance": 0.000001 } |
| } |
| }, |
| { |
| "name": "rank8_inner_broadcast_full_suffix_softmax", |
| "attrs": { "axis": 1, "is_inner_broadcast": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 2, 1, 2, 2, 2], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.27 } |
| }, |
| "bias": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 2, 1, 2, 2, 2], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.11 } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 2], "tolerance": 0.000002 } } |
| } |
| ] |
| } |
|
|