graphView.forwardDims();// forwardDims() can be called only once after insertScalingNodes functionscheduler.generateScheduling();std::vector<std::shared_ptr<Node>>nodeVector=scheduler.getStaticScheduling();
Replacing scheduler.forward() with forwardDims() and generateScheduling() in extractNodeVector is functionnal.
Another issue arise when using extractNodeVector without an input producer previously set in the graph (as done in cell In[6] from PTQ_tutorial
In the case 2., the generated node vector (ordered nodes from the scheduler) is incorrect. It contains only the scaling nodes and the last FC node. Seelog_issue.txt
The following actions were taken :
Check the graph before and after inserting scaling nodes : the graph structure is correct
Add the call of connectInput before generating the scheduling : does not solve the issue
voidquantizeNetwork(std::shared_ptr<GraphView>graphView,std::uint8_tnbBits,std::vector<std::shared_ptr<Tensor>>inputDataSet){Log::info(" === QUANT PTQ 0.2.7 === ");if(!checkArchitecture(graphView))return;Log::info(" Removing the flatten nodes ... ");removeFlatten(graphView);Log::info(" Removing the Softmax node ... ");popSoftMax(graphView);Log::info(" Inserting the scaling nodes ...");insertScalingNodes(graphView);SequentialSchedulerscheduler(graphView);std::vector<std::shared_ptr<Tensor>>data={inputDataSet[0]};scheduler.connectInputs(data);graphView->forwardDims();scheduler.generateScheduling();std::vector<std::shared_ptr<Node>>nodeVector=scheduler.getStaticScheduling();fixScheduling(nodeVector);removeMatchingNodes(nodeVector,"Producer");Log::info("NB OF NODES = {}",nodeVector.size());for(std::shared_ptr<Node>node:nodeVector)Log::info("{} {}",node->type(),node->name());Log::info(" Normalizing the parameters ...");normalizeParameters(graphView,nodeVector);