Skip to content

Commit

Permalink
[tune] remove legacy client API (#41469)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdeng authored Nov 29, 2023
1 parent e26bd75 commit ab1532c
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 588 deletions.
1 change: 0 additions & 1 deletion doc/source/tune/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ on `Github`_.
env.rst
integration.rst
internals.rst
client.rst
cli.rst
41 changes: 0 additions & 41 deletions doc/source/tune/api/client.rst

This file was deleted.

8 changes: 0 additions & 8 deletions python/ray/tune/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,6 @@ py_test(
tags = ["team:ml", "exclusive"],
)

py_test(
name = "test_tune_server",
size = "medium",
srcs = ["tests/test_tune_server.py"],
deps = [":tune_lib"],
tags = ["team:ml", "exclusive"],
)

py_test(
name = "test_tuner",
size = "large",
Expand Down
82 changes: 0 additions & 82 deletions python/ray/tune/TuneClient.ipynb

This file was deleted.

21 changes: 0 additions & 21 deletions python/ray/tune/execution/tune_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
from ray.tune.utils.log import Verbosity, has_verbosity
from ray.tune.execution.placement_groups import PlacementGroupFactory
from ray.tune.utils.serialization import TuneFunctionDecoder, TuneFunctionEncoder
from ray.tune.web_server import TuneServer
from ray.util.annotations import DeveloperAPI, Deprecated
from ray.util.debug import log_once

Expand All @@ -82,7 +81,6 @@ def __init__(
scheduler: Optional[TrialScheduler] = None,
stopper: Optional[Stopper] = None,
resume: Union[str, bool] = False,
server_port: Optional[int] = None,
fail_fast: bool = False,
checkpoint_period: Union[str, int] = None,
callbacks: Optional[List[Callback]] = None,
Expand Down Expand Up @@ -205,11 +203,6 @@ def __init__(
int(os.environ.get("TUNE_PRINT_ALL_TRIAL_ERRORS", "1"))
)

self._server = None
self._server_port = server_port
if server_port is not None:
self._server = TuneServer(self, self._server_port)

self._trials: List[Trial] = []
self._live_trials: Set[Trial] = set() # Set of non-terminated trials
self._cached_trial_decisions = {}
Expand Down Expand Up @@ -752,13 +745,6 @@ def step(self):

self._iteration += 1

if self._server:
with warn_if_slow("server"):
self._process_stop_requests()

if self.is_finished():
self._server.shutdown()

with warn_if_slow("on_step_end"):
self.on_step_end()
with warn_if_slow("callbacks.on_step_end"):
Expand Down Expand Up @@ -2040,7 +2026,6 @@ def __getstate__(self):
"_trials",
"_live_trials",
"_stop_queue",
"_server",
"_search_alg",
"_placeholder_resolvers",
"_scheduler_alg",
Expand Down Expand Up @@ -2070,12 +2055,9 @@ def __getstate__(self):
"_actor_cache",
]:
del state[k]
state["launch_web_server"] = bool(self._server)
return state

def __setstate__(self, state):
launch_web_server = state.pop("launch_web_server")

# Use session_str from previous checkpoint if does not exist
session_str = state.pop("_session_str")
self.__dict__.setdefault("_session_str", session_str)
Expand All @@ -2086,9 +2068,6 @@ def __setstate__(self, state):
self.__dict__.update(state)
self._checkpoint_manager = self._create_checkpoint_manager()

if launch_web_server:
self._server = TuneServer(self, self._server_port)


class _TrialExecutorWrapper:
"""Wraps around TrialExecutor class, intercepts API calls and warns users
Expand Down
3 changes: 0 additions & 3 deletions python/ray/tune/tests/test_tune_save_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import ray
from ray import tune
from ray.train import CheckpointConfig
from ray.rllib import _register_all
from ray.tune import Trainable
from ray.tune.utils import validate_save_restore

Expand Down Expand Up @@ -52,8 +51,6 @@ def tearDown(self):
shutil.rmtree(self.absolute_local_dir, ignore_errors=True)
self.absolute_local_dir = None
ray.shutdown()
# Without this line, test_tune_server.testAddTrial would fail.
_register_all()

def _get_trial_dir(self, absoulte_exp_dir):
print("looking for", self.MockTrainable._name)
Expand Down
Loading

0 comments on commit ab1532c

Please sign in to comment.