ONE - On-device Neural Engine
|
#include <BisectionSolver.h>
Public Types | |
enum | Algorithm { Auto , ForceQ16Front , ForceQ16Back } |
Algorithm options for running bisection algorithm. More... | |
Public Member Functions | |
BisectionSolver (const mpqsolver::core::Quantizer::Context &ctx, float qerror_ratio) | |
Construct a new Bisection Solver object. | |
BisectionSolver ()=delete | |
std::unique_ptr< luci::Module > | run (const std::string &module_path) override |
run bisection for recorded float module at module_path | |
void | setInputData (std::unique_ptr< mpqsolver::core::DataProvider > &&data) |
set data provider | |
void | algorithm (Algorithm algorithm) |
set used algorithm | |
void | setVisqPath (const std::string &visq_path) |
set visq_file path to be used in 'auto' mode | |
Public Member Functions inherited from mpqsolver::MPQSolver | |
MPQSolver (const core::Quantizer::Context &ctx) | |
virtual | ~MPQSolver ()=default |
void | setSaveIntermediate (const std::string &save_path) |
set all intermediate artifacts to be saved | |
Additional Inherited Members | |
Protected Member Functions inherited from mpqsolver::MPQSolver | |
std::unique_ptr< luci::Module > | readModule (const std::string &path) |
Protected Attributes inherited from mpqsolver::MPQSolver | |
std::string | _input_quantization |
std::string | _output_quantization |
std::unique_ptr< core::Quantizer > | _quantizer |
std::unique_ptr< core::DumpingHooks > | _hooks |
Definition at line 33 of file BisectionSolver.h.
Algorithm options for running bisection algorithm.
Enumerator | |
---|---|
Auto | |
ForceQ16Front | |
ForceQ16Back |
Definition at line 39 of file BisectionSolver.h.
BisectionSolver::BisectionSolver | ( | const mpqsolver::core::Quantizer::Context & | ctx, |
float | qerror_ratio | ||
) |
Construct a new Bisection Solver object.
ctx | - quantizer context |
qerror_ratio | - target error ratio |
Definition at line 78 of file BisectionSolver.cpp.
|
delete |
void BisectionSolver::algorithm | ( | Algorithm | algorithm | ) |
set used algorithm
Definition at line 99 of file BisectionSolver.cpp.
References algorithm().
Referenced by algorithm(), and handleAutoAlgorithm().
|
overridevirtual |
run bisection for recorded float module at module_path
Implements mpqsolver::MPQSolver.
Definition at line 108 of file BisectionSolver.cpp.
References mpqsolver::MPQSolver::_hooks, mpqsolver::MPQSolver::_quantizer, loco::active_nodes(), Auto, mpqsolver::bisection::compute_depth(), ForceQ16Back, ForceQ16Front, SolverOutput::get(), loco::input_nodes(), loco::output_nodes(), and mpqsolver::bisection::SUCCESS.
Referenced by package.infer.session::inference().
void BisectionSolver::setInputData | ( | std::unique_ptr< mpqsolver::core::DataProvider > && | data | ) |
set data provider
Definition at line 103 of file BisectionSolver.cpp.
void BisectionSolver::setVisqPath | ( | const std::string & | visq_path | ) |
set visq_file path to be used in 'auto' mode
this is used to handle which way (8 or 16bit) of splitting the neural network will be the best for accuracy.
Definition at line 101 of file BisectionSolver.cpp.
Referenced by handleAutoAlgorithm().