Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/meta_schedule/schedule_rule/multi_level_tiling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void MultiLevelTilingNode::InitializeWithTuneContext(const TuneContext& context)
TVM_PY_LOG(INFO, context->logging_func) << "'thread_warp_size' is not defined in the target";
}
}
logging_func = context->logging_func;
}

// Entry of the mega rule; Inherited from ScheduleRuleNode
Expand Down
2 changes: 2 additions & 0 deletions src/meta_schedule/schedule_rule/multi_level_tiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ class MultiLevelTilingNode : public ScheduleRuleNode {
int thread_warp_size_;
/*! \brief The maximum number of threads to be used size of a thread warp */
int max_threads_per_block_;
/*! \brief The logging function */
PackedFunc logging_func;
Comment thread
vinx13 marked this conversation as resolved.

void VisitAttrs(tvm::AttrVisitor* v) {
v->Visit("structure", &structure);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,12 @@ Array<Schedule> MultiLevelTilingTensorCoreNode::Apply(const Schedule& sch,
}
Array<Schedule> results;
for (auto&& state : ApplySubRules(initial_states)) {
TVM_PY_LOG(INFO, logging_func) << "Sketch " << results.size() << ": tensorizing with "
<< state.as<TensorCoreStateNode>()->intrin_group.compute_intrin;
results.push_back(std::move(state->sch));
}
if (results.empty()) {
TVM_PY_LOG(INFO, logging_func) << "The workload cannot be tensorized.";
return {original_sch};
}
return results;
Expand Down Expand Up @@ -276,8 +279,8 @@ std::vector<State> MultiLevelTilingTensorCoreNode::AddReadReuseTensorCore(
} else if (dtype.is_int() && dtype.bits() == 8) {
sch->StorageAlign(cache_read, 0, -2, 32, 16);
} else {
LOG(WARNING) << "StorageAlign is not applied for data type " << dtype
<< ", shared memory accesses might be inefficient.";
TVM_PY_LOG(WARNING, logging_func) << "StorageAlign is not applied for data type " << dtype
<< ", shared memory accesses might be inefficient.";
}
}
return {state};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ class MultiLevelTilingWithIntrinNode : public MultiLevelTilingNode {
Array<tir::Schedule> Apply(const tir::Schedule& sch, const tir::BlockRV& block_rv) final {
auto desc_func = tir::TensorIntrin::Get(intrin_name)->desc;
if (!CheckAutoTensorizeApplicable(sch, block_rv, desc_func)) {
TVM_PY_LOG(INFO, logging_func) << "The workload cannot be tensorized.";
return {sch};
}

auto res = MultiLevelTilingNode::Apply(sch->Copy(), block_rv);

if (res.empty()) {
TVM_PY_LOG(INFO, logging_func) << "The workload cannot be tensorized.";
Comment thread
AndrewZhaoLuo marked this conversation as resolved.
return {sch};
}
TVM_PY_LOG(INFO, logging_func) << "Tensorizing with " << intrin_name;
return res;
}

Expand Down