Skip to content
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

[Metaschedule] get_top_k should not return not built records #13824

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

Icemist
Copy link
Contributor

@Icemist Icemist commented Jan 23, 2023

Avoid the situation when the records have measurements equal to 1e10, which is used as a stub for an indefinite measurement time, for example, when forming a cost models of the meta scheduler. The result of this will be extracting a record(that fails while building) as the best and an error in applying the tuning.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 23, 2023

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

@Icemist
Copy link
Contributor Author

Icemist commented Jan 23, 2023

CC @masahi @echuraev

Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM. One minor question. @Icemist what do you think about that?

if (!run_secs.defined() || run_secs.value().empty() ||
std::all_of(run_secs.value().begin(), run_secs.value().end(),
// 1e10 is used as a stub for undefined measurement times.
[](tvm::FloatImm v) { return v.defined() && v->value == 1e10; })) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can define this constant in some common place and reuse it here and in other places?
E.g. as it was done here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about using SortTuningRecordByMeanRunSecs, but memory_database is not sorted unlike json_database.
This constant appears in all tuners and unfortunately there is no common definition for it.
I can suggest to make an NFC patch with refactoring this constant throughout the repository.

@masahi masahi merged commit e79fac6 into apache:main Jan 24, 2023
fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
…13824)

* [Metaschedule] get_top_k should not return not built records

* [Metaschedule][NFC] GetTopK extra polishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants