Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8a5b7bd

Browse files
committedDec 18, 2024
benchdnn: matmul: add f4_e3m0 coverage
1 parent bd2bd93 commit 8a5b7bd

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
 

‎tests/benchdnn/inputs/matmul/test_matmul_fp4

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
--attr-post-ops=
88

99
## plain fp4
10-
--dt=f4_e2m1,f4_e2m1:f4_e2m1:f32,f4_e2m1:f4_e2m1:bf16
10+
--dt=f4_e2m1,f4_e2m1:f4_e2m1:f32,f4_e2m1:f4_e2m1:bf16,f4_e2m1:f4_e3m0:f4_e2m1
1111
--attr-scales=
1212
24x32:32x64
1313
25x32:32x16

‎tests/benchdnn/matmul/cfg.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
6767
{{dnnl_bf16}, {-4, 4}},
6868
{{dnnl_f16}, {-4, 4}},
6969
{{dnnl_f4_e2m1}, {0, 1}},
70+
{{dnnl_f4_e3m0}, {0, 1}},
7071
{{dnnl_f8_e5m2}, {-4, 4}},
7172
{{dnnl_f8_e4m3}, {-4, 4}},
7273
{{dnnl_s8}, {-4, 4}},
@@ -79,6 +80,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
7980
{{dnnl_bf16}, {-8, 8}},
8081
{{dnnl_f16}, {-2, 2}},
8182
{{dnnl_f4_e2m1}, {-1, 1}},
83+
{{dnnl_f4_e3m0}, {-1, 1}},
8284
{{dnnl_f8_e5m2}, {-2, 2}},
8385
{{dnnl_f8_e4m3}, {-2, 2}},
8486
{{dnnl_s8}, {-4, 4}},
@@ -93,6 +95,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
9395
{{dnnl_bf16}, {-8, 8}},
9496
{{dnnl_f16}, {-8, 8}},
9597
{{dnnl_f4_e2m1}, {-2, 2}},
98+
{{dnnl_f4_e3m0}, {-2, 2}},
9699
{{dnnl_f8_e5m2}, {-8, 8}},
97100
{{dnnl_f8_e4m3}, {-8, 8}},
98101
{{dnnl_s8}, {-8, 8}},
@@ -111,6 +114,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
111114
{{dnnl_bf16}, {-8, 8}},
112115
{{dnnl_f16}, {-4, 4}},
113116
{{dnnl_f4_e2m1}, {-2, 2}},
117+
{{dnnl_f4_e3m0}, {-2, 2}},
114118
{{dnnl_f8_e5m2}, {-4, 4}},
115119
{{dnnl_f8_e4m3}, {-4, 4}},
116120
{{dnnl_s8}, {-4, 4}},

‎tests/benchdnn/matmul/matmul.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,15 @@ void skip_unimplemented_prb(const prb_t *prb, res_t *res) {
635635
res->reason = skip_reason::case_not_supported;
636636
return;
637637
}
638+
639+
if (prb->src_dt() == dnnl_f4_e3m0 || prb->dst_dt() == dnnl_f4_e3m0
640+
|| prb->wei_dt() == dnnl_f4_e3m0) {
641+
BENCHDNN_PRINT(2, "[SKIP][%s:%d]: GPU has no fp4_e3m0 support.\n",
642+
__FILE__, __LINE__);
643+
res->state = SKIPPED;
644+
res->reason = skip_reason::case_not_supported;
645+
return;
646+
}
638647
}
639648
}
640649

0 commit comments

Comments
 (0)
Please sign in to comment.