-
Notifications
You must be signed in to change notification settings - Fork 1.3k
stage: Skip run-cache if any out has cache: false. #8738
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
Let's say I'm using experiments, and my training stage outputs both a model that's cached in dvc and metrics that aren't. With the recent name changes, we made it possible to have duplicate experiments, but it didn't seem so bad because duplicate stages would still be cached and skipped. With this PR, I will end up duplicating all the computation of this training stage. It also makes dvc much more reliant on dvc.lock. Before this PR, It's possible to have a workflow where you treat dvc.lock as ephemeral and don't commit or share it. As long as you share the run-cache, it's still easy to recover everything. After this PR, there's no way to recover the outputs from a stage with Should dvc be saving the git hash for objects that have What do you think? Originally posted by @dberenbaum in #8718 (comment) |
Feels like this goes maybe back to some older comments in #4428 to add an option to explicitly control
The whole Still feels that the current |
Codecov ReportBase: 93.59% // Head: 93.64% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #8738 +/- ##
==========================================
+ Coverage 93.59% 93.64% +0.05%
==========================================
Files 456 456
Lines 36119 36111 -8
Branches 5230 5232 +2
==========================================
+ Hits 33804 33816 +12
+ Misses 1816 1799 -17
+ Partials 499 496 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Yup, I agree. The behavior in this PR (which I haven't tested) seems more expected from what's documented. My concerns are because:
We could always do it knowing that we may have to revert until 3.0 if users start to complain. |
@daavoo Let's go ahead with this PR and keep an eye on whether it causes issues for users. |
I was thinking that we could try to cover the scenario where only
Would actually create the run-cache. WDYT @dberenbaum ? |
|
Yes, I like it! Let's go with that approach 🙏 . Edit: one thing to consider is this doesn't help for dvclive experiments or anyone using top-level metrics, plots, etc. (listing them as regular outputs with cache false in the stage but listing them separately in other top-level sections), but I guess we can revisit that issue as a follow-up. |
57d37f7 to
39d938e
Compare
dc5099d to
971717d
Compare
Updated the P.R.
Need to properly discuss but in that specific scenario(top-level metrics/plots listed as outs with |
dberenbaum
left a comment
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!
Edit: one thing to consider is this doesn't help for dvclive experiments or anyone using top-level metrics, plots, etc. (listing them as regular outputs with cache false in the stage but listing them separately in other top-level sections), but I guess we can revisit that issue as a follow-up.
I was thinking they wouldn't be collected during metrics/plots/params/exp commands, but that's not impacted here, so I don't think it's worth worrying about it.
karajan1001
left a comment
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,
| ) | ||
| self.save( | ||
| allow_missing=allow_missing, | ||
| run_cache=not no_commit and not no_cache_outs, |
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.
How about
cache_outs = not (no_commit or any(
not out.use_cache
for out in self.outs
if not (out.is_metric or out.is_plot)
))0e45228 to
547c1eb
Compare
547c1eb to
fc53575
Compare
fc53575 to
e433e2f
Compare
After #8738 , run cache is not saved for a stage if any output has `cache: false`.
After #8738 , run cache is not saved for a stage if any output has `cache: false`.
Closes #4428