-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Support super() for actors #795
Conversation
Merged build finished. Test FAILed. |
Test FAILed. |
@mehrdadn Do you have any idea how we could make the second syntax supported? |
I think I'd first need to know the exact semantics you want before I can try to suggest how to implement this. For example, if we have:
What behavior do you want, for other reasonable decorators Also note that the first usage is wrong for any class except the most-derived class in the hierarchy. (i.e. if someone inherited from |
Or I guess an easier way to state my question is: what exactly should |
@mehrdadn good point about how the first usage could break, thanks for bringing that up! As for the example you gave, I think I would expect Oh I see, your point about the decorators. I think I'd still expect it to be |
test this please |
Merged build finished. Test FAILed. |
Test FAILed. |
Ah yeah you're right, I guess as long as the inner decorators aren't doing anything too weird it shouldn't matter. First, note that it does seem that cloudpickle doesn't support recursion:
so if I understand this right, given that such functions are working correctly with So you'd need to treat classes the same way, and they should work. I'm looking at the code now to see why they don't, but my guess right now is that classes are being treated very differently from functions. |
This is related to #449. |
I agree with @mehrdadn that In python, Until and unless |
@mehrdadn and I just looked into this a bit more. If you do the following import ray
ray.init()
class Foo(object):
pass
@ray.remote
class Bar(Foo):
def __init__(self):
super(Bar, self).__init__()
b = Bar.remote() the constructor task prints the following error.
One possible solution is to be more eager and to pickle |
@royf Regarding "in Python,
The Ray semantics so far has been to bind things statically at the point of |
@mehrdadn I meant python, but I was wrong. |
test this please |
Merged build finished. Test PASSed. |
Test PASSed. |
You guys probably have this figured out, but here's my $0.02. I like that
|
@royf, you're saying that for some of these more complex use cases, you really need to call |
@robertnishihara Yes, a class decorator is syntactic sugar for |
Closing for now since this has diverged a bunch. |
With this PR and the cloudpickle master, the following works:
Note that this doesn't work yet: