| { |
| "op": "ai.onnx.QLinearMatMul", |
| "fixtureArrays": { |
| "ort_per_column_2d_u8s8_input_b": [0, -8, 2, 3, -11, -13, -8, 1, 2, 4, 4, -10, 3, 2, -11, 2], |
| "ort_3d_u8s8_scalar_quantization_input_a": [208, 126, 0, 238, 3, 214, 255, 29, 208, 236, 0, 238, 3, 214, 255, 29], |
| "ort_3d_u8s8_scalar_quantization_input_b": [-43, 51, -34, 60, 26, -17, 0, 63, -55, 47, -29, -31, -62, 51, -42, 60, 26, -22, 0, -8, -19, 37, -2, -47], |
| "ort_3d_u8u8_scalar_quantization_input_a": [208, 236, 0, 238, 3, 214, 255, 29, 208, 236, 0, 238, 3, 214, 255, 29], |
| "ort_3d_u8u8_scalar_quantization_input_b": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247, 152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247], |
| "ort_per_column_nd_u8s8_input_b": [0, -8, 2, 3, -11, -13, -8, 1, 2, 4, 4, -10, 3, 2, -11, 2, 0, -8, 2, 3, -11, -13, -8, 1, 2, 4, 4, -10, 3, 2, -11, 2], |
| "onnx_backend_qlinearmatmul_3D_int8_float16_input_a": [81, 109, -127, 111, -124, 87, -128, -98, 81, 109, -127, 111, -124, 87, -128, -98], |
| "onnx_backend_qlinearmatmul_3D_int8_float16_input_b": [25, -76, 117, -67, -101, -128, -127, 0, 119, 0, 127, 120, 25, -76, 117, -67, -101, -128, -127, 0, 119, 0, 127, 120], |
| "dp4a_u8s8_k260_scalar_quant_tails_input_a": [0, 255, 128, 127, 56, 77, 3, 100, 200, 42, 5, 19, 64, 88, 33, 7, 125, 90], |
| "dp4a_u8s8_k260_scalar_quant_tails_input_b": [-77, 3, 100, -100, 42, -5, 19, -64, 88, -33, 7, 125, -90, -128, 127, 0, -1, 56], |
| "dp4a_s8s8_k132_per_column_tails_input_a": [-128, 127, 0, -1, 56, -77, 3, 100, -100, 42, -5, 19, -64, 88, -33, 7, 125, -90], |
| "f16_per_column_u8s8_dp4a_input_a": [127, 128, 129, 100, 200, 33, 7, 90, 64, 88, 5, 19, 42, 255, 0, 56], |
| "f16_per_column_u8s8_dp4a_input_b": [-7, 3, 0, 12, -25, 6, -1, 9, -14, 2, 7, -3, 11, -8, 4, -20], |
| "dp4a_k64_rank2_scalar_quantization_exact_input_a": [0, 255, 121, 7, 200, 31, 129, 64, 99, 3, 254, 127, 1, 88, 173, 240, 16, 5] |
| }, |
| "cases": [ |
| { |
| "name": "uint8_output_saturates", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [130, 129, 128, 127, 126, 125] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.5] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [3, 2], |
| "data": { "kind": "values", "values": [127, 128, 129, 130, 131, 132] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [129] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2] } } |
| }, |
| { |
| "name": "int8_output", |
| "inputs": { |
| "a": { "dtype": "int8", "shape": [2, 2], "data": { "kind": "values", "values": [-3, -2, 1, 4] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.5] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-1] } }, |
| "b": { "dtype": "uint8", "shape": [2, 3], "data": { "kind": "values", "values": [10, 20, 30, 40, 50, 60] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [30] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-3] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 3] } } |
| }, |
| { |
| "name": "requant_exact_half_ties_to_even", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8S8", |
| "notes": "ONNX quantized requantization rounds ties to even; accumulators +/-1 and +/-5 with y_scale=2 produce exact +/-0.5 and +/-2.5 tie values." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 1], "data": { "kind": "values", "values": [1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [1, 4], "data": { "kind": "values", "values": [1, -1, 5, -5] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [2.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { |
| "dtype": "uint8", |
| "shape": [1, 4], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [128, 128, 130, 126] } |
| } |
| } |
| }, |
| { |
| "name": "requant_huge_finite_saturates_before_i32_overflow", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8S8", |
| "notes": "A finite requantized value far outside the uint8 range should saturate; converting the rounded f32 to i32 before clamping can wrap." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 1], "data": { "kind": "values", "values": [1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [1, 2], "data": { "kind": "values", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-20] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [1, 2], "tolerance": 0, "data": { "kind": "values", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "requant_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8S8", |
| "notes": "A valid positive subnormal output scale can make small integer accumulators requantize beyond uint8; the result should saturate before any i32 conversion of an infinite f32." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 1], "data": { "kind": "values", "values": [1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [1, 2], "data": { "kind": "values", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [1, 2], "tolerance": 0, "data": { "kind": "values", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "per_column_requant_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_2D", |
| "notes": "Per-column quantization path with a valid positive subnormal output scale should saturate uint8 results before any i32 conversion of an infinite f32." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 4], "data": { "kind": "values", "values": [1, 0, 0, 0] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [4, 2], "data": { "kind": "values", "values": [1, -1, 0, 0, 0, 0, 0, 0] } }, |
| "b_scale": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1, 2], "data": { "kind": "values", "values": [0, 0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [1, 2], "tolerance": 0, "data": { "kind": "values", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "rank3_requant_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8S8", |
| "notes": "Batched rank-3 scalar quantization path with a valid positive subnormal output scale should saturate uint8 results before any i32 conversion of an infinite f32." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 1, 1], "data": { "kind": "values", "values": [1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [1, 1, 2], "data": { "kind": "values", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [1, 1, 2], "tolerance": 0, "data": { "kind": "values", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "dp4a_rank3_scalar_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8S8", |
| "notes": "Batched production-sized scalar quantization case for the fused rank-3 DP4A path: subnormal y_scale should saturate before integer conversion." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 8, 256], "data": { "kind": "constant", "value": 1 } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [2, 256, 64], "data": { "kind": "cycle", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [2, 8, 64], "tolerance": 0, "data": { "kind": "cycle", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "rank3_per_column_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_ND", |
| "notes": "Batched per-column quantization path with valid positive subnormal y_scale: large positive/negative requantized values should saturate before integer conversion." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 1, 4], "data": { "kind": "constant", "value": 1 } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [2, 4, 2], "data": { "kind": "cycle", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [2, 1, 2], "data": { "kind": "constant", "value": 1.0 } }, |
| "b_zero_point": { "dtype": "int8", "shape": [2, 1, 2], "data": { "kind": "constant", "value": 0 } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [2, 1, 2], "tolerance": 0, "data": { "kind": "cycle", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "rank3_per_column_broadcast_scale_batch", |
| "provenance": { |
| "source": "QLinearMatMul manifest consolidation regression", |
| "notes": "Per-column B scale and zero point broadcast from batch 1 while A supplies two output batches; the GPU must use a zero batch stride for both quantization tensors." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 1, 4], "data": { "kind": "values", "values": [1, 2, 3, 4, 4, 3, 2, 1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [1, 4, 2], |
| "data": { "kind": "values", "values": [1, -2, 3, 4, -1, 2, 2, -3] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1, 1, 2], "data": { "kind": "values", "values": [1.0, 0.5] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1, 1, 2], "data": { "kind": "values", "values": [0, 1] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 1, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_2d_u8u8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8U8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [208, 236, 0, 238, 3, 214, 255, 29] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_2d_u8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8S8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [208, 126, 0, 238, 3, 214, 255, 29] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [-43, 51, -34, 60, 26, -17, 0, 63, -55, 47, -29, -31] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00802] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0123] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_2d_s8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_S8S8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [80, -2, -128, 110, -125, 86, 127, -99] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-15] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [-43, 51, -34, 60, 26, -17, 0, 63, -55, 47, -29, -31] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00802] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0123] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-10] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_per_column_2d_u8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_2D" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [125, 135, 133, 122, 132, 123, 136, 135] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [133] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_2d_u8s8_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1, 4], "data": { "kind": "values", "values": [1, -2, 2, -1] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [130] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_per_column_2d_s8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_2D_S8S8" |
| }, |
| "inputs": { |
| "a": { "dtype": "int8", "shape": [2, 4], "data": { "kind": "values", "values": [-3, 7, 5, -6, 4, -5, 8, 7] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [5] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_2d_u8s8_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1, 4], "data": { "kind": "values", "values": [1, -2, 2, -1] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_3d_u8s8_scalar_quantization", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8S8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8s8_scalar_quantization_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8s8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00802] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0123] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_3d_u8u8_scalar_quantization", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8U8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_3d_s8s8_scalar_quantization", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_S8S8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 4], |
| "data": { |
| "kind": "values", |
| "values": [80, -2, -128, 110, -125, 86, 127, -99, 80, 108, -128, 110, -125, 86, 127, -99] |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-15] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8s8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00802] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0123] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-10] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "broadcast_2d_by_3d_u8u8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8U8", |
| "notes": "Uses ORT QLinearMatMul3D_U8U8 values in a legal MatMul broadcast form where A is rank 2 and B is rank 3." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [208, 236, 0, 238, 3, 214, 255, 29] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "broadcast_3d_by_2d_u8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8S8", |
| "notes": "Uses ORT QLinearMatMul3D_U8S8 values in a legal MatMul broadcast form where A is rank 3 and B is rank 2." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8s8_scalar_quantization_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [-43, 51, -34, 60, 26, -17, 0, 63, -55, 47, -29, -31] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00802] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0123] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "broadcast_4d_u8u8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul3D_U8U8", |
| "notes": "Compact 4D MatMul broadcast extension of ORT's quantized matmul coverage." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [1, 2, 2, 2], |
| "data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [2, 1, 2, 2], |
| "data": { "kind": "values", "values": [1, 0, 0, 1, 2, 1, 1, 2] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { |
| "y": { |
| "dtype": "uint8", |
| "shape": [2, 2, 2, 2], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 4, 5, 10, 11, 16, 17, 22, 23] } |
| } |
| } |
| }, |
| { |
| "name": "ort_per_column_nd_u8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_ND" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { |
| "kind": "values", |
| "values": [125, 135, 133, 122, 132, 123, 136, 135, 125, 135, 133, 122, 132, 123, 136, 135] |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [133] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_nd_u8s8_input_b" } } |
| }, |
| "b_scale": { |
| "dtype": "float32", |
| "shape": [2, 1, 4], |
| "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4, 0.4, 0.3, 0.2, 0.1] } |
| }, |
| "b_zero_point": { |
| "dtype": "int8", |
| "shape": [2, 1, 4], |
| "data": { "kind": "values", "values": [1, -2, 2, -1, 2, -4, -1, 0] } |
| }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [130] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_per_column_nd_s8s8", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.PerColumn_ND_S8S8" |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": [-3, 7, 5, -6, 4, -5, 8, 7, -3, 7, 5, -6, 4, -5, 8, 7] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [5] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_nd_u8s8_input_b" } } |
| }, |
| "b_scale": { |
| "dtype": "float32", |
| "shape": [2, 1, 4], |
| "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4, 0.4, 0.3, 0.2, 0.1] } |
| }, |
| "b_zero_point": { |
| "dtype": "int8", |
| "shape": [2, 1, 4], |
| "data": { "kind": "values", "values": [1, -2, 2, -1, 2, -4, -1, 0] } |
| }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint8_requantize_round_half_to_even", |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "uint8", "shape": [2, 2], "data": { "kind": "values", "values": [1, 1, 2, 3] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [2.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_uint8_requantize_round_half_to_even", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8U8", |
| "notes": "Fused DP4A path companion for exact half-way requantization: every accumulator is 1 and y_scale=2, so ONNX round-half-to-even must produce zero, not one." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [128, 256], |
| "data": { |
| "kind": "cycle", |
| "values": [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "uint8", "shape": [256, 64], "data": { "kind": "constant", "value": 1 } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [2.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [128, 64], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_scalar_subnormal_y_scale_saturates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8S8", |
| "notes": "Production-sized scalar-quantization case for the fused DP4A path: a valid positive subnormal y_scale should saturate large positive/negative requantized values before converting to integer." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [64, 256], "data": { "kind": "constant", "value": 1 } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [256, 128], "data": { "kind": "cycle", "values": [1, -1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [64, 128], "tolerance": 0, "data": { "kind": "cycle", "values": [255, 0] } } |
| } |
| }, |
| { |
| "name": "uint8_subnormal_scale_ratio_gpu_gap", |
| "skipGpu": { |
| "category": "permanent", |
| "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal scale values required by this fixture. Backend evidence: Requant multiplier a_scale*b_scale/y_scale = 1e-40/1e-40 divides two denormals; Metal flushes denormals in floating-point division (-> NaN), while the CPU reference computes the ratio with denormal support. Subnormal scale-ratio cases remain CPU-reference-only." |
| }, |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul2D_U8U8", |
| "notes": "Valid positive subnormal scales whose ratio is exactly meaningful; WebGPU commonly flushes the individual scales before forming the ratio." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 4], "data": { "kind": "values", "values": [1, 0, 0, 0] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": [1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-40] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [1, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "int8_output_saturates_negative_and_positive", |
| "inputs": { |
| "a": { "dtype": "int8", "shape": [2, 2], "data": { "kind": "values", "values": [127, 127, -128, -128] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [2, 2], "data": { "kind": "values", "values": [127, -128, 127, -128] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_empty_m_dimension", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/math/quantize_linear_matmul_test.cc", |
| "test": "QuantizeLinearMatmulOpTest.QLinearMatMul", |
| "notes": "Empty-input subcase from QLinearMatMul2DTest(false)." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [0, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_2D_int8_float16", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_2D_int8_float16" }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [81, 109, -127, 111, -124, 87, -128, -98] } |
| }, |
| "a_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.00659942626953125] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-14] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [25, -76, 117, -67, -101, -128, -127, 0, 119, 0, 127, 120] } |
| }, |
| "b_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.007049560546875] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-13] } }, |
| "y_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.0106964111328125] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-9] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_2D_int8_float32", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_2D_int8_float32" }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [81, 109, -127, 111, -124, 87, -128, -98] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.006599999964237213] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-14] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [25, -76, 117, -67, -101, -128, -127, 0, 119, 0, 127, 120] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0070500001311302185] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-13] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.010700000450015068] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-9] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_2D_uint8_float16", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_2D_uint8_float16" }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [208, 236, 0, 238, 3, 214, 255, 29] } |
| }, |
| "a_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.00659942626953125] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247] } |
| }, |
| "b_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.007049560546875] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.0106964111328125] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_2D_uint8_float32", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_2D_uint8_float32" }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [208, 236, 0, 238, 3, 214, 255, 29] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.006599999964237213] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [4, 3], |
| "data": { "kind": "values", "values": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0070500001311302185] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.010700000450015068] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_3D_int8_float16", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_3D_int8_float16" }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/onnx_backend_qlinearmatmul_3D_int8_float16_input_a" } |
| } |
| }, |
| "a_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.00659942626953125] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-14] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 3], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/onnx_backend_qlinearmatmul_3D_int8_float16_input_b" } |
| } |
| }, |
| "b_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.007049560546875] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.0106964111328125] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-9] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_3D_int8_float32", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_3D_int8_float32" }, |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/onnx_backend_qlinearmatmul_3D_int8_float16_input_a" } |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.006599999964237213] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-14] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 4, 3], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/onnx_backend_qlinearmatmul_3D_int8_float16_input_b" } |
| } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0070500001311302185] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.010700000450015068] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-9] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_3D_uint8_float16", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_3D_uint8_float16" }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_a" } } |
| }, |
| "a_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.00659942626953125] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.007049560546875] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.0106964111328125] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_qlinearmatmul_3D_uint8_float32", |
| "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_qlinearmatmul_3D_uint8_float32" }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.006599999964237213] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [2, 4, 3], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_3d_u8u8_scalar_quantization_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0070500001311302185] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.010700000450015068] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_u8s8_k260_scalar_quant_tails", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [9, 260], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_u8s8_k260_scalar_quant_tails_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [260, 17], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_u8s8_k260_scalar_quant_tails_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.015] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-7] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [30.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [9, 17], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_u8s8_large_scalar_quant_tails", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [65, 260], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_u8s8_k260_scalar_quant_tails_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [260, 257], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_u8s8_k260_scalar_quant_tails_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.015] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-7] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [30.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [65, 257], "tolerance": 0 } }, |
| "tunables": { "DP4A_LARGE_MIN_M": 64, "DP4A_LARGE_MIN_N": 256, "DP4A_LARGE_MIN_K": 256 } |
| }, |
| { |
| "name": "dp4a_s8s8_k132_per_column_tails", |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [10, 132], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_s8s8_k132_per_column_tails_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.025] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [5] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [132, 17], |
| "data": { |
| "kind": "cycle", |
| "values": [19, -64, 88, -33, 7, 125, -90, -128, 127, 0, -1, 56, -77, 3, 100, -100, 42, -5] |
| } |
| }, |
| "b_scale": { |
| "dtype": "float32", |
| "shape": [17], |
| "data": { |
| "kind": "values", |
| "values": [0.01, 0.02, 0.005, 0.03, 0.012, 0.018, 0.022, 0.009, 0.016, 0.027, 0.011, 0.014, 0.02, 0.024, 0.008, 0.019, 0.013] |
| } |
| }, |
| "b_zero_point": { |
| "dtype": "int8", |
| "shape": [17], |
| "data": { "kind": "values", "values": [-7, 3, 0, 12, -25, 6, -1, 9, -14, 2, 7, -3, 11, -8, 4, -20, 1] } |
| }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [25.0] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [3] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [10, 17], "tolerance": 0 } } |
| }, |
| { |
| "name": "per_column_scale_scalar_zp_u8s8", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [125, 135, 133, 122, 132, 123, 136, 135] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [133] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_2d_u8s8_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [130] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "per_column_zp_scalar_scale_u8s8", |
| "provenance": { |
| "notes": "Cross-backend rounding lock: equal b/y scales must not be cancelled before the separately-rounded a*b and accumulator products; row 1 column 3 lies just beyond a negative half tie." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [125, 135, 133, 122, 132, 123, 136, 135] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [133] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [4, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_per_column_2d_u8s8_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [4], "data": { "kind": "values", "values": [1, -2, 2, -1] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.2] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [130] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "f16_per_column_u8s8_dp4a", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [8, 256], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/f16_per_column_u8s8_dp4a_input_a" } } |
| }, |
| "a_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.00659942626953125] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [256, 128], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/f16_per_column_u8s8_dp4a_input_b" } } |
| }, |
| "b_scale": { "dtype": "float16", "shape": [128], "data": { "kind": "constant", "value": 0.007049560546875 } }, |
| "b_zero_point": { "dtype": "int8", "shape": [128], "data": { "kind": "constant", "value": -2 } }, |
| "y_scale": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.5] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [8, 128], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_rank4_scalar_s8s8_2x2x64x128", |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 64, 128], |
| "data": { "kind": "cycle", "values": [3, -2, 1, 4, -3, 2, -1, 5, -4, 0] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "cycle", "values": [1] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 2, 128, 64], |
| "data": { "kind": "cycle", "values": [2, -1, 3, -2, 1, 4, -3, 2] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "cycle", "values": [2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "cycle", "values": [0] } } |
| }, |
| "outputs": { "y": { "dtype": "int8", "shape": [2, 2, 64, 64] } } |
| }, |
| { |
| "name": "dp4a_gemv_m1_u8u8_k257_n512_requant_tail", |
| "provenance": { |
| "notes": "M=1 int8 decode GEMV with requant and a one-lane K tail routes to the tileM=1 ILP DP4A config; column-varying b catches dropped-column dispatch bugs while the reference validates the unrolled and scalar-tail reductions." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [1, 257], |
| "data": { "kind": "cycle", "values": [2, 1, 3, 0, 2, 4, 1, 3, 0, 2, 1, 4] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [257, 512], |
| "data": { "kind": "cycle", "values": [1, 2, 0, 3, 1, 2, 4, 1, 0, 2, 3, 1, 4, 0, 2, 1] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.1] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.5] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [10] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [1, 512], "tolerance": 0 } } |
| }, |
| { |
| "name": "empty_n_dimension_zero_output", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [3, 4], |
| "data": { "kind": "values", "values": [152, 51, 244, 60, 26, 255, 0, 127, 246, 127, 254, 247] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { "dtype": "uint8", "shape": [4, 0], "data": { "kind": "values", "values": [] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "uint8", "shape": [3, 0], "tolerance": 0, "data": { "kind": "values", "values": [] } } |
| } |
| }, |
| { |
| "name": "empty_k_contraction_all_zero_accum", |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 0], "data": { "kind": "values", "values": [] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0066] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [113] } }, |
| "b": { "dtype": "uint8", "shape": [0, 3], "data": { "kind": "values", "values": [] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.00705] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [114] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0107] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [118] } } |
| }, |
| "outputs": { |
| "y": { |
| "dtype": "uint8", |
| "shape": [2, 3], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [118, 118, 118, 118, 118, 118] } |
| } |
| } |
| }, |
| { |
| "name": "rank4_ydtype_mismatch_s8s8_to_u8_scalar_fallback_correct", |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 6, 130], |
| "data": { "kind": "cycle", "values": [3, -2, 1, 4, -3, 2, -1, 5, -4, 0, -128, 127, 7, -9] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [1] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 2, 130, 5], |
| "data": { "kind": "cycle", "values": [2, -1, 3, -2, 1, 4, -3, 2, -5, 6, 127, -128, 0, 9] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.5] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 6, 5], "tolerance": 0 } } |
| }, |
| { |
| "name": "rank4_batch_broadcast_a1_b_full_scalar", |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [1, 1, 5, 68], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/f16_per_column_u8s8_dp4a_input_a" } } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 3, 68, 7], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/f16_per_column_u8s8_dp4a_input_b" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.5] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 3, 5, 7], "tolerance": 0 } } |
| }, |
| { |
| "name": "requant_negative_saturation_i8_output_min_clamp", |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [1, 1], "data": { "kind": "values", "values": [1] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "b": { "dtype": "int8", "shape": [1, 2], "data": { "kind": "values", "values": [-1, 1] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1e-20] } }, |
| "y_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { |
| "y": { "dtype": "int8", "shape": [1, 2], "tolerance": 0, "data": { "kind": "values", "values": [-128, 127] } } |
| } |
| }, |
| { |
| "name": "dp4a_k64_rank2_scalar_quantization_exact", |
| "provenance": { |
| "notes": "Exactness and selector lock for the aligned K=64 scalar-quantized DP4A path with enough output work to amortize cooperative tiling." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [64, 64], |
| "data": { |
| "kind": "cycle", |
| "values": { "$ref": "#/fixtureArrays/dp4a_k64_rank2_scalar_quantization_exact_input_a" } |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [121] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [64, 128], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_s8s8_k132_per_column_tails_input_a" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-4] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [8.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [64, 128], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_tail_k129_percolumn_scale_scalar_zp_exact", |
| "provenance": { |
| "notes": "Compact correctness lock for per-column requantization with a one-element K tail; sized to select the packed tail kernel." |
| }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [16, 129], |
| "data": { |
| "kind": "cycle", |
| "values": { "$ref": "#/fixtureArrays/dp4a_k64_rank2_scalar_quantization_exact_input_a" } |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [121] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [129, 512], |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/dp4a_s8s8_k132_per_column_tails_input_a" } } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [512], "data": { "kind": "constant", "value": 0.03 } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-4] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [8.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [16, 512], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_tail_k129_scalar_quantization_exact", |
| "provenance": { "notes": "Coverage and exactness lock for the scalar-scale DP4A tail variant." }, |
| "inputs": { |
| "a": { |
| "dtype": "uint8", |
| "shape": [16, 129], |
| "data": { |
| "kind": "cycle", |
| "values": { "$ref": "#/fixtureArrays/dp4a_k64_rank2_scalar_quantization_exact_input_a" } |
| } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [121] } }, |
| "b": { |
| "dtype": "uint8", |
| "shape": [129, 512], |
| "data": { |
| "kind": "cycle", |
| "values": [0, 255, 128, 7, 200, 31, 129, 64, 99, 3, 254, 127, 1, 88, 173, 240, 16, 5] |
| } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [117] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [8.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [16, 512], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_rank3_by_rank2_shared_weight_scalar_quantization", |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [2, 8, 64], "data": { "kind": "cycle", "values": [118, 121, 124, 127] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [121] } }, |
| "b": { "dtype": "int8", "shape": [64, 64], "data": { "kind": "cycle", "values": [-7, -3, 2, 6] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-4] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 8, 64], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_tail_k63_scalar_quantization_exact", |
| "provenance": { |
| "notes": "Exactness and direct-route lock for the 32<=K<128 scalar-quantization DP4A tail range opened by the K63 projection pathology fix." |
| }, |
| "inputs": { |
| "a": { "dtype": "uint8", "shape": [16, 63], "data": { "kind": "cycle", "values": [0, 255, 121, 7, 200, 31] } }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [121] } }, |
| "b": { "dtype": "int8", "shape": [63, 512], "data": { "kind": "cycle", "values": [-128, 127, 0, -1, 56, -77] } }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.03] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "values", "values": [-4] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [8.0] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "values", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [16, 512], "tolerance": 0 } } |
| }, |
| { |
| "name": "dp4a_rank4_ydtype_mismatch_s8s8_to_u8", |
| "inputs": { |
| "a": { |
| "dtype": "int8", |
| "shape": [2, 2, 64, 128], |
| "data": { "kind": "cycle", "values": [3, -2, 1, 4, -3, 2, -1, 5, -4, 0] } |
| }, |
| "a_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "a_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "cycle", "values": [1] } }, |
| "b": { |
| "dtype": "int8", |
| "shape": [2, 2, 128, 64], |
| "data": { "kind": "cycle", "values": [2, -1, 3, -2, 1, 4, -3, 2] } |
| }, |
| "b_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "b_zero_point": { "dtype": "int8", "shape": [1], "data": { "kind": "cycle", "values": [2] } }, |
| "y_scale": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.02] } }, |
| "y_zero_point": { "dtype": "uint8", "shape": [1], "data": { "kind": "cycle", "values": [128] } } |
| }, |
| "outputs": { "y": { "dtype": "uint8", "shape": [2, 2, 64, 64], "tolerance": 0 } }, |
| "provenance": { |
| "notes": "Rank-4 signed-input matmul with an unsigned output and dimensions large enough for packed accumulation. Verifies that output dtype selection is independent of the input types while preserving batched broadcasting and output quantization." |
| } |
| } |
| ] |
| } |
|
|