You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ek...@apache.org on 2022/12/05 11:11:36 UTC

[tvm] branch main updated: [microNPU] Fix cascade scheduling stability (#13428)

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 <11...@users.noreply.github.com>
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;