-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[microNPU] Fix cascade scheduling stability #13428
[microNPU] Fix cascade scheduling stability #13428
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alexey-yazev, looks good! :)
What I gather is that the instability in the cascader comes from nondeterministic sorting when two Plans/Proposals have the same memory usage. It makes sense to me then to look at the cycle count as a differentiating metric. However, in the case where we have identical performance and memory use, I can't think of a reason why one of the Plans/Proposals should be advantageous of the other, so I wonder if this could be simplified by just removing one of the Plan or Proposal?
Thanks @ekalda! |
I suppose checking for the equality of |
I suppose there can be two kinds of instability there: (A bit of a stab in the dark there) |
Yes, I think you are right, thinking about it, we can't really check for the equality of |
Without running the StorageRewrite pass (changes were merged in PR #13365) amount of allocated memory is same from launch to launch despite the fact that different proposals are applied.
There is the first one and it happens if the StorageRewrite pass was run. |
For this pull request, will it be enough to add an additional parameter to sort Plans/Proposals or do I need to investigate problem with different memory allocations when running StorageRewrite pass? |
Sorry for the delay on this - I don't think we should spend much time investigating the instability that results from using StorageRewrite since Ethos-U is intended to be run with the USMP, so debugging the internals of StorageRewrite seems a bit out of scope here. |
a0f521b
to
10e8390
Compare
Thanks, on changes in the code I left only additional conditions for sorting. |
The reason for allocating different amounts of memory from launch to launch was that when determining optimal proposals, there are elements in the collection with the same costs metrics and the first of these metrics becomes optimal and the rest are discarded. the problem was solved by adding an additional sorting condition by shapes from StripeConfigs in the case when the metrics match.
10e8390
to
30a4503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @alexey-yazev! |
For Plans/Proposals added sorting by the number of cycles in case the memory used matches.
cc @leandron @ekalda, @NicolaLancellotti