mirror of
https://github.com/wassname/ray.git
synced 2026-07-08 22:39:00 +08:00
Improve local_mode (#5060)
This commit is contained in:
committed by
Robert Nishihara
parent
932d6b2517
commit
8f53364097
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user