File tree 1 file changed +9
-1
lines changed
src/plugins/intel_npu/src/plugin/npuw/partitioning/online
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -445,8 +445,16 @@ std::shared_ptr<Repeated> Snapshot::tryGrowRepeatingGroups(const detail::GPtrSet
445
445
if (a.empty ()) {
446
446
return false ; // doesn't matter for stability - no groups are fused
447
447
}
448
- return a.at (0 ).first ->getId () < b.at (0 ).first ->getId ();
448
+ // This std::sort allows to prioritize groups from the tail
449
+ // of the original model. It's possible due to preservation of
450
+ // group IDs in topological order throughout the whole partitioning process.
451
+ // In the networks we're looking at, ensuring the merge order from the bottom
452
+ // of the network gives a better structure of a repeated block which can be
453
+ // later optimized by the plugin.
454
+ return a.at (0 ).first ->getId () > b.at (0 ).first ->getId ();
449
455
}
456
+ // Generally we prefer bigger blocks (in terms of number of layers)
457
+ // to be merged first. For other cases check the comment above
450
458
return a.size () > b.size ();
451
459
});
452
460
You can’t perform that action at this time.
0 commit comments