Skip to content

Commit

Permalink
benchdnn: matmul: add f4_e3m0 coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mgouicem committed Dec 20, 2024
1 parent 339842f commit 34ae972
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/benchdnn/inputs/matmul/test_matmul_fp4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--attr-post-ops=

## plain fp4
--dt=f4_e2m1,f4_e2m1:f4_e2m1:f32,f4_e2m1:f4_e2m1:bf16
--dt=f4_e2m1,f4_e2m1:f4_e2m1:f32,f4_e2m1:f4_e2m1:bf16,f4_e2m1:f4_e3m0:f4_e2m1
--attr-scales=
24x32:32x64
25x32:32x16
Expand Down
4 changes: 4 additions & 0 deletions tests/benchdnn/matmul/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
{{dnnl_bf16}, {-4, 4}},
{{dnnl_f16}, {-4, 4}},
{{dnnl_f4_e2m1}, {0, 1}},
{{dnnl_f4_e3m0}, {0, 1}},
{{dnnl_f8_e5m2}, {-4, 4}},
{{dnnl_f8_e4m3}, {-4, 4}},
{{dnnl_s8}, {-4, 4}},
Expand All @@ -79,6 +80,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
{{dnnl_bf16}, {-8, 8}},
{{dnnl_f16}, {-2, 2}},
{{dnnl_f4_e2m1}, {-1, 1}},
{{dnnl_f4_e3m0}, {-1, 1}},
{{dnnl_f8_e5m2}, {-2, 2}},
{{dnnl_f8_e4m3}, {-2, 2}},
{{dnnl_s8}, {-4, 4}},
Expand All @@ -93,6 +95,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
{{dnnl_bf16}, {-8, 8}},
{{dnnl_f16}, {-8, 8}},
{{dnnl_f4_e2m1}, {-2, 2}},
{{dnnl_f4_e3m0}, {-2, 2}},
{{dnnl_f8_e5m2}, {-8, 8}},
{{dnnl_f8_e4m3}, {-8, 8}},
{{dnnl_s8}, {-8, 8}},
Expand All @@ -111,6 +114,7 @@ cfg_t::cfg_entry_t::cfg_map_t cfg_t::get_cfg_map(data_kind_t kind) const {
{{dnnl_bf16}, {-8, 8}},
{{dnnl_f16}, {-4, 4}},
{{dnnl_f4_e2m1}, {-2, 2}},
{{dnnl_f4_e3m0}, {-2, 2}},
{{dnnl_f8_e5m2}, {-4, 4}},
{{dnnl_f8_e4m3}, {-4, 4}},
{{dnnl_s8}, {-4, 4}},
Expand Down
9 changes: 9 additions & 0 deletions tests/benchdnn/matmul/matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,15 @@ void skip_unimplemented_prb(const prb_t *prb, res_t *res) {
res->reason = skip_reason::case_not_supported;
return;
}

if (prb->src_dt() == dnnl_f4_e3m0 || prb->dst_dt() == dnnl_f4_e3m0
|| prb->wei_dt() == dnnl_f4_e3m0) {
BENCHDNN_PRINT(2, "[SKIP][%s:%d]: GPU has no fp4_e3m0 support.\n",
__FILE__, __LINE__);
res->state = SKIPPED;
res->reason = skip_reason::case_not_supported;
return;
}
}
}

Expand Down

0 comments on commit 34ae972

Please sign in to comment.