Skip to content

Fix SaveNNMixin to work on torch-1.13 and torch-2.0 #1271

Open
Mr-Geekman opened this issue May 25, 2023 · 0 comments
Open

Fix SaveNNMixin to work on torch-1.13 and torch-2.0 #1271

Mr-Geekman opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request priority/high High priority task

Comments

@Mr-Geekman
Copy link
Contributor

🚀 Feature Request

It seems like the only thing that stops us from updating torch is saving on disk. We should fix this by changing SaveNNMixin.

Using cloudpickle fixes the issue only for torch-1.13, but it doesn't work on torch-2.0.

Proposal

The goal is to fix SaveNNMixin to work with new torch versions.

We should try to use state_dict for saving, not saving the whole object with pickle/dill/cloudpickle. Probably, it will be useful to separate state of the object into torch nn and other components. Class etna.pipeline.mixins.SaveModelPipelineMixin can be useful as a reference of how it can be done.

After doing the task the requirement on torch should be weakened to include 1.13 and 2.0 versions.

Test cases

  • Fix existing tests
  • Check manually that on torch-1.13 and torch-2.0 tests.test_models.nn are working

Additional context

No response

@Mr-Geekman Mr-Geekman added the enhancement New feature or request label May 25, 2023
@github-project-automation github-project-automation bot moved this to Specification in etna board May 25, 2023
@Mr-Geekman Mr-Geekman moved this from Specification to Todo in etna board May 29, 2023
@Mr-Geekman Mr-Geekman added priority/medium Medium priority task priority/high High priority task and removed priority/medium Medium priority task labels Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request priority/high High priority task
Projects
Status: Todo
Development

No branches or pull requests

1 participant