ray: Class attribute in ray actor cannot be accessed/copied
What is the problem?
Ray actor fails to access class attributes.
Ray version and other system information (Python version, TensorFlow version, OS):
ray 1.0.0
Python 3.7.7
Reproduction (REQUIRED)
This code is modified from https://github.com/dask/distributed/issues/4233#issue-740152650
from module import Foo
import ray
@ray.remote
class ray_Foo:
def __init__(self, Foo):
self.Foo = Foo
def show(self):
return self.Foo.bar
ray.init()
foo = Foo()
foo.append(123)
print(foo.show())
ray_foo = ray_Foo.remote(foo)
print(ray.get(ray_foo.show.remote()))
$ cat module.py
class Foo:
bar = []
def append(self, value):
self.bar.append(value)
def show(self):
return self.bar
$ python ray_issue_new.py
[123]
[]
If we cannot run your script, we cannot fix your issue.
- I have verified my script runs in a clean environment and reproduces the issue.
- I have verified the issue also occurs with the latest wheels.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 22 (10 by maintainers)
@rkooo567 Do you have a feel for when that might get into the work pipeline? Definitely don’t want to be pushy, but just trying to plan our work accordingly 😃
Have this issues been resolved in latest version of Ray?
Hi, I’m having that issue in ray 1.13.0 with cloudpickle 2.1.0. Is there any chance it will be resolved fairly soon?
@rkooo567 @wuisawesome Hello, it seems that cloudpickle has merged a pull request (here) that can solve this issue. I wonder whether it can be implemented here?