Skip to content

Commit b39ffaa

Browse files
dmitry-gorokhovxczhai
authored andcommitted
[ARM] [WA] Reconfigure ACL Matmul on each inference (openvinotoolkit#191)
3.5 squash list: [FORK][FIX] Reconfigure ACL matmul WA
1 parent 7297b1b commit b39ffaa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cpu/aarch64/matmul/acl_matmul.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ status_t acl_matmul_t::execute_forward(const exec_ctx_t &ctx) const {
178178
bool use_dst_acc_for_sum = amp.use_dst_acc_for_sum;
179179

180180
const auto scratchpad = ctx.get_scratchpad_grantor();
181+
// [WA] ACL Matmul produces wrong results in case it is not reconfigured on each inference
182+
if (do_transC) {
183+
acl_obj.gemm.configure(&acl_obj.wei_tensor, &acl_obj.src_tensor,
184+
nullptr, &acl_obj.dst_acc_tensor, 1.0f, 0.0f, pd()->amp_.gemm_info);
185+
} else {
186+
acl_obj.gemm.configure(&acl_obj.src_tensor, &acl_obj.wei_tensor,
187+
nullptr, &acl_obj.dst_tensor, 1.0f, 0.0f, pd()->amp_.gemm_info);
188+
}
181189

182190
arm_compute::Tensor src_tensor;
183191
arm_compute::Tensor wei_tensor;

0 commit comments

Comments
 (0)