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

Refine colreduction fusion strategy of kStitch. #1257

Merged
merged 6 commits into from
Oct 9, 2023

Conversation

yunzhongOvO
Copy link
Collaborator

This PR will add more strict fusion rule for fusionType kColReduction : guarantee that the OPs to be fused are both Rank2ColReduction and have same shapes.

qiuxiafei
qiuxiafei previously approved these changes Sep 21, 2023
Copy link
Collaborator

@qiuxiafei qiuxiafei left a comment

Choose a reason for hiding this comment

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

LGTM~ pls clear the tests and merge.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why remove the pytorch pre version CI task?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The version of PyTorch of pre CI tasks is outdated and the task will fail, and the available versions are always changing.

@@ -1478,13 +1478,27 @@ bool BaseGpuFusionStrategy::tryFuse(ShapeAnalysis& shapeAnalysis,
bool has_row_reduction = llvm::any_of(target.getOpList(), [](Operation* op) {
return isRank2RowReduction(op);
});
bool has_col_reduciton = llvm::any_of(target.getOpList(), [](Operation* op) {
bool has_col_reduction = llvm::any_of(target.getOpList(), [](Operation* op) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe has_rank2_col_reduction is more exactly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

return false;
}

if (has_col_reduction) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

a mirror concern, does disc-fusion pass fused col-reduction ops with different shapes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A shape constraint is also set in initFusionPattern later, here I will delete the same shape constraint.

Copy link
Collaborator

@Yancey1989 Yancey1989 left a comment

Choose a reason for hiding this comment

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

LGTM!

@yunzhongOvO yunzhongOvO merged commit c46084d into alibaba:main Oct 9, 2023
11 checks passed
@yunzhongOvO yunzhongOvO deleted the colreduct_core_dump branch October 9, 2023 06:47
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.

3 participants