ai.onnx.Abs / build /webgpu /test.json
Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
0a573b4 verified
Raw
History Blame
9.2 kB
{
"op": "ai.onnx.Abs",
"fixtureArrays": {
"onnx_backend_input_x": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334, 0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876, 0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989, -2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, -1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358, 0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314, 0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859, -1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924, -0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527, -0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206, 0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902]
},
"cases": [
{
"name": "f32_values",
"inputs": {
"x": {
"dtype": "float32",
"shape": [6],
"data": { "kind": "values", "values": [-3.0, -0.25, 0.0, 0.5, 2.0, -7.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [6] } }
},
{
"name": "f16_values",
"inputs": {
"x": {
"dtype": "float16",
"shape": [2, 3],
"data": { "kind": "values", "values": [-1.0, 2.0, -3.0, 4.0, -5.0, 6.0] }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [2, 3] } },
"tolerance": 0.001
},
{
"name": "rank0_negative_scalar",
"inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-7.25] } } },
"outputs": { "y": { "dtype": "float32", "shape": [] } }
},
{
"name": "int32_exact_above_float24",
"inputs": {
"x": {
"dtype": "int32",
"shape": [4],
"data": { "kind": "values", "values": [-16777217, 16777217, -123456789, 0] }
}
},
"outputs": { "y": { "dtype": "int32", "shape": [4] } }
},
{
"name": "ort_int32_min_value_overflow_edge",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs_int32",
"notes": "Extends ORT's int32 Abs coverage with INT32_MIN, whose mathematical absolute value is not representable in int32 storage."
},
"inputs": {
"x": {
"dtype": "int32",
"shape": [4],
"data": { "kind": "values", "values": [-2147483648, -2147483647, -1, 0] }
}
},
"outputs": { "y": { "dtype": "int32", "shape": [4], "tolerance": 0 } }
},
{
"name": "ort_int8_min_value_overflow_edge",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs_int8",
"notes": "Extends ORT's int8 Abs coverage with INT8_MIN, whose mathematical absolute value is not representable in int8 storage."
},
"inputs": { "x": { "dtype": "int8", "shape": [4], "data": { "kind": "values", "values": [-128, -127, -1, 0] } } },
"outputs": { "y": { "dtype": "int8", "shape": [4], "tolerance": 0 } }
},
{
"name": "ort_int16_min_value_overflow_edge_gpu_gap",
"skipGpu": {
"category": "todo",
"reason": "int16 is widened to i32 on WebGPU, but the current Abs kernel does not narrow the result back to signed 16-bit; abs(-32768) therefore produces 32768 instead of the required wrapped int16 result."
},
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs_int32",
"notes": "Signed integer Abs minimum-value edge adapted to ONNX-valid int16; ORT CPU returns the wrapped INT16_MIN value and current WebGPU Abs variants do not admit int16 tensors."
},
"inputs": {
"x": { "dtype": "int16", "shape": [4], "data": { "kind": "values", "values": [-32768, -32767, -1, 0] } }
},
"outputs": { "y": { "dtype": "int16", "shape": [4], "tolerance": 0 } }
},
{
"name": "uint32_large_identity",
"inputs": {
"x": {
"dtype": "uint32",
"shape": [4],
"data": { "kind": "values", "values": [0, 16777217, 4000000001, 4294967295] }
}
},
"outputs": { "y": { "dtype": "uint32", "shape": [4] } }
},
{
"name": "f32_subnormal_magnitude_vec4",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs",
"notes": "Finite signed subnormal float32 inputs are valid; Abs should preserve their magnitudes instead of flushing them to zero."
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1e-40, 1e-40, -2e-40, 2e-40] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } }
},
{
"name": "f32_subnormal_magnitude_scalar",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs",
"notes": "Scalar-path companion for signed subnormal Abs magnitude preservation."
},
"inputs": {
"x": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
},
{
"name": "ort_float_2x2",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs"
},
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, -2.0, 0.0, -10.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2], "tolerance": 0 } }
},
{
"name": "ort_int8_values",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs_int8"
},
"inputs": { "x": { "dtype": "int8", "shape": [4], "data": { "kind": "values", "values": [1, 2, -1, -5] } } },
"outputs": { "y": { "dtype": "int8", "shape": [4], "tolerance": 0 } }
},
{
"name": "ort_int32_values",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Abs_int32"
},
"inputs": { "x": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 2, -1, -5] } } },
"outputs": { "y": { "dtype": "int32", "shape": [4], "tolerance": 0 } }
},
{
"name": "onnx_backend_rank3_float32",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_abs" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 4, 5],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_input_x" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
},
{
"name": "onnx_backend_abs",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_abs" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 4, 5],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_input_x" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0.00001 } }
},
{
"name": "vec4_f16_lanes",
"inputs": {
"x": {
"dtype": "float16",
"shape": [16],
"data": {
"kind": "values",
"values": [-6.0, -4.0, -3.0, -2.0, -1.5, -1.0, -0.5, -0.25, 0.0, 0.25, 0.5, 1.0, 1.5, 2.0, 4.0, 6.0]
}
}
},
"outputs": { "y": { "dtype": "float16", "shape": [16], "tolerance": 0 } }
},
{
"name": "empty_input_zero_dim",
"inputs": { "x": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } },
"outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } }
},
{
"name": "uint8_values",
"inputs": {
"x": { "dtype": "uint8", "shape": [6], "data": { "kind": "values", "values": [0, 1, 127, 128, 255, 3] } }
},
"outputs": { "y": { "dtype": "uint8", "shape": [6] } }
},
{
"name": "rank0_f32_scalar",
"inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-2.5] } } },
"outputs": { "y": { "dtype": "float32", "shape": [] } }
}
]
}