Skip to content

Commit b191ca1

Browse files
committed
cpu: x64: jit_avx512_core_x8s8s32x_conv_kernel: restore scratchpad size
1 parent 1801b23 commit b191ca1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -1765,9 +1765,12 @@ status_t jit_avx512_core_x8s8s32x_fwd_kernel::init_conf(jit_conv_conf_t &jcp,
17651765
void jit_avx512_core_x8s8s32x_fwd_kernel::init_scratchpad(
17661766
memory_tracking::registrar_t &scratchpad, const jit_conv_conf_t &jcp,
17671767
const primitive_attr_t &attr) {
1768-
const int wei_mask = attr.scales_.get_mask(DNNL_ARG_WEIGHTS);
1769-
const dim_t scales_count = wei_mask == 0 ? 1 : jcp.oc * jcp.ngroups;
1770-
dim_t count = wei_mask == 0 ? (dim_t)16 : scales_count;
1768+
dim_t count = 16;
1769+
if (!attr.scales_.has_default_values(DNNL_ARG_WEIGHTS)) {
1770+
const int wei_mask = attr.scales_.get_mask(DNNL_ARG_WEIGHTS);
1771+
const dim_t scales_count = wei_mask == 0 ? 1 : jcp.oc * jcp.ngroups;
1772+
if (wei_mask > 0) count = scales_count;
1773+
}
17711774
scratchpad.book<float>(key_conv_adjusted_scales, count);
17721775
}
17731776

0 commit comments

Comments
 (0)