-
Notifications
You must be signed in to change notification settings - Fork 138
Remove the flag on SDFGs indicating the use of nested control flow regions #2050
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
base: main
Are you sure you want to change the base?
Conversation
cc @phschaad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I have questions though.
from dace.transformation.passes.analysis import StatePropagation | ||
|
||
state_prop_pipeline = Pipeline([StatePropagation()]) | ||
state_prop_pipeline.apply_pass(sdfg, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code has a return statement, so anything after this should not be executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. The original code had a return statement after the StatePropagation pass, so the code after it was unreachable. I've fixed this by removing all the unreachable legacy propagation code after the return statement. The function now correctly uses only the StatePropagation pass. Fixed in commit 9e943e0.
else: | ||
warnings.warn('Skipping ' + function_name + ' from ' + cls.__name__ + | ||
' due to incompatibility with experimental control flow blocks') | ||
return vanilla_method(tgt, *args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this change do? It seems risky, please explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! The original logic was to skip transformations incompatible with control flow blocks when using explicit control flow. Since we're now always using explicit control flow, these "single_level_sdfg_only" transformations should always be skipped (not always executed as I had initially changed). I've fixed this to always show the warning and skip execution, which is the correct behavior for the new control flow system. Fixed in commit 2f4a1a1.
…on behavior Co-authored-by: tbennun <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I've given this some more thought. This change needs to happen slightly later, after a few other adaptations. Specifically, one of the things that must happen before, is the adaptation of work-depth analysis to CFRs. There are a few tests currently that will absolutely fail if we're just removing this at this point.
This PR removes the
using_explicit_control_flow
flag from the SDFG class and all associated code, as control flow regions are now the norm in DaCe 2.0.Changes Made
Core SDFG Class
using_explicit_control_flow
property from SDFG classrecheck_using_explicit_control_flow()
methodCode Generation
structured_control_flow_tree()
to always use explicit control flow pathTransformation System
Frontend Parsers
State Propagation
propagate_states()
to always use explicit control flow analysisTests
using_explicit_control_flow = True
assignments from test filesImpact
This change simplifies the DaCe codebase by:
All transformations now require explicit control flow compatibility, encouraging developers to update their transformations to work with the modern control flow system.
Verification
Fixes #2049.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.