Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] Add debug option print_list_layer (#33093)

hyunback kim43c25a3d1f33
diff --git a/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp b/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp
index e921d6bef94..7f54293f998 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp
@@ -181,6 +181,8 @@ static constexpr Property<bool, ov::PropertyMutability::RW> validate_output_buff
static constexpr Property<float, ov::PropertyMutability::RW> mem_pool_util_threshold{"GPU_MEM_POOL_UTIL_THRESHOLD"};
static constexpr Property<bool, ov::PropertyMutability::RW> dump_src_after_exec{"GPU_DUMP_SRC_TENSORS_AFTER_EXEC"};
static constexpr Property<bool, ov::PropertyMutability::RW> allow_bypass_xattn{"GPU_ALLOW_BYPASS_XATTN_EXEC"};
+static constexpr Property<bool, ov::PropertyMutability::RW> list_layers{"GPU_LIST_LAYERS"};
+static constexpr Property<bool, ov::PropertyMutability::RW> print_input_data_shapes{"GPU_PRINT_INPUT_DATA_SHAPES"};
} // namespace ov::intel_gpu
namespace cldnn {
diff --git a/src/plugins/intel_gpu/include/intel_gpu/runtime/options.inl b/src/plugins/intel_gpu/include/intel_gpu/runtime/options.inl
index 5301b5d00ba..9507c7d7c5c 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/runtime/options.inl
+++ b/src/plugins/intel_gpu/include/intel_gpu/runtime/options.inl
@@ -99,3 +99,5 @@ OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, dry_run_path, "", "Enables mode which part
OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, validate_output_buffer, false, "Validate output buffers of all layers which have fp16 data-type to find 'inf' and 'nan' value.")
OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, dynamic_quantization_bisect, std::numeric_limits<int64_t>::max(), "Apply dynamic quantization only up to this count")
OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, dynamic_quantization_single, -1, "Apply dynamic quantization only to this index")
+OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, list_layers, false, "Print layers list")
+OV_CONFIG_DEBUG_OPTION(ov::intel_gpu, print_input_data_shapes, false, "print input data shapes")
diff --git a/src/plugins/intel_gpu/src/graph/debug_helper.cpp b/src/plugins/intel_gpu/src/graph/debug_helper.cpp
index fe986f18106..01be9dcea34 100644
--- a/src/plugins/intel_gpu/src/graph/debug_helper.cpp
+++ b/src/plugins/intel_gpu/src/graph/debug_helper.cpp
@@ -628,6 +628,30 @@ NetworkDebugHelper::NetworkDebugHelper(const network& net)
GPU_DEBUG_TRACE << "============================================================================" << std::endl;
GPU_DEBUG_TRACE << "Start network execution (net_id : " << net_id << ", iter :" << m_iter << ")" << std::endl;
}
+
+ if (config.get_list_layers()) {
+ for (auto& inst : m_network._exec_order) {
+ GPU_DEBUG_COUT << inst->id() << std::endl;
+ if (inst->get_node().is_type<loop>()) {
+ auto& loop_node = inst->get_node().as<loop>();
+ for (auto& prim : loop_node.get_body_program()->get_processing_order()) {
+ GPU_DEBUG_COUT << "\t" << prim->id() << std::endl;
+ }
+ } else if (inst->get_node().is_type<condition>()) {
+ auto& cond_node = inst->get_node().as<condition>();
+ GPU_DEBUG_COUT << "* Branch_True" << std::endl;
+ for (auto& prim : cond_node.get_branch_true().inner_program->get_processing_order()) {
+ GPU_DEBUG_COUT << "\t" << prim->id() << std::endl;
+ }
+ GPU_DEBUG_COUT << "* Branch_False" << std::endl;
+ for (auto& prim : cond_node.get_branch_false().inner_program->get_processing_order()) {
+ GPU_DEBUG_COUT << "\t" << prim->id() << std::endl;
+ }
+ }
+ }
+ if (!m_network.is_internal())
+ exit(0);
+ }
}
NetworkDebugHelper::~NetworkDebugHelper() {
@@ -635,7 +659,7 @@ NetworkDebugHelper::~NetworkDebugHelper() {
auto net_id = m_network.get_id();
const auto& config = prog->get_config();
// print '-data_shape' option for benchmark_app
- if (config.get_verbose() >= 4) {
+ if (config.get_print_input_data_shapes() || config.get_verbose() >= 4) {
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;