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
graphView->add(newNode);
}
// XXX XXX XXX
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())
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());
......@@ -1252,9 +1251,8 @@ void quantizeNetwork(std::shared_ptr<GraphView> graphView, std::uint8_t nbBits,
if (foldGraph)
{
Log::notice(" Folding producer's quantizers ...");
Log::notice(" Folding the Producer's Quantizers ...");
foldProducerQuantizers(graphView);
Log::notice(" YYY ZZZ ");
}
if (verbose)
......
......@@ -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");
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);
scalingFactorProducer->addChild(mulNode, 0, 1);
*/
// create the graphView ...
std::shared_ptr<GraphView> graphView = Sequential({mulNode});
graphView->add(scalingFactorProducer);
......@@ -157,7 +158,8 @@ void appendRoundClip(std::shared_ptr<Node> metaOpNode, double clipMin, double cl
SequentialScheduler scheduler(newMicroGraph);
scheduler.resetScheduling();
//scheduler.generateScheduling();
// set the micrograph
*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