-
Notifications
You must be signed in to change notification settings - Fork 167
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
New features in cloudpickle give unexpected results #214
Comments
@suquark are there things that we can change on the Ray side to fix the problem? Also, do you know what the motivating issues for changing cloudpickle's behavior in these instances were? |
@robertnishihara One option could be that Ray would allow one to configure its own version of serialization logic. For example, for us this would then allow us to use plain pickle and side-step all these issues. |
I'm not able to look into the issue, nor do I have the necessary context for me to investigate. |
@suquark I agree we could have switches for customizing this cloudpickle specific behavior. I think such switches could be passed as arguments to the constructor of the For instance let's add a kwarg named:
I am not sure what you mean by this. Could you provide a small example outside of the context of Ray? |
Additional question: do you want this for the functions / classes defined in the |
@ogrisel infer global variables refers to the following code: cloudpickle/cloudpickle/cloudpickle.py Lines 643 to 649 in 2ba0847
cloudpickle/cloudpickle/cloudpickle.py Lines 1105 to 1117 in 2ba0847
We found it could get a wrong reference of itself when serializing a recursive function under some complex settings. (We further hacked the recursive call by assign the function itself to its globals after deserialization.) |
This should be fixed by #240. |
The fix is now available in cloudpickle 0.8.0 on PyPI. |
I am a developer of Ray, and we have something we want to fix soon. We are updating cloudpickle to 0.6.1 to fix an issue. However, although version 0.6.1 fixed our issue, it failed to pickle several objects correctly. These failures only happened when we were trying to run a complex set of unittests so we found it hard to give some simple instructions to trigger those cases.
I investigated into those cases and created a PR which fixed those failures and this PR showed that:
__module__
attribute of a function. The new changes in cloudpickle try to make use of__module__
when it fails to fetch global variables.It seems that these new features are not compatible with Ray, but they are not really bugs to be reverted. And since we would like to follow the cloudpickle upstream instead of maintaining our own copy, the proper way should be creating several switches to control the availability of those new features in the upstream. Could you have any suggestions about how and where should we put those switches?
The text was updated successfully, but these errors were encountered: