Skip to content

Commit

Permalink
cpu: x64: brgemm bwd_w convolution: update threading heuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
ankalinin committed Feb 9, 2023
1 parent be6abca commit 87e8ea9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/cpu/x64/jit_brgemm_conv_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2021-2022 Intel Corporation
* Copyright 2021-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 @@ -2475,6 +2475,18 @@ void balance_bwd_w(jit_brgemm_conv_conf_t &jcp) {
}
nthr_ic_b = jcp.nthr / (nthr_mb * nthr_oc_b);
nthr = nthr_mb * nthr_g * nthr_oc_b * nthr_ic_b;
} else if (jcp.ngroups == 1 && (jcp.oc > 2048 || jcp.ic > 2048)) {
const bool more_oc = (jcp.ic < jcp.oc);
if (more_oc) {
nthr_oc_b = div_up(jcp.nthr, 8);
nthr_mb = div_up(jcp.nthr / nthr_oc_b, 2);
nthr_ic_b = jcp.nthr / (nthr_mb * nthr_oc_b);
} else {
nthr_ic_b = div_up(jcp.nthr, 8);
nthr_mb = div_up(jcp.nthr / nthr_ic_b, 2);
nthr_oc_b = jcp.nthr / (nthr_mb * nthr_ic_b);
}
nthr = nthr_mb * nthr_g * nthr_oc_b * nthr_ic_b;
}

jcp.nthr = nthr;
Expand Down

0 comments on commit 87e8ea9

Please sign in to comment.