Jitted function cannot be pickled #61210
Comments
Thanks for reporting this issue. I think your suggestion makes sense. Given that complexity of this task is not high, I will leave it as a task for OSS contribution. Here are some pointers: |
Hi @gmagogsfm ! I'm more than happy to help with this task. |
Awesome! Please see my previous comment for pointers on implementing this improvement. Feel free to ask here if you see any unexpected issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support to pickle a jitted function (or at least throw a
TypeError
when using protocol 0 and 1).Motivation
Trying to pickle a jitted function either raises
TypeError: cannot pickle 'torch._C.ScriptFunction' object
whenprotocol>1
or far worse when usingprotocol=0
orprotocol=1
python 3.9.5 dies with:Example:
Pitch
Implement pickle support for all pickle protocols (or raise a
TypeError
when used withprotocl<2
).Additional context
I encountered this when using a jitted function with dask dask/dask#7861
The text was updated successfully, but these errors were encountered: