mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 00:43:43 +08:00
Remove legacy Ray code. (#3121)
* Remove legacy Ray code. * Fix cmake and simplify monitor. * Fix linting * Updates * Fix * Implement some methods. * Remove more plasma manager references. * Fix * Linting * Fix * Fix * Make sure class IDs are strings. * Some path fixes * Fix * Path fixes and update arrow * Fixes. * linting * Fixes * Java fixes * Some java fixes * TaskLanguage -> Language * Minor * Fix python test and remove unused method signature. * Fix java tests * Fix jenkins tests * Remove commented out code.
This commit is contained in:
committed by
Philipp Moritz
parent
055daf17a0
commit
658c14282c
@@ -213,20 +213,9 @@ class RayTrialExecutor(TrialExecutor):
|
||||
assert self._committed_resources.gpu >= 0
|
||||
|
||||
def _update_avail_resources(self):
|
||||
if ray.worker.global_worker.use_raylet:
|
||||
# TODO(rliaw): Remove once raylet flag is swapped
|
||||
resources = ray.global_state.cluster_resources()
|
||||
num_cpus = resources["CPU"]
|
||||
num_gpus = resources["GPU"]
|
||||
else:
|
||||
clients = ray.global_state.client_table()
|
||||
local_schedulers = [
|
||||
entry for client in clients.values() for entry in client
|
||||
if (entry['ClientType'] == 'local_scheduler'
|
||||
and not entry['Deleted'])
|
||||
]
|
||||
num_cpus = sum(ls['CPU'] for ls in local_schedulers)
|
||||
num_gpus = sum(ls.get('GPU', 0) for ls in local_schedulers)
|
||||
resources = ray.global_state.cluster_resources()
|
||||
num_cpus = resources["CPU"]
|
||||
num_gpus = resources["GPU"]
|
||||
self._avail_resources = Resources(int(num_cpus), int(num_gpus))
|
||||
self._resources_initialized = True
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class TrainableFunctionApiTest(unittest.TestCase):
|
||||
return Resources(cpu=config["cpu"], gpu=config["gpu"])
|
||||
|
||||
def _train(self):
|
||||
return dict(timesteps_this_iter=1, done=True)
|
||||
return {"timesteps_this_iter": 1, "done": True}
|
||||
|
||||
register_trainable("B", B)
|
||||
|
||||
@@ -440,7 +440,7 @@ class TrainableFunctionApiTest(unittest.TestCase):
|
||||
self.state = {"hi": 1}
|
||||
|
||||
def _train(self):
|
||||
return dict(timesteps_this_iter=1, done=True)
|
||||
return {"timesteps_this_iter": 1, "done": True}
|
||||
|
||||
def _save(self, path):
|
||||
return self.state
|
||||
@@ -471,7 +471,7 @@ class TrainableFunctionApiTest(unittest.TestCase):
|
||||
|
||||
def _train(self):
|
||||
self.state["iter"] += 1
|
||||
return dict(timesteps_this_iter=1, done=True)
|
||||
return {"timesteps_this_iter": 1, "done": True}
|
||||
|
||||
def _save(self, path):
|
||||
return self.state
|
||||
@@ -604,7 +604,7 @@ class RunExperimentTest(unittest.TestCase):
|
||||
|
||||
class B(Trainable):
|
||||
def _train(self):
|
||||
return dict(timesteps_this_iter=1, done=True)
|
||||
return {"timesteps_this_iter": 1, "done": True}
|
||||
|
||||
register_trainable("f1", train)
|
||||
trials = run_experiments({
|
||||
@@ -624,7 +624,7 @@ class RunExperimentTest(unittest.TestCase):
|
||||
def testCheckpointAtEnd(self):
|
||||
class train(Trainable):
|
||||
def _train(self):
|
||||
return dict(timesteps_this_iter=1, done=True)
|
||||
return {"timesteps_this_iter": 1, "done": True}
|
||||
|
||||
def _save(self, path):
|
||||
return path
|
||||
@@ -887,7 +887,7 @@ class TrialRunnerTest(unittest.TestCase):
|
||||
self.assertEqual(trials[1].status, Trial.PENDING)
|
||||
|
||||
def testFractionalGpus(self):
|
||||
ray.init(num_cpus=4, num_gpus=1, use_raylet=True)
|
||||
ray.init(num_cpus=4, num_gpus=1)
|
||||
runner = TrialRunner(BasicVariantGenerator())
|
||||
kwargs = {
|
||||
"resources": Resources(cpu=1, gpu=0.5),
|
||||
|
||||
@@ -28,7 +28,7 @@ def pin_in_object_store(obj):
|
||||
def get_pinned_object(pinned_id):
|
||||
"""Retrieve a pinned object from the object store."""
|
||||
|
||||
from ray.local_scheduler import ObjectID
|
||||
from ray.raylet import ObjectID
|
||||
|
||||
return _from_pinnable(
|
||||
ray.get(
|
||||
|
||||
Reference in New Issue
Block a user