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

Work Depth Analysis for SDFGs #1327

Merged
merged 17 commits into from
Aug 16, 2023
Merged

Work Depth Analysis for SDFGs #1327

merged 17 commits into from
Aug 16, 2023

Conversation

hodelcl
Copy link
Contributor

@hodelcl hodelcl commented Jul 21, 2023

This PR adds work depth analysis of SDFGs. It includes three files:

  • work_depth.py: The analysis itself.
  • helpers.py: Helper functions used by the analysis.
  • work_depth_tests.py: Some small test SDFGs for the analysis.

This PR is one of three PRs. They include:

  • PR to dace repo (this one): The work depth analysis itself.
  • PR to dace-webclient: Depth and Average Parallelism overlays.
  • PR to dace-vscode: Adds functionality to the VS code extension in order to call the analysis and visualize it.

tests/sdfg/work_depth_tests.py Show resolved Hide resolved
dace/sdfg/propagation.py Outdated Show resolved Hide resolved
dace/sdfg/work_depth_analysis/work_depth.py Outdated Show resolved Hide resolved
if state in full_merge_states:
state.dynamic_executions = False
# TODO: do we need this else here or not?
# else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes there are some situations where this may be needed. Consider an if-else state machine which merges back into some common state mergestate, but where one of the branches may terminate the program based on some additional condition. In this case mergestate is not a full merge state, since there are program paths that may not reach it. In that case, the number of executions is dynamic, i.e. in [0:state.executions].


def count_depth_reduce(node, symbols, state):
# depth of reduction is log2 of the work
# TODO: Can we actually assume this? Or is it equal to the work?
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed :-)



def tasklet_depth(tasklet_node, state):
# TODO: how to get depth of CPP tasklets?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will be tricky, but for now I think it's fair to reduce analysis capabilites for those tasklets. We do this in general currently.

@hodelcl hodelcl requested a review from phschaad July 22, 2023 09:28
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.

Now that tests pass and everything has been addressed, LGTM - thanks!

@phschaad phschaad merged commit 22718af into spcl:master Aug 16, 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