Skip to content
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 / PIR] Cinn trivalop fuse #62088

Merged
merged 308 commits into from
Mar 26, 2024

Conversation

2742195759
Copy link
Contributor

@2742195759 2742195759 commented Feb 26, 2024

PR types

Others

PR changes

Others

Description

Cinn trivalop fuse.
PCard-74042

Copy link

paddle-bot bot commented Feb 26, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@CLAassistant
Copy link

CLAassistant commented Mar 6, 2024

CLA assistant check
All committers have signed the CLA.

tc20042008 and others added 24 commits March 8, 2024 15:37
export less methods in StmtFusionHelper
declare group_pattern.InferShardableAxes
move group_pattern.InferShardableAxes to group_pattern_util.InferShar…
implement group_pattern_util.InferShardableAxes
add group_pattern_util.InferShardableAxesFromSink
Comment on lines +137 to +151
extern ExprSetFinder Identity;

extern ExprSetFinder Store2Value;

extern ExprSetFinder Realizer2ScheduleBlock;

extern ExprSetFinder ScheduleBlock2Body;

extern ExprSetFinder ScheduleBlockRealizeNotRoot;

extern ExprSetFinder ScheduleBlockRealizeIsNotInit;

extern ExprSetFinder ScheduleBlockRealizeIsInit;

extern ExprSetFinder IsFor;
Copy link
Contributor

Choose a reason for hiding this comment

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

这些地方最好弄成函数,不依赖extern。

const ExprSetFinder& GetIdentityExprSetFinder();

在对应的cc文件里弄一个函数内部的static变量来存放数据。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续提一个PR来修复这个问题。

ir::Expr func_body;
};

using FusibleOp = std::variant<ReduceOp, TrivialOp>;
Copy link
Contributor

Choose a reason for hiding this comment

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

这些定义与前端是割裂的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续会处理一下,将表达同构

@phlrain phlrain self-requested a review March 26, 2024 05:47
@Aurelius84 Aurelius84 merged commit fec0b3d into PaddlePaddle:develop Mar 26, 2024
29 of 30 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Mar 26, 2024
* implement FuseFilteredStmtPatterns

* update

* split trivial op into a single file.

* fix compiler complaints

* rename StmtIter to StmtPtr

* declare group_pattern.InferShardableAxes

* refine signature of group_pattern.InferShardableAxes

* move group_pattern.InferShardableAxes to group_pattern_util.InferShardableAxes

* implement group_pattern_util.InferShardableAxes

* add group_pattern_util.InferShardableAxesFromSink

* ReversedInferShardableAxes support sinks

* update op lower

* support multiple sinks in group_pattern_util.InferShardableAxes

* update

* fix link error

* update

* remove FusionOp to OpList

* update

* update

* update

* update

* declare group_pattern_util.h

* fix compiler complains

* declare group_pattern_util.ClusteringHelper

* refine signature of group_pattern_util.ClusterIntoGroupPatternsFromOpList

* update op lowr

* add todo

* minor refine by group_pattern_util.OpSet

* update

* update

* update (PaddlePaddle#57)

* update

* update

* Cinn trivalop fuse (PaddlePaddle#58)

* fix

* refactor StmtFusionHelper by OpTopo

* Complete: CreateReduceExpr function.

* update

* recursive done.

* update

* Cinn trivalop fuse (PaddlePaddle#59)

* clean all the TODO.

* update

* fix cluster

* remove unused OpTopo.downstream_disconnected_ops

* Cinn trivalop fuse (PaddlePaddle#60)

* fix compile rror

* update

* Cinn trivalop fuse (PaddlePaddle#61)

* add R + T skeleon

* add search utils.

* update

* Cinn trivalop fuse (PaddlePaddle#62)

* push

* update

* fix

* fix transformer

* fix

* Implement iterator vars fetching in ReduceOp

* small fix

* add GetOuterIterVars API

* fix

* fix compile complain

* modify GetOutputIters of TrivialOp

* remove dumplicate code in visit

* implement ClusterIntoGroupPatternsFromOpList

* Fix most error in trivial_op.cc.

* CreateReduceExpr is OK!

* fix

* add CheckIterEq

* implement group_pattern_util.ClusteringEngine and groupp_pattern_util.ClusteringPolicy

* SinkTrivialTransform OK!

* update

* fix init_tensor name problem.

* update

* fix compiler complains

* refactor ShardableAxesSignature by group_pattern.SoleOutputShardableAxes

* split trivial_op.cc

* update

* implement group_pattern_util.MakeShardableAxesSignature4ReduceOp

* update

* implement group_pattern_util.MakeEmptyShardableAxesSignature

* add helper class group_pattern_util.ShardableAxesProvider

* implement group_pattern_util.MakeShardableAxesSignature4BroadcastOp

* update

* update

* fix softmax error.!

* fix

* update

* merge

* fix

* Implement new OpMergeWithOp and add a relevant flag

* update

* update

* fix reduce_load error. add splitReduceTransform

* fix conflict

* update

* update

* update

* disable horizontal fusion

* fix

* Add some VLOG

* Fix group cluster bug (PaddlePaddle#71)

* fix

* fix dyshape

* fix

* init split cluster files

* update

* update

* update

* spliting

* update

* spliting

* spliting

* pattern utils

* update

* update

* clean cmake

* update

* update

* update

* fix clustering_engine

* fix fusion_helper

* update

* fix

* update

* update

* update

* update

* fix

* fix some erros

* update

* update

* fix split with num problem

* update

* fix

* fix static issues

* fix

* init split cluster files (PaddlePaddle#72)

* update

* update

* update

* update

* update

* update

* update

* update

* update

* split shardable axes provider (PaddlePaddle#73)

* update

* update

* fix broadcast (PaddlePaddle#75)

* update

* update

* fix

* fix code format

* fix code format

* remove unittest

* update

* update (PaddlePaddle#77)

* update

* update

* update

---------

Co-authored-by: tc20042008 <156998525+tc20042008@users.noreply.github.com>
Co-authored-by: feifei-111 <2364819892@qq.com>
Co-authored-by: jiahy0825 <jiahongyu@baidu.com>
Co-authored-by: zhangbaizhou <zhangbaizhou@baidu.com>
Co-authored-by: Baizhou Zhang <eddiezhang@pku.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants