Skip to content

Commit 87e8ea9

Browse files
committed
cpu: x64: brgemm bwd_w convolution: update threading heuristic
1 parent be6abca commit 87e8ea9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/cpu/x64/jit_brgemm_conv_utils.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2021-2022 Intel Corporation
2+
* Copyright 2021-2023 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -2475,6 +2475,18 @@ void balance_bwd_w(jit_brgemm_conv_conf_t &jcp) {
24752475
}
24762476
nthr_ic_b = jcp.nthr / (nthr_mb * nthr_oc_b);
24772477
nthr = nthr_mb * nthr_g * nthr_oc_b * nthr_ic_b;
2478+
} else if (jcp.ngroups == 1 && (jcp.oc > 2048 || jcp.ic > 2048)) {
2479+
const bool more_oc = (jcp.ic < jcp.oc);
2480+
if (more_oc) {
2481+
nthr_oc_b = div_up(jcp.nthr, 8);
2482+
nthr_mb = div_up(jcp.nthr / nthr_oc_b, 2);
2483+
nthr_ic_b = jcp.nthr / (nthr_mb * nthr_oc_b);
2484+
} else {
2485+
nthr_ic_b = div_up(jcp.nthr, 8);
2486+
nthr_mb = div_up(jcp.nthr / nthr_ic_b, 2);
2487+
nthr_oc_b = jcp.nthr / (nthr_mb * nthr_ic_b);
2488+
}
2489+
nthr = nthr_mb * nthr_g * nthr_oc_b * nthr_ic_b;
24782490
}
24792491

24802492
jcp.nthr = nthr;

0 commit comments

Comments
 (0)