zxybazh commented on code in PR #12127:
URL: https://github.com/apache/tvm/pull/12127#discussion_r936034797
##########
src/meta_schedule/schedule_rule/winograd.cc:
##########
@@ -74,6 +80,32 @@ inline LoopRV ScheduleDataPack(Schedule sch, BlockRV block) {
return t1[1];
}
+inline LoopRV ScheduleDataPackNCHW(Schedule sch, BlockRV block) {
+ Array<LoopRV> loops = sch->GetLoops(block);
+ ICHECK_EQ(loops.size(), 6);
+
+ if (const int64_t* i = tir::GetLoopIntExtent(sch->GetSRef(loops[0]))) {
+ if (*i <= 16) {
+ sch->Unroll(loops[0]);
+ }
+ }
+ if (const int64_t* i = tir::GetLoopIntExtent(sch->GetSRef(loops[1]))) {
+ if (*i <= 16) {
+ sch->Unroll(loops[1]);
+ }
+ }
+ sch->Unroll(loops[4]);
+ sch->Unroll(loops[5]);
+
+ Array<ExprRV> factors = sch->SamplePerfectTile(loops[3], /*n=*/2,
/*max_innermost_factor=*/64);
+ Array<LoopRV> split =
+ sch->Split(loops[3], /*factors=*/{factors[0], factors[1]},
/*preserve_unit_loops=*/true);
Review Comment:
Hi, it seems `factors` are type of `Array<PrimExpr>` while the argument here
requires `factors` to be `Array<Optional<PrimExpr>>` so IIUC we may keep it
this way.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]