-
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
All arguments to _remote
should be optional. Currently args
and kwargs
are required.
#4300
Comments
Since this is tagged "good first issue", would you mind elaborating a little bit on what |
From the source code in ray/remote_function.py :
This allows setting those parameters in the remote call, vs decoration of the function. |
Ok, cool. So this would be a nicer way of implementing: def blah(arg):
return thing
ray.remote(blah)(num_cpus=10000).remote(arg) Where the alternative to having to hard code the number of CPUs in the decorator is just to not use it as a decorator? E: sorry just a bit confused re: "optional", because given this code: def _remote(self,
args=None,
kwargs=None,
num_return_vals=None,
num_cpus=None,
num_gpus=None,
resources=None):
"""An experimental alternate way to submit remote functions."""
worker = ray.worker.get_global_worker()
worker.check_connected()
if self._last_export_session < worker._session_index:
# If this function was exported in a previous session, we need to
# export this function again, because current GCS doesn't have it.
self._last_export_session = worker._session_index
worker.function_actor_manager.export(self)
kwargs = {} if kwargs is None else kwargs
args = ray.signature.extend_args(self._function_signature, args,
kwargs) It looks like |
@justinwyang has been working on this in #4305. @zbarry that's exactly right. And you're right it is already optional for remote function invocations. However, it isn't for actor creation and actor method invocation. |
No description provided.
The text was updated successfully, but these errors were encountered: