[GPU] print datashape of input for benchmark_app (#20943)
* print datashape of input for benchmark_app
This commit is contained in:
parent
09a45bceae
commit
9cc4c25e48
@ -100,6 +100,7 @@ public:
|
||||
int verbose_color; // Print verbose color
|
||||
int list_layers; // Print list layers
|
||||
int print_multi_kernel_perf; // Print execution time of each kernel in multi-kernel primitimive
|
||||
int print_input_data_shapes; // Print the input data_shape for benchmark_app.
|
||||
int disable_usm; // Disable usm usage
|
||||
int disable_onednn; // Disable onednn for discrete GPU (no effect for integrated GPU)
|
||||
int disable_onednn_opt_post_ops; // Disable onednn optimize post operators
|
||||
|
@ -1378,6 +1378,28 @@ void network::execute_impl(const std::vector<event::ptr>& events) {
|
||||
}
|
||||
}
|
||||
|
||||
// print '-data_shape' option for benchmark_app
|
||||
GPU_DEBUG_IF(debug_config->print_input_data_shapes == 1) {
|
||||
std::stringstream data_shape_str;
|
||||
auto add_string = [&data_shape_str](std::string str) {
|
||||
data_shape_str << ((data_shape_str.rdbuf()->in_avail() == 0) ? " -data_shape " : ",") << str;
|
||||
};
|
||||
|
||||
for (auto& inst : _exec_order) {
|
||||
auto name = inst->id();
|
||||
auto pos = name.find(':');
|
||||
auto type = name.substr(0, pos);
|
||||
name.erase(0, pos + 1);
|
||||
if (inst->is_input() && type == "parameter") {
|
||||
add_string(name + inst->get_output_layout().get_partial_shape().to_string());
|
||||
}
|
||||
}
|
||||
|
||||
GPU_DEBUG_COUT << "[program:" << std::setw(2) << ((get_program() != nullptr) ? get_program()->get_id() : 0)
|
||||
<< "|network:" << std::setw(2) << get_id() << "|iter:" << std::setw(4) << curr_iter << "] benchmark_app cmd: "
|
||||
<< data_shape_str.str() << std::endl;
|
||||
}
|
||||
|
||||
// Store events only in case of OOO queue or enabled Profiling
|
||||
auto store_events = is_out_of_order_queue || _enable_profiling;
|
||||
if (store_events) {
|
||||
|
@ -108,6 +108,7 @@ static void print_help_messages() {
|
||||
message_list.emplace_back("OV_GPU_VerboseColor", "Print verbose color");
|
||||
message_list.emplace_back("OV_GPU_ListLayers", "Print layers names");
|
||||
message_list.emplace_back("OV_GPU_PrintMultiKernelPerf", "Print execution time of each kernel in multi-kernel primitimive");
|
||||
message_list.emplace_back("OV_GPU_PrintInputDataShapes", "Print data_shapes of input layers for benchmark_app.");
|
||||
message_list.emplace_back("OV_GPU_DisableUsm", "Disable usm usage");
|
||||
message_list.emplace_back("OV_GPU_DisableOnednn", "Disable onednn for discrete GPU (no effect for integrated GPU)");
|
||||
message_list.emplace_back("OV_GPU_DisableOnednnOptPostOps", "Disable onednn optimize post operators");
|
||||
@ -173,6 +174,7 @@ debug_configuration::debug_configuration()
|
||||
, verbose_color(0)
|
||||
, list_layers(0)
|
||||
, print_multi_kernel_perf(0)
|
||||
, print_input_data_shapes(0)
|
||||
, disable_usm(0)
|
||||
, disable_onednn(0)
|
||||
, disable_onednn_opt_post_ops(0)
|
||||
@ -206,6 +208,7 @@ debug_configuration::debug_configuration()
|
||||
get_gpu_debug_env_var("VerboseColor", verbose_color);
|
||||
get_gpu_debug_env_var("ListLayers", list_layers);
|
||||
get_gpu_debug_env_var("PrintMultiKernelPerf", print_multi_kernel_perf);
|
||||
get_gpu_debug_env_var("PrintInputDataShapes", print_input_data_shapes);
|
||||
get_gpu_debug_env_var("DisableUsm", disable_usm);
|
||||
get_gpu_debug_env_var("DumpGraphs", dump_graphs);
|
||||
get_gpu_debug_env_var("DumpSources", dump_sources);
|
||||
|
Loading…
Reference in New Issue
Block a user