From f64b740af14229f314af397fab8dc3791327ae00 Mon Sep 17 00:00:00 2001 From: stamalakhov <112689352+stamalakhov@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:53:37 +0300 Subject: [PATCH] [circle-mpqsolver] Dump config (#12285) This commit dumps final qconfig in PatternSolver if save_intermediate option is on. ONE-DCO-1.0-Signed-off-by: s.malakhov --- .../circle-mpqsolver/src/pattern/PatternSolver.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp b/compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp index 21e30b7b86e..71451d03d10 100644 --- a/compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp +++ b/compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp @@ -19,6 +19,7 @@ #include "PatternResolver.h" #include +#include using namespace mpqsolver::pattern; @@ -38,10 +39,21 @@ std::unique_ptr PatternSolver::run(const std::string &module_path) auto module = readModule(module_path); assert(module != nullptr); + _quantizer->setHook(_hooks.get()); + if (_hooks) + { + _hooks->onBeginSolver(module_path, NAN, NAN); + } + resolvePatterns(module.get()); auto layer_params = getFrozenParams(); + if (_hooks) + { + _hooks->onEndSolver(layer_params, _quantizer->getContext().output_model_dtype, NAN); + } + if (!_quantizer->quantize(module.get(), layer_params)) { throw std::runtime_error("Failed to quantize model");