Skip to content

DRYML serialization of torch models broken for torch 2.4 #23

@krafczyk

Description

@krafczyk

Something changed in torch 2.4 which creates the following error for torch pipelines when trying to serialize them:

  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/site-packages/dill/_dill.py", line 1985, in save_function
    _save_with_postproc(pickler, (_create_function, (
  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/site-packages/dill/_dill.py", line 1112, in _save_with_postproc
    pickler._batch_setitems(iter(source.items()))
  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/pickle.py", line 998, in _batch_setitems
    save(v)
  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/site-packages/dill/_dill.py", line 414, in save
    StockPickler.save(self, obj, save_persistent_id)
  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/pickle.py", line 589, in save
    self.save_global(obj, rv)
  File "/home/matthew/Projects/DRYML/envs/dryml_1/lib/python3.11/pickle.py", line 1071, in save_global
    raise PicklingError(
_pickle.PicklingError: Can't pickle <built-in function reset_code>: it's not found as torch._C._dynamo.eval_frame.reset_code

With torch 2.3 this isn't a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions