[api] Initial API deprecations for Ray 1.0 (#10325)

This commit is contained in:
Eric Liang
2020-08-28 15:03:50 -07:00
committed by GitHub
parent 9c25ca6f5e
commit 519354a39a
75 changed files with 223 additions and 2414 deletions
@@ -106,7 +106,7 @@ def tune_transformer(num_samples=8,
gpus_per_trial=0,
smoke_test=False,
ray_address=None):
ray.init(ray_address, log_to_driver=False)
ray.init(ray_address, _log_to_driver=False)
data_dir_name = "./data" if not smoke_test else "./test_data"
data_dir = os.path.abspath(os.path.join(os.getcwd(), data_dir_name))
if not os.path.exists(data_dir):
+3 -3
View File
@@ -396,7 +396,7 @@ class RayTrialExecutor(TrialExecutor):
try:
reset_val = ray.get(
trainable.reset.remote(new_config, trial.logdir),
DEFAULT_GET_TIMEOUT)
timeout=DEFAULT_GET_TIMEOUT)
except RayTimeoutError:
logger.exception("Trial %s: reset timed out.", trial)
return False
@@ -465,7 +465,7 @@ class RayTrialExecutor(TrialExecutor):
raise ValueError("Trial was not running.")
self._running.pop(trial_future[0])
with warn_if_slow("fetch_result"):
result = ray.get(trial_future[0], DEFAULT_GET_TIMEOUT)
result = ray.get(trial_future[0], timeout=DEFAULT_GET_TIMEOUT)
# For local mode
if isinstance(result, _LocalWrapper):
@@ -734,7 +734,7 @@ class RayTrialExecutor(TrialExecutor):
with self._change_working_directory(trial):
return ray.get(
trial.runner.export_model.remote(trial.export_formats),
DEFAULT_GET_TIMEOUT)
timeout=DEFAULT_GET_TIMEOUT)
return {}
def has_gpus(self):
+1 -1
View File
@@ -31,7 +31,7 @@ class Capturing:
@pytest.fixture
def start_ray():
ray.init(log_to_driver=False, local_mode=True)
ray.init(_log_to_driver=False, local_mode=True)
_register_all()
yield
ray.shutdown()
+2 -2
View File
@@ -96,9 +96,9 @@ class UtilMonitor(Thread):
def pin_in_object_store(obj):
"""Deprecated, use ray.put(value, weakref=False) instead."""
"""Deprecated, use ray.put(value) instead."""
obj_ref = ray.put(obj, weakref=False)
obj_ref = ray.put(obj)
_pinned_objects.append(obj_ref)
return obj_ref