This is an automated email from the ASF dual-hosted git repository.
ekalda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 012551ffda [microNPU] Fix cascade scheduling stability (#13428)
012551ffda is described below
commit 012551ffda830d7992a467fce67cdf0ada3a1826
Author: Alexey Yazev <[email protected]>
AuthorDate: Mon Dec 5 15:11:28 2022 +0400
[microNPU] Fix cascade scheduling stability (#13428)
For Plans/Proposals added sorting by the number of cycles in case the
memory used matches.
---
src/contrib/ethosu/cascader/pareto.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/contrib/ethosu/cascader/pareto.cc
b/src/contrib/ethosu/cascader/pareto.cc
index e40a6602fa..5d025b57bb 100644
--- a/src/contrib/ethosu/cascader/pareto.cc
+++ b/src/contrib/ethosu/cascader/pareto.cc
@@ -91,6 +91,9 @@ std::vector<Plan> ParetoCullPlans(std::vector<Plan> plans,
size_t max_plans,
}
std::sort(plans.begin(), plans.end(), [](const Plan& a, const Plan& b) ->
bool {
+ if (a->GetMemoryUsage() == b->GetMemoryUsage()) {
+ return a->GetCycles() < b->GetCycles();
+ }
return a->GetMemoryUsage() < b->GetMemoryUsage();
});
std::vector<std::array<float, 2>> costs;
@@ -122,6 +125,9 @@ std::vector<Proposal>
ParetoCullProposals(std::vector<Proposal> proposals, size_
}
std::sort(proposals.begin(), proposals.end(), [](const Proposal& a, const
Proposal& b) -> bool {
+ if (a->GetMemoryUsage() == b->GetMemoryUsage()) {
+ return a->GetCycles() < b->GetCycles();
+ }
return a->GetMemoryUsage() < b->GetMemoryUsage();
});
std::vector<std::array<float, 2>> costs;