-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Ray Core] failed to serialize namedtuple in py3.9 #25951
Comments
Hi @auderson, thank you for reporting. As you found out, this is not really an issue with ray but with cloudpickle. I am afraid there is not much to be done here. Did you try what they suggested in the issue with moving the class in its module? Out of curiosity, why not using a dataclass or |
I don’t know the implementation detail of serialization in ray. Because ray.util.inspect_serializability reports True, so I think maybe I should report this in case there are other potential bugs. I didn’t try their suggestion, but I guess that can work. For your last question, using typing.NamedTuple is just my personal preference. |
@suquark is this something we documented or plan to fix? |
@auderson Yes, this is indeed an error from cloudpickle. Currently a workaround is to move class T(NamedTuple):
a:str to another python module and import it (as you mentioned). @rkooo567 @scv119 I think we should wait for the upstream (cloudpickle) to fix it if this is not a major blocker.
I can also help improving |
@suquark do you happen to know if cloudpickle is aware of this issue and plan to fix it? |
@rkooo567 yes, cloudpickle is aware of this in cloudpipe/cloudpickle#460. But I am not sure when it is going to be fixed in the upstream. |
Per Triage Sync: Dependent on upstream - cloudpipe/cloudpickle#460 |
Looks like cloudpickle fixed this issue (v2.2.1). |
Nice. We are using the custom fork of the cloud pickle. We may need to update the version.. |
@suquark curious if you have bandwidth to backport cloudpickle? |
no longer reproducible. |
It's still reproducing. The bundled version of cloudpickle didn't catch up with the upstream version the problem was fixed in. |
@rickyyx is it possible your newest changes also fix this issue? |
@moriyoshi we are bringing the upstream changes to the latest ray now |
Ok - seeing it in master, and verify the PR fixes it. |
What happened + What you expected to happen
ray failed to serialize namedtuple in py3.9, which looks like a error from cloudpickle:
cloudpipe/cloudpickle#460
Versions / Dependencies
python 3.9.7
ray 1.13.0
not tested with other versions
Reproduction script
Issue Severity
Low: It annoys or frustrates me.
The text was updated successfully, but these errors were encountered: