Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

[IrSchedule] SamplePerfectTile #1142

Merged
merged 3 commits into from Jan 17, 2023

Conversation

AndPuQing
Copy link
Contributor

该 Pr 新增了 SamplePerfectTile 调度原语,其功能为对需要分裂的循环随机采样循环次数

参数

  • loop 要进行分裂的Loop
  • n 要分裂的循环层数
  • max_innermost_factor 最内层循环的次数限制

返回

  • std::vector<Expr> 采样到的tile size, 其 index 越大,代表的循环越靠内部,如
对于循环

for (i, 0, 1024) {
  ...
}

auto result = ir_schedule.SamplePerfectTile(for_node, 2, 64)
// result: [16, 64]

则对应的循环为

for (i, 0, 16) {
 for (j, 0, 64) {
  ...
 }
}

而为了保持该调度可 trace ,临时使用了一个 random seed 控制器,用于控制随机种子,希望建议更好方案

cinn/ir/ir_schedule.h Outdated Show resolved Hide resolved
cinn/ir/ir_schedule.h Show resolved Hide resolved
cinn/ir/ir_schedule_util.h Show resolved Hide resolved
cinn/ir/ir_schedule_util.cc Outdated Show resolved Hide resolved
AndPuQing and others added 2 commits January 16, 2023 18:50
Co-authored-by: TeFeng Chen <ctfeng66@163.com>
Copy link
Collaborator

@CtfGo CtfGo left a comment

Choose a reason for hiding this comment

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

LGTM

@CtfGo CtfGo merged commit f3dfd27 into PaddlePaddle:develop Jan 17, 2023
@AndPuQing AndPuQing deleted the patch-SamplePerfectTile branch January 17, 2023 03:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants