From 270576a9fbeeda5210483931388e62f9a1059dd9 Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Wed, 13 Dec 2023 09:38:07 +0000 Subject: Fix nightly bug caused by wrong validation in Gemm mmul kernel While writing this gemm kernel, code pieces, including validations were adapted from ClGemmMatrixMultiplyReshapedOnlyRhsKernel, and this validation should be about reinterpret_input_as_3d, which is not dealt with in this kernel. The mmul kernel only deals with reinterpret_output_as_3d, which is equivalent to depth_output_gemm3d != 0. This reveals a test gap for this kernel. There are currently no tests stressing this condition; but this is not going to be addressed as part of the bug ticket. The corresponding snippet in ClGemmMatrixMultiplyReshapedOnlyRhsKernel is if (gemm_info.reinterpret_input_as_3d) { ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(1) * src0->dimension(2) != m); } else { ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(1) != m); } Resolves: COMPMID-6757 Change-Id: I73b203594b22098a5374c1fac6969ee769969901 Signed-off-by: Gunes Bayir Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10874 Benchmark: Arm Jenkins Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- .../kernels/ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp b/src/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp index 9a2a4890f3..d67c595449 100644 --- a/src/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp +++ b/src/gpu/cl/kernels/ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp @@ -99,16 +99,7 @@ Status validate_arguments(const ITensorInfo *src0, ARM_COMPUTE_UNUSED(k); ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(0) != k); - - // Validate the reinterpreted-as-3D-case - if (gemm_info.depth_output_gemm3d != 0) - { - ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(1) * src0->dimension(2) != m); - } - else - { - ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(1) != m); - } + ARM_COMPUTE_RETURN_ERROR_ON(src0->dimension(1) != m); // Validate the gemm-batched case if (src1->num_dimensions() > 2) -- cgit v1.2.1