mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
[api] Initial API deprecations for Ray 1.0 (#10325)
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user