CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[ CINN / Fusion] CINN Fusion Frontent Algorithm #63124
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 / Fusion] CINN Fusion Frontent Algorithm #63124
Conversation
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.
LGTM overall
} | ||
return result; | ||
}; | ||
VLOG(4) << "GetDimInfo"; |
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.
整体看这里的VLOG都比较短,且有一些是冗余的,建议后续可以优化下:
- 细节的VLOG level 建议开启到5或6
- 骨架逻辑的VLOG level 建议开启到4或5
- VLOG的内容准则:提供调试的必要信息
if (op->isa<cinn::dialect::ReshapeOp>()) { | ||
return CreateDefaultSignature(op); | ||
} | ||
if (op->name() == "cinn_op.generate_shape") { |
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.
这里的if-else既有isa 又有string == ,建议统一为isa更好一些?
@@ -174,7 +174,7 @@ def train(self, net, to_static, with_prim=False, with_cinn=False): | |||
def test_ast_prim_cinn(self): | |||
st_out = self.train(self.net, to_static=True) | |||
cinn_out = self.train( | |||
self.net, to_static=True, with_prim=True, with_cinn=True | |||
self.net, to_static=True, with_prim=True, with_cinn=False |
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.
这里黑名单了部分单测,注意要在100子图表格里更新状态并NOTE
@@ -679,7 +679,7 @@ def test_eval(self): | |||
if utils.unittest_use_cinn(): | |||
cinn_out = self.eval(use_cinn=True) | |||
np.testing.assert_allclose( | |||
cinn_out.numpy(), dy_out.numpy(), atol=1e-6, rtol=1e-6 | |||
cinn_out.numpy(), dy_out.numpy(), atol=1e-5, rtol=1e-6 |
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.
这里对于llama的单测精度问题的调整,也要周知相关同学看是否符合预期
const std::vector<U>& values) { | ||
std::unordered_map<T, U> result = std::unordered_map<T, U>(); | ||
|
||
CHECK(keys.size() == values.size()); |
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.
已禁止使用CHECK宏,后续要单独PR替换为PADDLE_ENFORCE_XX
: ops_(ops) {} | ||
std::vector<const pir::Operation*> ops_; | ||
std::vector<pir::Operation*> ops_; |
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.
这个pattern和其他pattern都没关系吗?它内部没有引用到别人,也没有被别人引用。
* update * Cinn trivalop fuse (PaddlePaddle#62) * push * update * fix * fix transformer * fix * Implement iterator vars fetching in ReduceOp * small fix * add GetOuterIterVars API * fix compile complain * modify GetOutputIters of TrivialOp * remove dumplicate code in visit * implement ClusterIntoGroupPatternsFromOpList --------- Co-authored-by: feifei-111 <2364819892@qq.com> Co-authored-by: zhangbaizhou <zhangbaizhou@baidu.com> Co-authored-by: jiahy0825 <jiahongyu@baidu.com> Co-authored-by: tc20042008 <156998525+tc20042008@users.noreply.github.com> Co-authored-by: Baizhou Zhang <eddiezhang@pku.edu.cn>
PR Category
CINN
PR Types
New features
Description
CINN Fusion Frontent Algorithm
PCard-74042