From 4e436508510a653ef6bf1ab7a6dc934575c504d1 Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Mon, 23 Nov 2020 16:20:22 -0600 Subject: [PATCH] Remove deprecated f._submit API (#12268) --- doc/source/troubleshooting.rst | 6 +++--- python/ray/remote_function.py | 17 ----------------- python/ray/tests/test_node_manager.py | 4 ++-- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/doc/source/troubleshooting.rst b/doc/source/troubleshooting.rst index e8d8657dd..3ea522619 100644 --- a/doc/source/troubleshooting.rst +++ b/doc/source/troubleshooting.rst @@ -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) diff --git a/python/ray/remote_function.py b/python/ray/remote_function.py index 0375d84b9..68a0eef84 100644 --- a/python/ray/remote_function.py +++ b/python/ray/remote_function.py @@ -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, diff --git a/python/ray/tests/test_node_manager.py b/python/ray/tests/test_node_manager.py index 76d5d45d0..bd33dbd51 100644 --- a/python/ray/tests/test_node_manager.py +++ b/python/ray/tests/test_node_manager.py @@ -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) ])