You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/06/17 08:36:56 UTC
[GitHub] [tvm] junrushao1994 commented on a diff in pull request #11683: [MetaSchedule] Distributed Measurement
junrushao1994 commented on code in PR #11683:
URL: https://github.com/apache/tvm/pull/11683#discussion_r899900392
##########
src/meta_schedule/tune_context.cc:
##########
@@ -70,6 +70,19 @@ void TuneContextNode::Initialize() {
}
}
+MeasureCandidate TuneContextNode::_GetMeasureCandidate(const IRModule& mod,
+ const tir::Trace& trace) {
+ tir::Schedule sch = tir::Schedule::Traced(mod, -1, 0, tir::ScheduleErrorRenderLevel::kDetail);
+ trace->ApplyToSchedule(sch, false, nullptr);
+ tir::PrimFunc func;
+ for (const auto& kv : sch->mod()->functions) {
+ func = Downcast<tir::PrimFunc>(kv.second);
+ }
+ Array<ArgInfo> args_info = ArgInfo::FromPrimFunc(func);
+ MeasureCandidate candidate = MeasureCandidate(sch, args_info);
+ return candidate;
+}
Review Comment:
Note that this method isn't using any fields of the TuneContext, and therefore TuneContext might not be the best place for it to be attached to.
Let's think of a possible alternative: We are only using this method when converting a `TuningRecord` to a `MeasureCandidate` in `distributed_measure_candidates.py`, so how about we move this to `TuningRecordNode::AsMeasureCandidate()`?
--
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