Skip to content

Commit

Permalink
[ARM] [WA] Reconfigure ACL Matmul on each inference (#191)
Browse files Browse the repository at this point in the history
3.5 squash list:
[FORK][FIX] Reconfigure ACL matmul WA
  • Loading branch information
dmitry-gorokhov authored and xczhai committed Dec 4, 2024
1 parent 7297b1b commit b39ffaa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cpu/aarch64/matmul/acl_matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ status_t acl_matmul_t::execute_forward(const exec_ctx_t &ctx) const {
bool use_dst_acc_for_sum = amp.use_dst_acc_for_sum;

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

arm_compute::Tensor src_tensor;
arm_compute::Tensor wei_tensor;
Expand Down

0 comments on commit b39ffaa

Please sign in to comment.