Skip to content

Commit

Permalink
[circle-mpqsolver] Dump config (Samsung#12285)
Browse files Browse the repository at this point in the history
This commit dumps final qconfig in PatternSolver
if save_intermediate option is on.

ONE-DCO-1.0-Signed-off-by: s.malakhov <[email protected]>
  • Loading branch information
stamalakhov authored Dec 14, 2023
1 parent ab0cee9 commit f64b740
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "PatternResolver.h"

#include <iostream>
#include <cmath>

using namespace mpqsolver::pattern;

Expand All @@ -38,10 +39,21 @@ std::unique_ptr<luci::Module> 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");
Expand Down

0 comments on commit f64b740

Please sign in to comment.