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

@fast attribute to enable early (0-cycle) transitions between alternating dynamic/static groups #2118

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

ethanuppal
Copy link
Member

Will eventually close #1828 once finalized and thoroughly tested (the former of which may take a while).

@ethanuppal ethanuppal self-assigned this Jun 7, 2024
@ethanuppal ethanuppal requested review from calebmkim and sampsyo June 7, 2024 04:27
@ethanuppal
Copy link
Member Author

I want to confirm the following: @fast in its most primitive state consists of applying the unstable early-transitions feature (which schedules 0-cycle transitions between groups g1 and g2 without regard to whether g1[done] && g2[done] is UNSAT) in an environment where we know it it is always possible (enforced via a check the well-formed pass).

@ethanuppal ethanuppal added S: In progress Issue is being worked on C: Calyx Extension or change to the Calyx IL labels Jun 7, 2024
@ethanuppal ethanuppal marked this pull request as ready for review June 11, 2024 03:04
runt.toml Outdated Show resolved Hide resolved
@ethanuppal ethanuppal requested a review from rachitnigam June 19, 2024 23:07
@ethanuppal ethanuppal requested a review from calebmkim June 29, 2024 20:24
@ethanuppal
Copy link
Member Author

@rachitnigam @calebmkim update ping

@calebmkim
Copy link
Contributor

calebmkim commented Jul 9, 2024

I think this all lgtm! (As long as the problems in #662 do not apply, which I think they don't, but I haven't read the issue carefully.)

@ethanuppal ethanuppal added C: calyx-opt Optimization or analysis pass rust and removed S: In progress Issue is being worked on labels Jul 17, 2024
@rachitnigam rachitnigam removed the rust label Jul 22, 2024
@ethanuppal
Copy link
Member Author

@rachitnigam update ping

@@ -828,6 +834,7 @@ impl Schedule<'_, '_> {
&if_stmt.tbranch,
tru_transitions,
early_transitions,
false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this unconditionally pass false instead of threading through early_transitions? Is it because we want to enable this if we see it in a seq or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

We only want to enable @fast on the parent control, I believe, unless you had different semantics in mind?

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that makes sense! We should eventually get rid of the other early-transition logic entirely in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, there may be more cases in which we can apply early-transition, for example, if (as @sampsyo said) one could prove that two adjacent groups cannot be done at the same time; here, we could reuse @fast's functionality, but there might be another case where it does apply recursively. That can be dealt with later though, it's not too hard to just re-add a parameter to all the functions.

Copy link
Contributor

@rachitnigam rachitnigam left a comment

Choose a reason for hiding this comment

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

Mostly looks good! One question about the implementation and one seemingly erroneously committed file. If the file is meant to be committed, then let's document what it is meant to be doing.

@rachitnigam
Copy link
Contributor

@ethanuppal can you finalize the changes and answer the questions so we can merge this PR?

@ethanuppal
Copy link
Member Author

Sorry for not getting around to this sooner!jk:wq

Copy link
Contributor

@rachitnigam rachitnigam left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for implementing this! LGTM!

@ethanuppal ethanuppal merged commit 82da397 into main Aug 7, 2024
18 checks passed
@ethanuppal ethanuppal deleted the fast-1828 branch August 7, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Calyx Extension or change to the Calyx IL C: calyx-opt Optimization or analysis pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero-cycle transitions from dynamic to static control
3 participants