Skip to content

Commit 5624454

Browse files
committed
Further debug logging extending
1 parent fe21422 commit 5624454

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/common/transformations/src/transformations/common_optimizations/convert_quantize_dequantize.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ ov::pass::ConvertQuantizeDequantize::ConvertQuantizeDequantize(
145145
LOG_INFO("\t fq = " << fq << std::endl);
146146
#define LOG_CONSTANT_VALUE(name, value) \
147147
do { \
148-
if (auto const_node = ov::as_type_ptr<ov::op::v0::Constant>(value.get_node_shared_ptr())) { \
148+
auto node = value.get_node_shared_ptr(); \
149+
if (ov::is_type<ov::op::v0::Convert>(node)) { \
150+
node = node->get_input_node_shared_ptr(0); \
151+
} \
152+
if (auto const_node = ov::as_type_ptr<ov::op::v0::Constant>(node)) { \
149153
if (ov::shape_size(const_node->get_shape()) == 1) { \
150154
LOG_INFO("\t " << name << " = " << value \
151155
<< " (constant value: " << const_node->cast_vector<float>()[0] << ")" << std::endl); \

src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,27 +392,28 @@ void TransformationsPipeline::apply(std::shared_ptr<ov::Model> func) {
392392
using namespace ov::pass::low_precision;
393393
auto is_model_quantized = LowPrecision::isFunctionQuantized(func, std::set<levels>{levels::int8, levels::int8_narrow_range});
394394
enableInt8 = config.get_enable_lp_transformations() && is_model_quantized;
395-
#define SERIALIZE_GRAPHS(name) \
396-
do { \
397-
if (std::getenv("QDQ_STRIPPING_SERIALIZE")) { \
398-
manager.register_pass<ov::pass::Serialize>(name, ""); \
399-
} \
395+
#define SERIALIZE_GRAPHS(name) \
396+
do { \
397+
if (std::getenv("QDQ_STRIPPING_SERIALIZE")) { \
398+
manager.register_pass<ov::pass::Serialize>(std::string("qdq_stripping_dumps/") + name + std::string(".xml"), ""); \
399+
manager.register_pass<ov::pass::VisualizeTree>(std::string("qdq_stripping_dumps/") + name + std::string(".svg")); \
400+
} \
400401
} while (0)
401402
{
402403
using namespace ov::element;
403404
// QDQ stripping pipeline
404405
// 1. Transform DQ part to canonicalized form: Multiply->Add => Subtract->Multiply
405-
SERIALIZE_GRAPHS("before.xml");
406+
SERIALIZE_GRAPHS("before");
406407
manager.register_pass<AddTransformation>();
407-
SERIALIZE_GRAPHS("add_transformation.xml");
408+
SERIALIZE_GRAPHS("add_transformation");
408409
// 2. Fuse FQ->Convert->DQ to a single FQ
409410
manager.register_pass<ov::pass::ConvertQuantizeDequantize>(TypeVector{i16, u16, i32},
410411
TypeVector{f16, f32});
411-
SERIALIZE_GRAPHS("convert_qdq.xml");
412+
SERIALIZE_GRAPHS("convert_qdq");
412413
// 3. Strip FQ layers with unsupported levels
413414
bool replace_with_clamp = true;
414415
manager.register_pass<FQStrippingTransformation>(std::set<size_t>{levels::int16}, replace_with_clamp);
415-
SERIALIZE_GRAPHS("fq_stripping.xml");
416+
SERIALIZE_GRAPHS("fq_stripping");
416417
}
417418

418419
manager.register_pass<ov::pass::MarkDequantization>(

0 commit comments

Comments
 (0)