-
Notifications
You must be signed in to change notification settings - Fork 904
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
Integrate darts models with MLflow (logging, autologging, loading) #1618
Comments
@pelekhs, acknowledged. Give us some time to go over this and come back to you. |
I would really appreciate that too. I am currently using MLFlow together with Darts for a project, but have to do it manually |
Hi again. We discussed and think this would be a great idea :) In general we are open to have something like this in place as long as it doesn't disrupt our current API. Some compromises might be fine though if they make sense. From [FR] U8darts Integration I see that you're already in contact with the MLFlow team. We would be happy to offer guidance/supervision as well! As an extension to the feature request description from [FR] U8darts Integration:
|
In my opinion, the main advantage is to get the mlflow.autolog() functionality working
|
Same here, would appreciate this. Getting another error about a My main issue is the loading of the model which I would need to implement manually through a custom mlflow pyfunc (haven't done it because I have a workaround through another model registry). Can offer some assistance if someone wants to take the lead on this, don't think I'll have the capacity to do it by myself though. Looking at the responses from the mlflow guys it would need to be some kind of 3rd-party package I guess. |
@Sonta Thanks for the hint with 32-bit! I'll try it out |
@Sonta when you talk about the artefact logger working, you mean, you "just" instantiated a Lightning based MLFlowLogger, and that was it? Or did you have to do anything special? Any help is much appreciated! |
We need mlflow for Darts and time series in general so badly. |
Yes, this is essential to enable PS: For reference, |
In the meanwhile, could some please provide an example converting a |
Hi, can you give me an example of this? I need it so badly, primarily when registering the model. Many thanks for considering my request. |
@kusumy i used it only for logging parameters, metrics and artifacts (manually with e.g.
|
Hi there we are looking to set up a solution using mlflow and darts. Does anyone here have any tips or sample projects. Or a general structure we could follow. We would also be very interested in this intergration and would be willing to help make it happen and/or test it. |
Hi,
This is an example file of an initial "darts" flavor for MLflow created
within our project DeepTSF. This is used for inference and could be a
starting point for creating an official Darts flavor in MLflow.
Best regards,
Sotiris
Στις Κυρ 8 Οκτ 2023 στις 4:35 μ.μ., ο/η David Sooter <
***@***.***> έγραψε:
… Hi there we are looking to set up a solution using mlflow and darts. Does
anyone here have any tips or sample projects. Or a general structure we
could follow.
We would also be very interested in this intergration and would be willing
to help make it happen and/or test it.
—
Reply to this email directly, view it on GitHub
<#1618 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKXVR2Z43SOPIJTI3S5G7Z3X6KT2FAVCNFSM6AAAAAAVQCAIVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGAZTAMZXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
As mlflow is not integrated in Darts, the convenient autolog will not work, so logging has to be done manually (with So a simplified structure would be: # 0. setup
import mlflow
import os
os.environ["MLFLOW_TRACKING_USERNAME"] = "<user>"
os.environ["MLFLOW_TRACKING_PASSWORD"] = "<pw>"
mlflow.set_tracking_uri("") # local, else set url here
mlflow.set_experiment("My_Experiment")
# 1. start run
RUN_NAME = "MyRun"
mlflow.start_run(run_name=RUN_NAME)
# 2. fit&evaluate your model
....
# 3. log your stuff
mlflow.log_param("epochs", 15)
mlflow.log_metric("accuracy", 0.99)
mlflow.log_artifact("mymodel.pickle") # if saved e.g. with model.save("mymodel.pickle")
...
# 4. end
mlflow.end_run() Does this help or where do you need help in particular? |
Thanks a lot for the answer. Still getting going with both. I was also looking into storing the model with mlflow. While i wont be using mlflow to serve the model, i like their way of storing it. I still haven’t looked at storing and retrieving a darts model with mlflow. But since they both use picke i cant Imagine it would be an issue. |
@pelekhs do you have an example of reading and writing models to mlflow? we are currently trying to set up tracking in mlflow but would like to continue to use Darts. We want to use external storage to store the artifacts (s3/azure blob) and these are the general steps im thinking but if you have an example it would be very helpful. Training step:
Prediction step:
if you have any sample code it would be awesome. |
Hi, is there any update on this integration? Thank you very much! |
Hello everyone, I have a solution to the MLflow integration via additional code on your notebook/ .py file making pytorch calls and activating tensorboard collection on Darts' s pytortch models. Could anyone from the team reach me out to let me know where I can add an MLflow notebook example that solves this issue? I have examples with NBEATS, TCN, NHiTS, DLinear, and NLinear doing autologging with MLflow code added. Please reach out. |
Hi @cargecla1, If you think that there is enough content to make a whole notebook, you can create a new one in the If the code is rather generic and similar across the models, it would probably be better to just add a section in the example user guide (source is in It would be great if you could open a draft PR as soon as possible so that we can start collecting feedback on the integration with MLflow :) |
I will create a draft PR over the weekend, thank you for your feedback! |
Hello, I added Preview PR here: cargecla1:feature/MLflow_1618. Let me know what you think. |
Hi @cargecla1, and thanks for adding the example. I created Draft PR #2092 for this. |
Hello @dennisbader, excellent, thank you. Glad to be able to support. |
Hi there, I looked into #2092 but I don't understand how the DARTS model can be loaded from MLflow once logged as a pytorch model, am I missing on something obvious here? Thanks for the help! |
Hello @dnerini Please refer to this link to see how to load the model after you register it: https://mlflow.org/docs/latest/model-registry.html This page shows you how to use the MLflow UI to manage your registered models, there are two ways to log a model: using the mlflow.<model_flavor>.log_model() method or using the mlflow.register_model() method, above link explains this. Please pay special attention to the subtitle: and Serving an MLflow Model from Model Registry Hope this helps! Cheers |
I don't think that solve the issue of @dnerini. Because in the current state of #2092 (13d8113) there is no call to |
Is your feature request related to a current problem? Please describe.
Missing API to log / load / autolog ML models to MLflow.
Describe proposed solution
Provide an API that integrates darts models with MLflow models and provides model logging and loading capabilities. (check this as an example for pytorch)
Describe potential alternatives
Pyfunc models and model flavors can be used right now but this quite a time consuming process to handle darts models with MLflow.
Additional context
Would it be maybe good to handle darts models as pytorch lightning models during this process? And maybe build up on the prexisting pytorch integration of MLflow?
The text was updated successfully, but these errors were encountered: