-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CINN] Implement the new AlignIterSpaceTactic #70649
base: develop
Are you sure you want to change the base?
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
8eabf66
to
c4b9f78
Compare
tactics_.emplace_back(CreateAlignIterSpaceTactic()); | ||
tactics_.emplace_back(CreateTileBroadcastTactic()); | ||
tactics_.emplace_back(CreateTileFirstGeneralTactic()); | ||
tactics_.emplace_back(CreateComputeInlineTactic()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tactic的数量越来越多了,这里可能需要制定一些相对明确的原则和规范,避免tactic之间功能划分不清晰导致的处理问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tactic应该差不多了,就是分成3部分:
- 第一部分是align,把loop顺序调整到和内存顺序一致,因为我们融合不太注意内存顺序,需要后端自己调整顺序
- 第二部分是tiling,就是维度切分和绑定,这个部分只会match一个tactic,估计未来一段时间内只需要3个(Broadcast、Transpose、General)
- 第三部分是compute inline和compute at,属于计算位置和计算顺序的优化
其实tactic的数量多一点也无妨,tvm也有10个左右的tactic
std::vector<int> sp_loop_perm; | ||
std::vector<int> rd_loop_perm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class成员变量名加下划线后缀
这两个变量的含义有点抽象,可以再加些示例说明吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改,已在前面写了两个example
c4b9f78
to
14e960e
Compare
PR Category
CINN
PR Types
Improvements
Description
把TileFirstGeneralTactic中的AlignToReduceInput功能提取成为一个独立的Tactic,借用了原来AlignIterSpaceTactic的壳子,目的是把TileFirstGeneralTactic里面与Tile无关的内容分离出来,为之后实现Transpose调度做准备。
另外,这个PR中的GetCommonOutputLoopPerm也可以解决近期Recompute导致的一些Transpose性能回退的情况,在当前还没有能力调度Transpose的情况下,将Transpose向输出对齐至少比不对齐好。
Pcard-85711