| { |
| "op": "ai.onnx.Range", |
| "cases": [ |
| { |
| "name": "dispatch_cliff_i32_16777216", |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [0] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [16777216] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [16777216], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_positive", |
| "provenance": { |
| "notes": "Range-27 defines stash_type only for float16/bfloat16 accumulation, so the non-default FLOAT16 code has no effect on this float32 route." |
| }, |
| "attrs": { "stash_type": 10 }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.5] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [6.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.5] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3] } } |
| }, |
| { |
| "name": "i32_scalar_inputs_positive_delta", |
| "provenance": { |
| "notes": "Covers a positive integer step whose interval length is exactly divisible by the step." |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [4] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [10] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [3] } } |
| }, |
| { |
| "name": "f32_true_scalar_inputs", |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.5] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "f32_negative_delta", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_NegativeDelta_0" |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-8.1] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-2.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [6], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "f32_negative_delta_empty", |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-2.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [0], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_same_start_limit_empty", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_SameStartAndLimit" |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [0], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_almost_same_high_delta_one_value", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.AlmostSameStartAndLimitHighDelta" |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.01] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1000000.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_subnormal_positive_delta_length_rounding_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: Metal FTZ: subnormal f32 start/limit/delta (1e-40) flush to zero on GPU, so the generated range collapses to zeros instead of the subnormal sequence (tolerance 2e-45)." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_Delta_NonDefault", |
| "notes": "Valid float32 denormal-step edge: ORT computes length from rounded f32 inputs, producing five values for [0, 4e-40) at delta 1e-40." |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [4e-40] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1e-40] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [5], |
| "tolerance": 2e-45, |
| "data": { |
| "kind": "values", |
| "values": [0.0, 9.99994610111476e-41, 1.999989220222952e-40, 2.999983830334428e-40, 3.999978440445904e-40] |
| } |
| } |
| } |
| }, |
| { |
| "name": "f32_subnormal_negative_delta_length_rounding_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: Metal FTZ: subnormal f32 start/limit/delta (1e-40) flush to zero on GPU, so the generated range collapses to zeros instead of the subnormal sequence (tolerance 2e-45)." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_NegativeDelta_0", |
| "notes": "Negative denormal-step companion; the output shape and values follow ORT's rounded float32 Range semantics." |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-4e-40] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1e-40] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [5], |
| "tolerance": 2e-45, |
| "data": { |
| "kind": "values", |
| "values": [0.0, -9.99994610111476e-41, -1.999989220222952e-40, -2.999983830334428e-40, -3.999978440445904e-40] |
| } |
| } |
| } |
| }, |
| { |
| "name": "f32_subnormal_positive_delta_shifted_start_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: Metal FTZ: subnormal f32 start/limit/delta (1e-40) flush to zero on GPU, so the generated range collapses to zeros instead of the subnormal sequence (tolerance 2e-45)." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_Delta_NonDefault", |
| "notes": "Shifted-start companion to the denormal-step Range edge: every output value is a valid positive subnormal, including the first element." |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1e-40] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [5e-40] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1e-40] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 2e-45 } } |
| }, |
| { |
| "name": "f32_subnormal_negative_delta_shifted_start_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: Metal FTZ: subnormal f32 start/limit/delta (1e-40) flush to zero on GPU, so the generated range collapses to zeros instead of the subnormal sequence (tolerance 2e-45)." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_NegativeDelta_0", |
| "notes": "Negative shifted-start companion: the generated sequence should preserve finite negative subnormal values instead of flushing the range to zeros." |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1e-40] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-5e-40] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1e-40] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 2e-45 } } |
| }, |
| { |
| "name": "ort_f32_delta_default_style", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Float_DeltaDefault" |
| }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [5.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_delta_default_style", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int32_DeltaDefault" |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [0] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [5] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_delta_nondefault_even", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int32_Delta_NonDefault" |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [0] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [10] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_delta_nondefault_odd_limit", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int64_Delta_NonDefault_0", |
| "notes": "Native int32 projection of ORT's int64 odd-limit nondefault-delta case." |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [0] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [9] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_delta_nondefault_one_value", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int64_Delta_NonDefault_1", |
| "notes": "Native int32 projection of ORT's int64 one-value nondefault-delta case." |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [1], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_negative_delta", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int32_NegativeDelta_0" |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-9] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [6], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_i32_negative_delta_empty", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/generator/range_test.cc", |
| "test": "RangeTest.Int32_NegativeDelta_1" |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [9] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-2] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [0], "tolerance": 0 } } |
| }, |
| { |
| "name": "i32_exact_above_float24_no_f32_cast", |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [16777217] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [16777221] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [4], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_range_float_type_positive_delta", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_range_float_type_positive_delta" }, |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [5.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_range_int32_type_negative_delta", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_range_int32_type_negative_delta" }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [10] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [6] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-3] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [2], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_2dfold_dispatch_16777216", |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [16777216.0] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [16777216], "tolerance": 0 } } |
| }, |
| { |
| "name": "f32_fractional_delta_nonmult4_len1027", |
| "inputs": { |
| "start": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "limit": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [256.75] } }, |
| "delta": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.25] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1027], "tolerance": 0 } } |
| }, |
| { |
| "name": "i32_negative_start_positive_delta_len8", |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-3] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [5] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [8], "tolerance": 0 } } |
| }, |
| { |
| "name": "i32_negative_start_negative_delta_descending", |
| "provenance": { |
| "notes": "Negative start with negative delta produces a descending negative sequence [-5,-8,-11,-14,-17]; exercises start + i32(i)*delta with a negative base and negative step, a sign combination not covered by existing negative-delta cases (which start positive)." |
| }, |
| "inputs": { |
| "start": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-5] } }, |
| "limit": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-20] } }, |
| "delta": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-3] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [5], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx27_f16_stash_float32_vec4", |
| "provenance": { |
| "source": "ONNX Operators.md Range-27", |
| "notes": "Pins the float16 type and explicit float32 stash semantics added by Range-27 on the vec4 output route." |
| }, |
| "attrs": { "stash_type": 1 }, |
| "inputs": { |
| "start": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [2048.0] } }, |
| "limit": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [2052.0] } }, |
| "delta": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [1.0] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float16", |
| "shape": [4], |
| "data": { "kind": "values", "values": [2048.0, 2048.0, 2050.0, 2052.0] }, |
| "tolerance": 0 |
| } |
| } |
| }, |
| { |
| "name": "onnx27_f16_stash_float32_scalar_tail", |
| "provenance": { |
| "source": "ONNX Operators.md Range-27", |
| "notes": "Non-multiple-of-four companion which pins float32 accumulation followed by a float16 cast on the scalar-tail route." |
| }, |
| "attrs": { "stash_type": 1 }, |
| "inputs": { |
| "start": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [-1.5] } }, |
| "limit": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [0.0] } }, |
| "delta": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [0.5] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float16", |
| "shape": [3], |
| "data": { "kind": "values", "values": [-1.5, -1.0, -0.5] }, |
| "tolerance": 0 |
| } |
| } |
| } |
| ] |
| } |
|
|