-
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
Dataclass becomes empty after running ray remote function #28838
Comments
Did some investigation and get stuck - but I will post my findings first. I am able to reproduce it with current master and So a few scenarios have to be met in order this to be reproduced:
Root cause (but why?)After digging into the code a bit, I think the reason this https://github.com/python/cpython/blob/main/Lib/dataclasses.py#L1255
_Here, when the issue surfaced, the Before
After
|
Removing the |
Thank you for digging into it. I think we need to somehow revert the change on dataclass after ray task is complete. |
Facing the exact same issue. Any serialization of members of a class (using 'dataclasses' library) is not working when using 'ray' annotations on methods of the class. If this is a rare case scenario then there must be some way to circumvent this, I don't know how to circumvent this issue as of now. |
I am also encountering this issue. My specific scenario is to use dataclasses to pass data around between tasks and then eventually pass them into pandas to construct a dataframe. I can work around this for now by using |
HI, many customers run into these issues in the production environment, does anyone know how to resolve it? |
Hey all - thanks for reporting, I will have time to look into this again. |
I have a possibly related issue: Simply initializing a dataclass inside of a ray trainable yields a dataclass with empty
Inside the ray tune:
So in my case the dataclass breaks before even being serialized. This could also explain the serialization not working. |
Typo on downgrade; keeping to p0 after discuss with @rkooo567 |
What happened + What you expected to happen
In our case, We use dataclass_json.to_json to serialize the dataclass, but we failed to serialize dataclass because the dataclass value became empty for some reason after running the ray remote function
Versions / Dependencies
python==3.9
ray==1.13.0
Reproduction script
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: