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] Add data dependency graph #70485

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

Dmovic
Copy link
Contributor

@Dmovic Dmovic commented Dec 26, 2024

PR Category

CINN

PR Types

Improvements

Description

[CINN] Add data dependency graph

DataDependencyGraph is a graph data structure where graph nodes are stmts in a block, and edges are data dependences between the nodes.

Use function HasDependency(src, dst) to check dependency between stmts. src and dst, are expected to be from the same block.

  • DEP means there is a path in the data dependency graph from node src to node dst
  • NO_DEP otherwise

Didn't consider Alloc and Free IR

// stmts: std::vector<ir::stmt::StmtRef>
const auto &dep_graph = DataDependencyGraph(stmts);
DepKind res = dep_graph.HasDependency(stmt1, stmt2);
// enum DepKind {DEP, NO_DEP}

Pcard-67164

Copy link

paddle-bot bot commented Dec 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.

Hongqing-work
Hongqing-work previously approved these changes Jan 2, 2025
zyfncg
zyfncg previously approved these changes Jan 2, 2025
@Dmovic Dmovic marked this pull request as ready for review January 2, 2025 13:20
@Dmovic Dmovic dismissed stale reviews from zyfncg and Hongqing-work via 359ccca January 2, 2025 13:22
@Hongqing-work Hongqing-work merged commit 621fb15 into PaddlePaddle:develop Jan 3, 2025
32 checks passed
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.

4 participants