-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lshpku add 2024.02.25~2024.03.08 WeeklyReport
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
WeeklyReports/Hackathon_6th/16_lshpku/[WeeklyReports]2024.02.25~2024.03.08.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### 姓名 | ||
|
||
梁书豪 | ||
|
||
### 实习项目 | ||
|
||
CINN 支持动态 Shape 专项(前端方向) | ||
|
||
### 本周工作 | ||
|
||
本周工作为看CINN代码,主要以`reduce`算子为例,理解CINN的工作流程和关键Pass的内容。 | ||
|
||
1. 前端Pass代码理解 | ||
|
||
* 前端的作用是在算子层面对计算图进行优化,例如算子融合、死代码消除;另外针对动态shape,还会进行shape表达式传递 | ||
* `ShapeOptimizationPass`:将动态shape的维度定义为变量,并在算子间进行传递,从而可以通过运行时输入的shape推导后续算子的大小 | ||
* `BuildCinnPass`:具体实现在`SubgraphDetector`,将子图(一组只有一个输出的算子)进行融合 | ||
|
||
2. 后端Tactic代码理解 | ||
|
||
* 后端的作用是将已经融合的算子转换成高效的CUDA实现 | ||
* 后端的流程为:首先将算子lower为多层循环表示,然后对循环进行reorder、fusion、inline、tiling等操作,再将循环绑定到cuda的thread和block上,最后lower得到可编译的cuda代码 | ||
* 后端的一个重要概念为SpatialSpace(sp_space)和ReduceBroadcastSpace(rb_space),sp_space指的是可以并行的维度,例如`reduce`时的非`axis`维,rb_space则是不可并行的维度 | ||
|
||
|
||
### 下周工作 | ||
|
||
1. 检查`Convert0DTo1DPass`所影响的单测用例,总结0D Tensor影响的Pass,思考一种通用的解决0D Tensor问题的思路 | ||
2. 继续看后端代码中`PostProcess`的部分 | ||
|
||
### 导师点评 | ||
请联系导师填写 |