Skip to content

Commit 06b1ca1

Browse files
committed
simple reorder: disabled unused bf16 primitives
1 parent 3f4a52e commit 06b1ca1

4 files changed

+33
-14
lines changed

src/cpu/reorder/cpu_reorder_comp_s8_s8.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ const impl_list_map_t comp_s8_s8_impl_list_map {
127127
REG_REORDER_P(REG_SR(s8, ihwo, s8, OIhw16i16o4i, fmt_order_keep, spec_conv_req_comp))
128128
REG_REORDER_P(REG_SR(s8, oihw, s8, OIhw16i16o4i, fmt_order_keep, spec_conv_req_comp))
129129
REG_REORDER_P(REG_SR(s8, hwio, s8, OIhw16i16o4i, fmt_order_keep, spec_conv_req_comp))
130+
#endif
130131
REG_REORDER_P(REG_SR(s8, iohw, s8, OIhw4i16o4i, fmt_order_keep, spec_conv_req_comp))
132+
#ifdef ENABLE_UNUSED_PRIM
131133
REG_REORDER_P(REG_SR(s8, iohw, s8, OIhw2i8o4i, fmt_order_keep, spec_conv_req_comp))
132134
REG_REORDER_P(REG_SR(s8, iohw, s8, OIhw4o4i, fmt_order_keep, spec_conv_req_comp))
133135
#endif

src/cpu/reorder/cpu_reorder_regular_bf16.cpp

+14-7
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,26 @@ const impl_list_map_t regular_bf16_impl_list_map {
2929
REG_REORDER_P(DNNL_X64_ONLY(CPU_REORDER_INSTANCE(x64_jit_blk_reorder_t)))
3030
REG_REORDER_P(DNNL_X64_ONLY(CPU_REORDER_INSTANCE(x64_jit_uni_reorder_t)))
3131

32-
// todo: [AV] disable unused simple reorder primitives
33-
REG_REORDER_P(REG_SR_BIDIR(bf16, any, f32, nCw16c))
32+
#ifdef ENABLE_UNUSED_PRIM
33+
REG_REORDER_P(REG_SR(bf16, any, f32, nCw16c, fmt_order_keep))
34+
#endif
35+
REG_REORDER_P(REG_SR(bf16, any, f32, nCw16c, fmt_order_reverse))
3436
REG_REORDER_P(REG_SR_BIDIR(bf16, any, f32, nChw16c))
3537
REG_REORDER_P(REG_SR_BIDIR(bf16, any, f32, nCdhw16c))
36-
38+
#ifdef ENABLE_UNUSED_PRIM
3739
REG_REORDER_P(REG_SR_BIDIR(bf16, any, s8, nChw16c))
3840
REG_REORDER_P(REG_SR_BIDIR(bf16, any, s8, nCdhw16c))
3941

4042
REG_REORDER_P(REG_SR_BIDIR(bf16, any, u8, nChw16c))
4143
REG_REORDER_P(REG_SR_BIDIR(bf16, any, u8, nCdhw16c))
42-
43-
REG_REORDER_P(REG_SR_BIDIR(bf16, any, bf16, nCw16c))
44+
#endif
45+
REG_REORDER_P(REG_SR(bf16, any, bf16, nCw16c, fmt_order_keep))
46+
#ifdef ENABLE_UNUSED_PRIM
47+
REG_REORDER_P(REG_SR(bf16, any, bf16, nCw16c, fmt_order_reverse))
48+
#endif
4449
REG_REORDER_P(REG_SR_BIDIR(bf16, any, bf16, nChw16c))
4550
REG_REORDER_P(REG_SR_BIDIR(bf16, any, bf16, nCdhw16c))
46-
51+
#ifdef ENABLE_UNUSED_PRIM
4752
REG_REORDER_P(REG_SR_BIDIR(bf16, any, f32, OIdhw16o16i))
4853
REG_REORDER_P(REG_SR_BIDIR(bf16, any, f32, OIdhw16i16o))
4954

@@ -52,11 +57,13 @@ const impl_list_map_t regular_bf16_impl_list_map {
5257

5358
REG_REORDER_P(REG_SR_BIDIR(bf16, any, u8, OIdhw16o16i))
5459
REG_REORDER_P(REG_SR_BIDIR(bf16, any, u8, OIdhw16i16o))
55-
60+
#endif
5661
REG_REORDER_P(REG_SR(bf16, any, bf16, any, fmt_order_any, spec_reference))
5762
REG_REORDER_P(REG_SR(bf16, any, f32, any, fmt_order_any, spec_reference))
63+
#ifdef ENABLE_UNUSED_PRIM
5864
REG_REORDER_P(REG_SR(bf16, any, s8, any, fmt_order_any, spec_reference))
5965
REG_REORDER_P(REG_SR(bf16, any, u8, any, fmt_order_any, spec_reference))
66+
#endif
6067

6168
nullptr,
6269
}},

src/cpu/reorder/cpu_reorder_regular_f32_bf16.cpp

+16-4
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,32 @@ const impl_list_map_t regular_f32_bf16_impl_list_map {
3030
REG_REORDER_P(DNNL_X64_ONLY(CPU_REORDER_INSTANCE(x64_jit_blk_reorder_t)))
3131
REG_REORDER_P(DNNL_X64_ONLY(CPU_REORDER_INSTANCE(x64_jit_uni_reorder_t)))
3232

33-
// todo: [AV] disable unused simple reorder primitives
34-
REG_REORDER_P(REG_SR_BIDIR(f32, ncw, bf16, nCw16c))
35-
REG_REORDER_P(REG_SR_BIDIR(f32, nchw, bf16, nChw16c))
33+
REG_REORDER_P(REG_SR(f32, ncw, bf16, nCw16c, fmt_order_keep))
34+
#ifdef ENABLE_UNUSED_PRIM
35+
REG_REORDER_P(REG_SR(f32, ncw, bf16, nCw16c, fmt_order_reverse))
36+
#endif
37+
REG_REORDER_P(REG_SR(f32, nchw, bf16, nChw16c, fmt_order_keep))
38+
#ifdef ENABLE_UNUSED_PRIM
39+
REG_REORDER_P(REG_SR(f32, nchw, bf16, nChw16c, fmt_order_reverse))
40+
#endif
3641
REG_REORDER_P(REG_SR_BIDIR(f32, any, bf16, nChw16c))
37-
REG_REORDER_P(REG_SR_BIDIR(f32, any, bf16, nCdhw16c))
42+
REG_REORDER_P(REG_SR(f32, any, bf16, nCdhw16c, fmt_order_keep))
43+
#ifdef ENABLE_UNUSED_PRIM
44+
REG_REORDER_P(REG_SR(f32, any, bf16, nCdhw16c, fmt_order_reverse))
45+
#endif
3846

3947
REG_REORDER_P(REG_SR(f32, oihw, bf16, OIhw8i16o2i, fmt_order_keep))
48+
#ifdef ENABLE_UNUSED_PRIM
4049
REG_REORDER_P(REG_SR(f32, goihw, bf16, gOIhw8i16o2i, fmt_order_keep))
50+
#endif
4151
REG_REORDER_P(REG_SR(f32, oihw, bf16, OIhw8o16i2o, fmt_order_keep))
52+
#ifdef ENABLE_UNUSED_PRIM
4253
REG_REORDER_P(REG_SR(f32, goihw, bf16, gOIhw8o16i2o, fmt_order_keep))
4354
REG_REORDER_P(REG_SR(f32, oihw, bf16, IOhw8o16i2o, fmt_order_keep))
4455
REG_REORDER_P(REG_SR(f32, goihw, bf16, gIOhw8o16i2o, fmt_order_keep))
4556
REG_REORDER_P(REG_SR(f32, oihw, bf16, OIhw16i16o, fmt_order_keep))
4657
REG_REORDER_P(REG_SR(f32, goihw, bf16, gOIhw16i16o, fmt_order_keep))
58+
#endif
4759

4860
REG_REORDER_P(REG_SR(f32, any, bf16, any, fmt_order_any, spec_reference))
4961

src/cpu/reorder/cpu_reorder_regular_u8.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ const impl_list_map_t regular_u8_impl_list_map {
5757
REG_REORDER_P(REG_SR_BIDIR(u8, any, s32, nChw16c))
5858
REG_REORDER_P(REG_SR_BIDIR(u8, any, bf16, nChw16c))
5959
REG_REORDER_P(REG_SR_BIDIR(u8, any, s8, nChw16c))
60-
61-
REG_REORDER_P(REG_SR(u8, any, u8, nChw16c, fmt_order_keep))
6260
#endif
63-
REG_REORDER_P(REG_SR(u8, any, u8, nChw16c, fmt_order_reverse))
61+
REG_REORDER_P(REG_SR_BIDIR(u8, any, u8, nChw16c))
6462
REG_REORDER_P(REG_SR(u8, any, f32, nChw8c, fmt_order_keep))
6563
#ifdef ENABLE_UNUSED_PRIM
6664
REG_REORDER_P(REG_SR(u8, any, f32, nChw8c, fmt_order_reverse))

0 commit comments

Comments
 (0)