From 1fa0dc37b32076c4dff3c8658e8a4c4295eb980c Mon Sep 17 00:00:00 2001 From: agrawal-aka Date: Thu, 4 Jun 2026 12:16:41 +0530 Subject: [PATCH 1/2] add y_dtype op overload for expected_weights_desc --- include/ideep/operators/matmul.hpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/include/ideep/operators/matmul.hpp b/include/ideep/operators/matmul.hpp index 44ab0271..968536bf 100644 --- a/include/ideep/operators/matmul.hpp +++ b/include/ideep/operators/matmul.hpp @@ -657,11 +657,12 @@ struct matmul_forward : public dnnl::matmul, } } - static tensor::desc expected_weights_desc( +static tensor::desc expected_weights_desc( const dims& weights_dims, - const dims& src_dims = dims(), - data_type dtype = data_type::f32, - data_type x_dtype = data_type::f32, + const dims& src_dims, + data_type dtype, + data_type x_dtype, + data_type y_dtype, const attr_t& attr = attr_t(), const engine& aengine = engine::cpu_engine()) { auto ndims = weights_dims.size(); @@ -670,7 +671,6 @@ struct matmul_forward : public dnnl::matmul, x_dims[ndims-1] = weights_dims[ndims-2]; dims y_dims = (ndims == 3) ? dims({x_dims[0], x_dims[1], weights_dims[2]}) : dims({x_dims[0], weights_dims[1]}); - auto y_dtype = (dtype != data_type::s8) ? dtype : data_type::s32; IDEEP_ENFORCE(x_dims.size() == weights_dims.size(), "Invalid dims for data and weights"); @@ -681,6 +681,25 @@ struct matmul_forward : public dnnl::matmul, return pd.weights_desc(); } + static tensor::desc expected_weights_desc( + const dims& weights_dims, + const dims& src_dims = dims(), + data_type dtype = data_type::f32, + data_type x_dtype = data_type::f32, + const attr_t& attr = attr_t(), + const engine& aengine = engine::cpu_engine()) { + auto y_dtype = (dtype != data_type::s8) ? dtype : data_type::s32; + + return expected_weights_desc( + weights_dims, + src_dims, + dtype, + x_dtype, + y_dtype, + attr, + aengine); + } + private: // For 2-in-1 compute: prepare + compute // Supports fp32, static int8 and dynamic int8 From 45ed6b6f0d23e7b1c540899371c1fc13895e1c10 Mon Sep 17 00:00:00 2001 From: Akash Agrawal Date: Thu, 23 Jul 2026 10:44:40 +0530 Subject: [PATCH 2/2] Update include/ideep/operators/matmul.hpp Co-authored-by: Aditya Tewari --- include/ideep/operators/matmul.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ideep/operators/matmul.hpp b/include/ideep/operators/matmul.hpp index 968536bf..454f7e9c 100644 --- a/include/ideep/operators/matmul.hpp +++ b/include/ideep/operators/matmul.hpp @@ -657,7 +657,7 @@ struct matmul_forward : public dnnl::matmul, } } -static tensor::desc expected_weights_desc( + static tensor::desc expected_weights_desc( const dims& weights_dims, const dims& src_dims, data_type dtype,