Skip to content

Commit

Permalink
benchdnn: graph: restrict usage of mode-modifier=M
Browse files Browse the repository at this point in the history
The driver lacks the proper support of this functionality.
  • Loading branch information
dzarukin committed Jan 15, 2025
1 parent 90a13cf commit 829ad2b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/benchdnn/doc/driver_graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ disabled. When the build option is on, and the `ONEDNN_GRAPH_DUMP=subgraph` envi
variable is specified, the library generates JSON files with partitions
returned.

## Limitations

* Graph driver doesn't support `--mode-modifier=M` or `--mode=F` (which contains
`--mode-modifier=M` in it).

## Example

Run the demo `conv_post_ops_fusion` partition
Expand Down
14 changes: 13 additions & 1 deletion tests/benchdnn/graph/bench_graph.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2022-2024 Intel Corporation
* Copyright 2022-2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,6 +56,17 @@ void check_correctness(const settings_t &s) {
}
}

int verify_input(const settings_t &s) {
if (has_bench_mode_modifier(mode_modifier_t::no_ref_memory)) {
// TODO: update graph driver doc page once the limitation is removed.
BENCHDNN_PRINT(0, "%s\n",
"Error: graph driver doesn't support "
"--mode-modifier=M/--mode=F.");
return FAIL;
}
return OK;
}

int bench(int argc, char **argv) {
driver_name = "graph";
using namespace parser;
Expand All @@ -75,6 +86,7 @@ int bench(int argc, char **argv) {
if (!parsed_options) {
if (!parse_input_file(s.json_file, argv[0]))
catch_unknown_options(argv[0]);
SAFE(verify_input(s), WARN);
check_correctness(s);
flush_temp_memory();
}
Expand Down

0 comments on commit 829ad2b

Please sign in to comment.