Skip to content

Commit febfbd3

Browse files
committed
[Fix] [Feature] Apply WA to remove gemm legacy on avx512.
[FORK][FEATURE] cpu: remove gemm legacy on avx512.
1 parent 9861b36 commit febfbd3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/cpu/rnn/ref_rnn.hpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,16 @@ struct _ref_rnn_common_t : public primitive_t {
305305
(rnn_.is_bf16_conf() || rnn_.is_f32_conf()));
306306

307307
if (!ok) return status::unimplemented;
308-
308+
#if !__BUILD_GEMM_AVX512
309+
const auto enable_brgemm_gru = mayiuse(avx512_core) && rnn_.is_cell_dt_f32();
310+
#else
311+
const auto enable_brgemm_gru = false;
312+
#endif
309313
// Support for GRU / AUGRU cell in BRGEMM-based implementation is
310314
// limited by forward_inference pass for now, all_f32 is disabled
311-
// due to performance degradation.
315+
// due to performance degradation except the case GEMM legacy is removed on avx512 core.
312316
// TODO: Improve GRU / AUGRU coverage in BRGEMM-based implementation
313-
ok = IMPLICATION(rnn_.is_orig_gru,
317+
ok = IMPLICATION(rnn_.is_orig_gru && !enable_brgemm_gru,
314318
this->desc()->prop_kind == forward_inference
315319
&& !rnn_.is_cell_dt_f32());
316320
if (!ok) return status::unimplemented;

src/cpu/x64/gemm/gemm_info.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ void gemm_info_t<a_t, b_t, c_t>::jit_init(void) {
360360
static std::once_flag initialized;
361361
static std::atomic<dnnl_status_t> st(dnnl_success);
362362
std::call_once(initialized, [&, um] {
363+
MAYBE_UNUSED(um);
363364
#if __BUILD_GEMM_AVX512
364365
const bool b_is_s8 = data_traits<b_t>::data_type == data_type::s8;
365366
#endif

0 commit comments

Comments
 (0)