diff --git a/src/common/snippets/docs/debug_capabilities/parameters_dump.md b/src/common/snippets/docs/debug_capabilities/parameters_dump.md index 26b49357dbabfd..40fa46a55d1d9a 100644 --- a/src/common/snippets/docs/debug_capabilities/parameters_dump.md +++ b/src/common/snippets/docs/debug_capabilities/parameters_dump.md @@ -1,8 +1,8 @@ # Snippet parameters dump -Snippet parameters can be captured during the pass flow, which can be useful for debugging and optimization purposes. +The pass dumps selected properties of some performance-critical operations in Subgraphs. Only MatMuls are currently supported by this pass. -To turn on snippet parameters dump feature, the following environment variable should be used: +To turn on snippet properties dump feature, the following environment variable should be used: ```sh OV_SNIPPETS_DUMP_BRGEMM_PARAMS="path=" binary ... ``` @@ -13,6 +13,7 @@ Examples: ``` Output example: + | subgraph_name | name | in_type | out_type | in_shapes | out_shapes | in_layouts | out_layouts | M | N | K | m_block | n_block | k_block | acc_max_time | avg_max_time | |--------------------|------------|-------------|----------|-------------------------------------|----------------------|--------------------------|-------------|-----|-----|-----|---------|----------|----------|---------------|---------------| | FakeQuantitze_457 | MatMul_438 | i8;i8;f32 | i32 | 1 16 128 64;1 16 64 128;1 16 64 128 | 1 16 128 128 | 0 2 1 3;0 1 2 3;0 1 2 3; | 0 1 2 3; | 128 | 128 | 64 | 32 | FULL_DIM | FULL_DIM | 41482 | 5185 | diff --git a/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp b/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp index 6f559cbe4ad69f..96dc258dc05fa8 100644 --- a/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp @@ -39,6 +39,7 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass { } static size_t seq_number = 0; bool modified = false; + auto csv_path = linear_ir.get_config().debug_config.dumpParams.csv_path; for (auto expr_it = begin; expr_it != end; expr_it++) { const auto& brgemm_expr = *expr_it; const auto brgemm = ov::as_type_ptr(brgemm_expr->get_node()); @@ -56,7 +57,6 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass { perf_count_end->set_friendly_name(std::string("PerfCount_End_") + std::to_string(seq_number) + "_DebugParams"); // Attach brgemm parameters to PerfCountEnd node - auto csv_path = linear_ir.get_config().debug_config.dumpParams.csv_path; perf_count_end->get_rt_info()["brgemm_params"] = params; perf_count_end->get_rt_info()["brgemm_params_csv_path"] = csv_path; linear_ir.insert_node(perf_count_end, empty_inputs, expr_it->get()->get_loop_ids(), false, next(expr_it)); @@ -69,7 +69,6 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass { private: std::string collect_params(const ov::snippets::lowered::ExpressionPtr& brgemm_expr, const snippets::lowered::LinearIR& linear_ir) { - auto debug_config = linear_ir.get_config().debug_config; const auto brgemm = ov::as_type_ptr(brgemm_expr->get_node()); OPENVINO_ASSERT(brgemm, "Brgemm is nullptr!"); std::stringstream ss; diff --git a/src/common/snippets/src/op/perf_count.cpp b/src/common/snippets/src/op/perf_count.cpp index 81094a4b4babfe..f27eb355ba10d2 100644 --- a/src/common/snippets/src/op/perf_count.cpp +++ b/src/common/snippets/src/op/perf_count.cpp @@ -142,7 +142,9 @@ void PerfCountEnd::output_perf_count() { } if (brgemm_csv_path.empty()) { auto brgemm_csv_path_it = rt_info.find("brgemm_params_csv_path"); - brgemm_csv_path = brgemm_csv_path_it->second.as(); + if (brgemm_csv_path_it != rt_info.end()) { + brgemm_csv_path = brgemm_csv_path_it->second.as(); + } } m_debug_params_map[get_friendly_name()] = brgemm_params_it->second.as() + std::to_string(acc_max) + ',' + std::to_string(avg_max);