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

Improvements to work depth analysis #1363

Merged
merged 30 commits into from
Sep 25, 2023
Merged

Improvements to work depth analysis #1363

merged 30 commits into from
Sep 25, 2023

Conversation

hodelcl
Copy link
Contributor

@hodelcl hodelcl commented Sep 4, 2023

This PR adds various improvements to the work depth analysis for SDFGs. These improvements include:

  • Performance improvements: Analysis now runs in minutes compared to hours (or days?) on big SDFGs. Biggest performance gain comes from optimising the Max expressions which occur from branches. Instead of Max(x + a, x + b), we now formulate it as x + Max(a, b). If x also contains a max expression, the performance gains are even bigger, since this generally allows for more Max expressions to be evaluated symbolically.
  • Assumptions: It is now possible for the user to pass assumptions for the size of the symbols to the analysis. For example one can assume that N>5 and hence the analysis evaluates Max(N, 5) to N. Sympy does not support such assumptions out of the box, hence this PR includes assumptions.py, which handles all kinds of equal / greater / lesser assumptions. The user can enter the assumptions directly into the VS code extension as implemented by this other PR.
  • wcr edges: Priorly, wcr edges were ignored by the analysis, which meant that reductions had work and depth of 0. Now, wcr edges are included in the analysis and a wcr edge with N writes to the same memory location adds N to the depth (and work respectively).
  • Some more minor improvements.

Copy link
Collaborator

@phschaad phschaad left a comment

Choose a reason for hiding this comment

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

Looks very good overall, small comments and questions only.

tests/sdfg/work_depth_tests.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Outdated Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Outdated Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Show resolved Hide resolved
dace/sdfg/work_depth_analysis/assumptions.py Outdated Show resolved Hide resolved
@hodelcl
Copy link
Contributor Author

hodelcl commented Sep 18, 2023

Accidentally pushed different work to this branch, sorry! Reverted it again.

@hodelcl
Copy link
Contributor Author

hodelcl commented Sep 21, 2023

I implemented your proposed changes.

Copy link
Collaborator

@phschaad phschaad left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for addressing the comments!

@phschaad phschaad enabled auto-merge (squash) September 25, 2023 14:05
@phschaad phschaad merged commit d0eb400 into spcl:master Sep 25, 2023
9 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.

2 participants