Remove deprecated f._submit API (#12268)

This commit is contained in:
Edward Oakes 2020-11-23 16:20:22 -06:00 committed by GitHub
parent 822d8eb535
commit 4e43650851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 22 deletions

View file

@ -80,7 +80,7 @@ interest are the ones with non-zero execution times:
...
1 0.000 0.000 2.509 2.509 your_script_here.py:31(ex1)
5 0.000 0.000 0.001 0.000 remote_function.py:103(remote)
5 0.000 0.000 0.001 0.000 remote_function.py:107(_submit)
5 0.000 0.000 0.001 0.000 remote_function.py:107(_remote)
...
10 0.000 0.000 0.000 0.000 worker.py:2459(__init__)
5 0.000 0.000 2.508 0.502 worker.py:2535(get)
@ -160,7 +160,7 @@ Running our new Actor example, cProfile's abbreviated output is as follows:
ncalls tottime percall cumtime percall filename:lineno(function)
...
1 0.000 0.000 0.015 0.015 actor.py:546(remote)
1 0.000 0.000 0.015 0.015 actor.py:560(_submit)
1 0.000 0.000 0.015 0.015 actor.py:560(_remote)
1 0.000 0.000 0.000 0.000 actor.py:697(__init__)
...
1 0.000 0.000 2.525 2.525 your_script_here.py:63(ex4)
@ -213,7 +213,7 @@ Our example in total now takes only 1.5 seconds to run:
ncalls tottime percall cumtime percall filename:lineno(function)
...
5 0.000 0.000 0.002 0.000 actor.py:546(remote)
5 0.000 0.000 0.002 0.000 actor.py:560(_submit)
5 0.000 0.000 0.002 0.000 actor.py:560(_remote)
5 0.000 0.000 0.000 0.000 actor.py:697(__init__)
...
1 0.000 0.000 1.566 1.566 your_script_here.py:71(ex4)

View file

@ -107,23 +107,6 @@ class RemoteFunction:
f"of running '{self._function_name}()', "
f"try '{self._function_name}.remote()'.")
def _submit(self,
args=None,
kwargs=None,
num_returns=None,
num_cpus=None,
num_gpus=None,
resources=None):
logger.warning(
"WARNING: _submit() is being deprecated. Please use _remote().")
return self._remote(
args=args,
kwargs=kwargs,
num_returns=num_returns,
num_cpus=num_cpus,
num_gpus=num_gpus,
resources=resources)
def options(self,
args=None,
kwargs=None,

View file

@ -15,7 +15,7 @@ def test_infeasible_tasks(ray_start_cluster):
ray.init(address=cluster.address)
# Submit an infeasible task.
x_id = f._submit(args=[], kwargs={}, resources={str(1): 1})
x_id = f._remote(args=[], kwargs={}, resources={str(1): 1})
# Add a node that makes the task feasible and make sure we can get the
# result.
@ -42,7 +42,7 @@ f.remote()
# Make sure we can still run tasks on all nodes.
ray.get([
f._submit(args=[], kwargs={}, resources={str(i): 1}) for i in range(3)
f._remote(args=[], kwargs={}, resources={str(i): 1}) for i in range(3)
])