-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Deprecate _remote function #7676
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
Conversation
|
Can one of the admins verify this patch? |
|
I think also need to change all tests that are currently use _remote function. |
|
Test FAILed. |
|
Test FAILed. |
17117be to
9bf28ee
Compare
|
Test FAILed. |
|
Test FAILed. |
4459fa8 to
88106dd
Compare
|
Test FAILed. |
88106dd to
57df465
Compare
|
Test FAILed. |
57df465 to
ed457e7
Compare
|
Test FAILed. |
|
Test FAILed. |
ed457e7 to
2804251
Compare
|
Test FAILed. |
|
Test FAILed. |
2804251 to
678b058
Compare
|
Test PASSed. |
edoakes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! Left a few comments to clean things up some more.
python/ray/remote_function.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this internal_called flag? Can we just remove all instances of calling this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, there are mainly two places will call this _remote method, one place is inside the class definition which is good and intended, the other place is outside of the class, we only want to raise a warning message when the latter case happens, thus need this flag to distinguish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just get rid of _remote() entirely instead. Looks like .remote() just calls ._remote() directly - we can just move the implementation to .remote() and leave a deprecation error in ._remote()
678b058 to
f7eb785
Compare
|
Test PASSed. |
edoakes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the docstrings for .options() for both actor classes and remote functions need to be updated to remove the reference to ._remote() as well.
python/ray/remote_function.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just get rid of _remote() entirely instead. Looks like .remote() just calls ._remote() directly - we can just move the implementation to .remote() and leave a deprecation error in ._remote()
| ray.get(a2.method.remote()) | ||
|
|
||
| id1, id2, id3, id4 = a.method._remote( | ||
| id1, id2, id3, id4 = a.method.remote( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to change this to use .options().remote()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here a is Actor and the ActorMethod class which a.method is doesn't even have the .options function.
| return self._remote(args=args, kwargs=kwargs) | ||
| return self._remote(args=args, kwargs=kwargs, internal_called=True) | ||
|
|
||
| self.remote = _remote_proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edoakes If we remove _remote completely, then this wrapper here that used to keep function's signature also needs to be removed. for detail see #4985. I tried and failed to find a better way to remove the _remote method and also keep the function signature at the same time. Note that we must keep the function signature otherwise it will raise an exception at this place:
Lines 112 to 118 in 6ce8b63
| reconstructed_signature = inspect.Signature( | |
| parameters=signature_parameters) | |
| try: | |
| reconstructed_signature.bind(*args, **kwargs) | |
| except TypeError as exc: | |
| raise TypeError(str(exc)) | |
| list_args = [] |
Why are these changes needed?
Deprecate _remote function.
Related issue number
Closes #7040
Checks
scripts/format.shto lint the changes in this PR.