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

[ENH] Adapter for Uni2TS, MOIRAI #6161

Open
benHeid opened this issue Mar 18, 2024 · 10 comments · May be fixed by #6299
Open

[ENH] Adapter for Uni2TS, MOIRAI #6161

benHeid opened this issue Mar 18, 2024 · 10 comments · May be fixed by #6299
Assignees
Labels
enhancement Adding new functionality interfacing algorithms Interfacing existing algorithms/estimators from third party packages module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting

Comments

@benHeid
Copy link
Contributor

benHeid commented Mar 18, 2024

Salesforce is releasing there time series library for transformers training and forecasting. Thus, it might be worth to interface it.

This is also supporting a download of their time series foundation model MOIRAI.

https://github.com/SalesforceAIResearch/uni2ts

@benHeid benHeid added interfacing algorithms Interfacing existing algorithms/estimators from third party packages module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting enhancement Adding new functionality labels Mar 18, 2024
@fkiraly
Copy link
Collaborator

fkiraly commented Mar 18, 2024

hm, so it's using gluonts data format and huggingface for the model.

I suppose we need to continue the work on the gluonts adapters then? #2860

@benHeid
Copy link
Contributor Author

benHeid commented Mar 19, 2024

Might be helpful or at least this seems to be code that can be shared easily.

@fkiraly fkiraly changed the title [ENH] Adapter for Uni2TS [ENH] Adapter for Uni2TS, MOIRAI Mar 20, 2024
@benHeid benHeid self-assigned this Apr 14, 2024
@benHeid benHeid linked a pull request Apr 14, 2024 that will close this issue
6 tasks
@pranavvp16
Copy link
Contributor

I had a discussion with @benHeid and will start working on this

@pranavvp16
Copy link
Contributor

pranavvp16 commented Jun 26, 2024

I have started working on implementing MOIRAI foundation model in sktime, and will be continuing to work on the moirai_forecaster branch created by @benHeid . But there are some changes in the model repository at hugging face since last commit made in the sktime moirai_forecaster branch.

  1. The License of the model has been changed from Apache to CC BY-NC 4.0
  2. The checkpoint files containing the weights has been changed to standard hugging face format of config.json and model.safetensors .

I'm bit concerned about the license being used here, although I don't have deep understanding of open source licenses. Will this implementation still be useful for sktime users with the CC BY-NC license. Also can we load the new format of weights with the HFTransformer class??

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 26, 2024

Adding conversation from discord:

fkiraly: hm, when has the license changed? CC NC is not a permissive license, as it may not be used for commercial purposes. So, it would be a limitation, and we should clearly signpost it in the license_type field. Academics can still use it. With the license change, did anything else change?

pranavvp16: They changed the license in this commit :https://huggingface.co/Salesforce/moirai-1.0-R-small/commit/10a3e89520d14fbe5769b345190177857966efed, and changes where made to the format of weight files .ckpt - > .safetensors with config.json

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 26, 2024

I'm bit concerned about the license being used here, although I don't have deep understanding of open source licenses. Will this implementation still be useful for sktime users with the CC BY-NC license.

CC NC is not a permissive license, as it may not be used for commercial purposes. So, it would be a limitation, and we should clearly signpost it in a license_type tag or similar. Academics can still use it. With the license change, did anything else change?

In skpro, I've added a license_type tag as some of the interfaced packages are copyleft:
https://github.com/sktime/skpro/blob/7857a7d1f77ea73e8b3e8c227988e16ace1d05d9/skpro/registry/_tags.py#L98

We should probably do the same in sktime, another category could be non-commercial.

I would suggest you open an issue where we discuss tagging licenses, and how we want to notify the user.

One challenge here is the mix of 1st, 2nd, 3rd party estimators in sktime, so users also need to understand how the licenses interact. The interfaces we offer are all subject to permissive BSD-3, but the interfaced packages may be subject to different license. A naive user may be led to think that all estimators - interfaced and interfaces - are subject to the same license, but that's not true. As in any software component system, different components can have different licenses, and the "top level" framework license does not override license of components.

In-principle, users can build complex pipelines where components have any number of licenses, potentially even mutually contradictory ones...

@pranavvp16
Copy link
Contributor

Due to different MOIRAI versions varying in weights and licenses, I had a discussion with @benHeid and will be opening a poll/thread under this issue for users and developers of sktime to decide which version of MOIRAI would be good to implement in sktime. Meanwhile I'll start working on implementing TinyTimeMixer another foundation model from IBM.

@pranavvp16
Copy link
Contributor

MOIRAI has different versions on github as well as hugging face with different format of weights and licenses. So we have two versions of github mapping two versions on hugging face. I have saved the old weights at link, but they require the old version of MOIRAI to load the weights in the model. Also if we go with the fork method for installation we need to fork the moirai folder in the uni2ts repository. I would like to know the thoughts of sktime developers and the community, on how and what version of MOIRAI should be implemented in sktime.

🎉 : Old Moirai version which has the Apache 2.0 license.
🚀 : Latest Moirai version which has the CC by NC 4.0 license.
👀 : Implement both tagging the different licenses used. Note : We'll need to maintain two different forks for installation.

This is a poll like setup, and react with the emoji corresponding to the idea you would like to be implemented. Also any thoughts or ideas to the above issue are appreciated.

@fkiraly
Copy link
Collaborator

fkiraly commented Jul 2, 2024

Question: why would the new version require a fork? I can see why the old version would require a fork, that's directly before license change.

@pranavvp16
Copy link
Contributor

MOIRAI i.e uni2ts isn't on PyPi too, So we have to go with one of the methods mentioned by @benHeid in above comment for installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality interfacing algorithms Interfacing existing algorithms/estimators from third party packages module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting
Development

Successfully merging a pull request may close this issue.

3 participants