Skip to content

Commit bd2bd93

Browse files
committed
benchdnn: reorder: add f4_e3m0 coverage
1 parent ac7cff6 commit bd2bd93

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tests/benchdnn/dnnl_common.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ void skip_unimplemented_data_type(
665665
const bool has_f4_e2m1_support
666666
= is_gpu() || (is_cpu() && has_data_type_support(dnnl_f4_e2m1));
667667
const bool has_f4_e3m0_support
668-
= is_gpu() || (is_cpu() && has_data_type_support(dnnl_f4_e3m0));
668+
= (is_cpu() && has_data_type_support(dnnl_f4_e3m0));
669669
const bool has_f8_e5m2_support = is_gpu()
670670
|| (is_cpu() && has_data_type_support(dnnl_f8_e5m2)
671671
&& (dir & FLAG_INF));
@@ -677,7 +677,7 @@ void skip_unimplemented_data_type(
677677
// f16 is supported on GPU for inference only.
678678
const bool has_f16_support = is_gpu() && (dir & FLAG_FWD);
679679
const bool has_f4_e2m1_support = is_gpu();
680-
const bool has_f4_e3m0_support = is_gpu();
680+
const bool has_f4_e3m0_support = false;
681681
const bool has_e8m0_support = is_gpu();
682682
const bool has_f8_e5m2_support = is_gpu();
683683
const bool has_f8_e4m3_support = is_gpu();

tests/benchdnn/inputs/reorder/test_reorder_fp4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--reset
22
--sdt=f32
3-
--ddt=f4_e2m1
3+
--ddt=f4_e2m1,f4_e3m0
44
--stag=bax,abx
55
--dtag=abx,bax 2x64x14x14 2x56x14x14
66
--dtag=abx,bax 2x64x64x3x3 2x56x56x3x3
@@ -9,7 +9,7 @@
99
--dtag=gOIhw16i16o,gOIhw2i4o2i,gOIhw2o4i2o,gOIhw4o8i2o 4x16x16x3x3
1010

1111
--reset
12-
--sdt=f4_e2m1
12+
--sdt=f4_e2m1,f4_e3m0
1313
--ddt=f32
1414
--dtag=abx,bax
1515
--stag=bax,abx 2x64x14x14 2x56x14x14

tests/benchdnn/reorder/cfg.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace reorder {
2828

2929
const float int_max_exact = 1 << 24;
3030
const float f16_max_exact = 1 << 11;
31+
const float f4_max_exact = 1 << 3;
3132

3233
#define REG(dt, min, max) \
3334
const dt_conf_s CONCAT2(_conf_, dt) = {CONCAT2(dnnl_, dt), min, max}; \
@@ -40,6 +41,7 @@ REG(bf16, -int_max_exact, int_max_exact);
4041
REG(f8_e5m2, -f16_max_exact, f16_max_exact);
4142
REG(f8_e4m3, -f16_max_exact, f16_max_exact);
4243
REG(f4_e2m1, -f16_max_exact, f16_max_exact);
44+
REG(f4_e3m0, -f4_max_exact, f4_max_exact);
4345
// Do not exceed max float value representable in integer. Otherwise, we get
4446
// a correctness issue caused by different computations in reference and the
4547
// library.
@@ -61,6 +63,7 @@ dt_conf_t dt2cfg(dnnl_data_type_t dt) {
6163
CASE(f8_e5m2);
6264
CASE(f8_e4m3);
6365
CASE(f4_e2m1);
66+
CASE(f4_e3m0);
6467
CASE(s32);
6568
CASE(s8);
6669
CASE(u8);
@@ -81,6 +84,7 @@ dnnl_data_type_t cfg2dt(dt_conf_t cfg) {
8184
CASE(f8_e5m2);
8285
CASE(f8_e4m3);
8386
CASE(f4_e2m1);
87+
CASE(f4_e3m0);
8488
CASE(s32);
8589
CASE(s8);
8690
CASE(u8);

0 commit comments

Comments
 (0)