Skip to content

Commit a82ed83

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 a82ed83

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/cpu/rnn/ref_rnn.hpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,17 @@ 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+
// WA: enable gru brgemm on avx512 f32 to avoid dien.xml regression when removing gemm legacy on avx512.
310+
const auto enable_brgemm_gru = mayiuse(avx512_core) && rnn_.is_cell_dt_f32();
311+
#else
312+
const auto enable_brgemm_gru = false;
313+
#endif
309314
// Support for GRU / AUGRU cell in BRGEMM-based implementation is
310315
// limited by forward_inference pass for now, all_f32 is disabled
311-
// due to performance degradation.
316+
// due to performance degradation except the case GEMM legacy is removed on avx512 core.
312317
// TODO: Improve GRU / AUGRU coverage in BRGEMM-based implementation
313-
ok = IMPLICATION(rnn_.is_orig_gru,
318+
ok = IMPLICATION(rnn_.is_orig_gru && !enable_brgemm_gru,
314319
this->desc()->prop_kind == forward_inference
315320
&& !rnn_.is_cell_dt_f32());
316321
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)