You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Icemist (via GitHub)" <gi...@apache.org> on 2023/01/23 13:16:46 UTC
[GitHub] [tvm] Icemist commented on a diff in pull request #13824: [Metaschedule] get_top_k should not return not built records
Icemist commented on code in PR #13824:
URL: https://github.com/apache/tvm/pull/13824#discussion_r1084043326
##########
src/meta_schedule/database/memory_database.cc:
##########
@@ -68,20 +68,20 @@ class MemoryDatabaseNode : public DatabaseNode {
std::vector<std::pair<double, TuningRecord>> results;
results.reserve(records.size());
for (const TuningRecord& record : records) {
- if (!record->run_secs.defined()) {
- continue;
- }
- Array<FloatImm> run_secs = record->run_secs.value();
- if (run_secs.empty()) {
+ auto run_secs = record->run_secs;
+ 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; })) {
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org