Skip to content

Commit

Permalink
x64: brgemm bwd_w ip: fix chunk's tail processing in reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
ankalinin committed Apr 17, 2023
1 parent be942a2 commit caead72
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cpu/x64/jit_brgemm_inner_product.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2020-2022 Intel Corporation
* Copyright 2020-2023 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1502,8 +1502,10 @@ void brgemm_inner_product_bwd_weights_t<
const bool is_bf16_out = jbgp.wei_dt == data_type::bf16;
const int icb_scale = (!is_bf16_out) ? jbgp.ic_block / jbgp.simd_w : 1;

const int icb_work = ti->ic_c_work * jbgp.nb_ic_blocking;
const int ocb_work = ti->oc_c_work * jbgp.nb_oc_blocking;
const int icb_work = nstl::min(ti->ic_c_work * jbgp.nb_ic_blocking,
jbgp.nb_ic - ti->ic_c_start * jbgp.nb_ic_blocking);
const int ocb_work = nstl::min(ti->oc_c_work * jbgp.nb_oc_blocking,
jbgp.nb_oc - ti->oc_c_start * jbgp.nb_oc_blocking);
const int work = ocb_work * icb_work;

int os_chunks = utils::div_up(jbgp.nb_os, jbgp.nb_os_blocking);
Expand Down

0 comments on commit caead72

Please sign in to comment.