Improve local_mode (#5060)

This commit is contained in:
Edward Oakes
2019-07-08 02:10:50 +02:00
committed by Robert Nishihara
parent 932d6b2517
commit 8f53364097
7 changed files with 280 additions and 85 deletions
+4 -3
View File
@@ -30,9 +30,6 @@ def free(object_ids, local_only=False, delete_creating_tasks=False):
"""
worker = ray.worker.get_global_worker()
if ray.worker._mode() == ray.worker.LOCAL_MODE:
return
if isinstance(object_ids, ray.ObjectID):
object_ids = [object_ids]
@@ -46,6 +43,10 @@ def free(object_ids, local_only=False, delete_creating_tasks=False):
raise TypeError("Attempting to call `free` on the value {}, "
"which is not an ray.ObjectID.".format(object_id))
if ray.worker._mode() == ray.worker.LOCAL_MODE:
worker.local_mode_manager.free(object_ids)
return
worker.check_connected()
with profiling.profile("ray.free"):
if len(object_ids) == 0: