Skip to content
Snippets Groups Projects
Commit 49a5955c authored by Benjamin Halimi's avatar Benjamin Halimi
Browse files

minor changes

parent 60a15d67
No related branches found
No related tags found
2 merge requests!54Update 0.3.1 -> 0.4.0,!50Enhancement : Quantizer only PTQ
Pipeline #69941 failed
...@@ -238,15 +238,14 @@ static void insertChildren(std::shared_ptr<Node> parent, std::shared_ptr<Node> n ...@@ -238,15 +238,14 @@ static void insertChildren(std::shared_ptr<Node> parent, std::shared_ptr<Node> n
graphView->add(newNode); graphView->add(newNode);
} }
// XXX XXX XXX
void foldProducerQuantizers(std::shared_ptr<GraphView> graphView) void foldProducerQuantizers(std::shared_ptr<GraphView> graphView)
{ {
std::vector<std::shared_ptr<Node>> quantizers; std::vector<std::shared_ptr<Node>> producerQuantizers;
for (std::shared_ptr<Node> node : graphView->getNodes()) for (std::shared_ptr<Node> node : graphView->getNodes())
if (hasAttr(node, "isProducerScaling")) if (hasAttr(node, "isProducerScaling"))
quantizers.push_back(node); producerQuantizers.push_back(node);
for (std::shared_ptr<Node> quantizer : quantizers) for (std::shared_ptr<Node> quantizer : producerQuantizers)
{ {
// Log::notice(" Quantizer : {} {} ", quantizer->name(), quantizer->type()); // Log::notice(" Quantizer : {} {} ", quantizer->name(), quantizer->type());
...@@ -1252,9 +1251,8 @@ void quantizeNetwork(std::shared_ptr<GraphView> graphView, std::uint8_t nbBits, ...@@ -1252,9 +1251,8 @@ void quantizeNetwork(std::shared_ptr<GraphView> graphView, std::uint8_t nbBits,
if (foldGraph) if (foldGraph)
{ {
Log::notice(" Folding producer's quantizers ..."); Log::notice(" Folding the Producer's Quantizers ...");
foldProducerQuantizers(graphView); foldProducerQuantizers(graphView);
Log::notice(" YYY ZZZ ");
} }
if (verbose) if (verbose)
......
...@@ -43,11 +43,12 @@ std::shared_ptr<Node> BaseQuantizer(double scalingFactor, const std::string& nam ...@@ -43,11 +43,12 @@ std::shared_ptr<Node> BaseQuantizer(double scalingFactor, const std::string& nam
std::shared_ptr<Node> scalingFactorProducer = addProducer<1>(mulNode, 1, {1}, "ScalingFactor"); std::shared_ptr<Node> scalingFactorProducer = addProducer<1>(mulNode, 1, {1}, "ScalingFactor");
scalingFactorProducer->getOperator()->setOutput(0, scalingFactorTensor); scalingFactorProducer->getOperator()->setOutput(0, scalingFactorTensor);
// TODO : the above should be replaced by : // TODO : the above could be replaced by :
/* /*
std::shared_ptr<Node> scalingFactorProducer = Producer(scalingFactorTensor); std::shared_ptr<Node> scalingFactorProducer = Producer(scalingFactorTensor);
scalingFactorProducer->addChild(mulNode, 0, 1); scalingFactorProducer->addChild(mulNode, 0, 1);
*/ */
// create the graphView ...
std::shared_ptr<GraphView> graphView = Sequential({mulNode}); std::shared_ptr<GraphView> graphView = Sequential({mulNode});
graphView->add(scalingFactorProducer); graphView->add(scalingFactorProducer);
...@@ -157,7 +158,8 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl ...@@ -157,7 +158,8 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl
SequentialScheduler scheduler(newMicroGraph); SequentialScheduler scheduler(newMicroGraph);
scheduler.resetScheduling(); scheduler.resetScheduling();
//scheduler.generateScheduling();
// set the micrograph // set the micrograph
*microGraph = *newMicroGraph; *microGraph = *newMicroGraph;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment