-
Notifications
You must be signed in to change notification settings - Fork 38
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
integrations: CML #91
Comments
This seems like a general need for integration between cml and dvc checkpoints. Do you see any functionality as being specific to dvclive? |
Given the discussion so far in iterative/dvc#6182, it looks like the I probably didn't express it right but I was also taking about an additional integration, which will be something like using From an user perspective what I would want is, by using This is a feature (sending the metrics to somewhere) that I have been repeatedly implementing through workarounds when using other ML Loggers and I though that ot could be nice to have it working out of the box with The feature probably doesn't make too much sense in the context of training a lot of short experiments and it's probably not a deal breaker for attracting new users. |
Yes, this could be really useful, and absolutely dvclive should address issues for long-running experiments! iterative/dvc#6182 will at least make it possible to pull the latest checkpoint and see the associated metrics and plots, but we could make the experience smoother and better integrate cml. Seems like this has 2 requirements:
|
@iterative/cml I know that you have been discussing (and even prototyping) something like this? Could you share your thoughts, outcomes? |
@dberenbaum I think we could even start with pretty printing metrics to some env var that CML could pick up and show in the build log. |
I'd say generic callback support (#90) would be best. The user can use that to run Vaguely related (though this is automatic rather than manual): auto-push per checkpoint iterative/dvc#6182 |
That would be awesome. I think that the best integration would be if dvclive would work as tensorboard. Something that you can launch and give you a url in return. We wrapped that under cml-tensorboard-dev.
I implemented something like that in |
That sounds cool, @DavidGOrtega! Definitely cleaner than a separate report for each checkpoint. In this case, can dvclive republish to the same url at each step without needing a daemon? |
Yes, it could. Something that actually @pared also liked when I shared the idea in general and gave the same feedback. |
I'm currently working on what I consider the minimum viable integration between DVCLive and CML
The current prototype doesn't depend on DVC (or DVC checkpoints) but still works with both. It is focused on using
It currently uses It only works for posting multiple comments (1 per step) because of iterative/cml#888 @iterative/cml I would like to hear some thoughts about the downsides of raw |
@daavoo I can't follow up the links. I did a wrapper for python called CMLpy. Basically it exposes all the CML commands. |
Updated the permissions |
@daavoo Could you give me permission, too 🙏 ? |
Done |
Looks great! Should |
@dberenbaum @daavoo I have invited you to pycml we should invite everyone |
What about this? Can dvclive have some built-in CML callback but also allow users to add their own? |
I'd say the important requirements from the dvclive user perspective here are:
Base on your earlier comments about how to integrate, I'm wondering if it would be possible to reverse this integration? Could cml host this report, watch for changes to it, and update the comment accordingly? |
There are some quirks @dberenbaum the biggest issue is the GH image cache. While redoing the log in every epoch using |
It makes sense to me to offer flexibility to the users but only with the limited scope of sharing the report at the end of each step. Given that DVCLive integrations are already a callback in the ML Frameworks, it feels over-complicated to support custom callbacks inside |
Good point. The problem here and in other issues like #90 and #204 is that users can already add similar callbacks directly in their model training code, so integrations/callbacks only add value if we are using the info specifically captured by DVCLive. |
I mentioned this to @0x2b3bfa0, but I wanted to post it in the issue to get more feedback. Happy to open an issue in CML, but wanted to discuss here first.
|
Sounds useful. In fact, this is probably the only use case for
The devil is in the [implementation] details. Synchronizing API request latency and rate limits sounds risky. See for instance the file–based API used by |
I think you mean a new feature request like
would technically need a subprocess file-watcher that also checked if the file was mid-way through being updated. Implementation is a bit advanced, but it's definitely great for end-user UX (single CLI flag, no API code). |
I think he doesn't quite mean that. GitHub caches images; updating them implies replacing the link by a different one. |
Sounds interesting, but would require users to run something in the background 🤔 |
Yeah, I don't think it's necessary to update in place. Forgetting about updates/watchers, I meant for
It's about converting a locally useful markdown report into one ready to be published via If Again, happy to open an issue in CML for ideas that don't sound too crazy. |
Ah. That's yet another use case. Trying to keep track of ideas:
or is there something else? |
I see it all as one use case: publish per-epoch reports (see #90). The typical DVCLive report includes metrics and plots, and it would be great to publish the entire report as a CML comment. To achieve CML integration, DVCLive can either call CML directly, or it can generate a markdown report that can be useful anywhere (locally, in CML, and possibly for publishing elsewhere). If DVCLive goes with the option to just generate markdown, we need some way to convert from local markdown file to something that can be published in CML. I also see it as potentially useful for CML generally. Instead of:
You can do:
This makes workflows less dependent on CML-specific commands, and it enables users to do things like have Python scripts that generate complex markdown and then publish them as comments with one command. |
See also iterative/cml#1026 |
Better yet, see iterative/cml#1036 :) |
Just to confirm after discussions:
are not needed for this integration. Instead, the proposal iterative/cml#1036 is
## current
while true; do
if [[ -f report.md ]]; then
for img in $(extract_images --file=report.md); do
sed -i s/$img/$(cml publish $img)/ report.md
done
cml send-comment --update report.md
fi
sleep 5
done &
python train.py --per-epoch-report=report.md
## proposed
cml report watch --publish report.md &
python train.py --per-step-dvclive-output=report.md
## dvc way, no code modification, only dvc exp params
cml report watch --publish report.md &
dvc exp run -S dvclive_output=report.md @daavoo can you add this option (markdown instead of html) to DVCLive? |
Will do. Have to work on some pre-requisites iterative/dvc-render#62 |
From a high level user perspective, I think it would be interesting to have some kind of integration between
dvclive
andCML
.Just like there is already a custom
dvclive
behavior when used along withDVC
(i.e. generatingcheckpoints
) maybe a similar approach could be used whendvclive
is also used along withCML
.I was thinking on a use case like
dvclive
taking care of usingcml-send-comment
insidenext_step
ifCML
is detected.Conceptually i think that it would be something similar to the existing
make_checkpoint
:https://github.com/iterative/dvclive/blob/master/dvclive/metrics.py#L105
This might be just an specific use case of #90
The text was updated successfully, but these errors were encountered: