-
Notifications
You must be signed in to change notification settings - Fork 448
Update flow dependencies #588
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
Conversation
- Make writer flows depend on the ip flows - Add reapply policy to teh ModelGraph.apply_flows() - Move the stamp to the optimizer
length = 8 | ||
return ''.join(choice(hexdigits) for m in range(length)) | ||
|
||
model.config.config['Stamp'] = _make_stamp() |
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.
I know this isn't the point of this PR, but would it be safer to make the stamp a (hidden?) attribute of the model rather than a config entry?
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.
Yes! I was thinking that since layers have attributes, so should the model. Then all the config stuff that must be refactored can be implemented this way. But it's for the next PR.
Perhaps some tests with dummy models and dummy flows, with asserts on the |
I can add the test, but it would be pretty naive. It will test only the |
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.
Added a simple pytest doing dummy flows on a dummy project and checking that the order of applied passes matches expectation. Everything looks good, merging!
* Shuffle the flows a bit - Make writer flows depend on the ip flows - Add reapply policy to teh ModelGraph.apply_flows() - Move the stamp to the optimizer * Remove the printout * Add a test for flows Co-authored-by: Sioni Summers <[email protected]>
Description
This PR shuffles the order of flows a bit to help resolve the issues observed in #509 and elsewhere. Essentially it makes writer flows depend on the ip flows and expands functionality of
apply_flows()
to control how the flows are reapplied if they were already applied before. Another effect of the change is that the flows aren't applied multiple times, an issue that many people have observed.Type of change
Tests
No extra tests are needed. To reproduce the old behavior, just convert any model and call
compile()
andbuild()
and see how many times the same optimizers will be applied (inmodel._applied_flows
).Checklist