ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.98k stars 5.77k forks source link

[Core] Ray client doesn't support `should_capture_child_tasks_in_placement_group` API #33513

Open chaokunyang opened 1 year ago

chaokunyang commented 1 year ago

What happened + What you expected to happen

When invoke should_capture_child_tasks_in_placement_group in ray client, it raise exception:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 ray.worker.global_worker.should_capture_child_tasks_in_placement_group()

File ~/anaconda3/envs/py3.8/lib/python3.8/site-packages/ray/_private/worker.py:501, in Worker.should_capture_child_tasks_in_placement_group(self)
    499 @property
    500 def should_capture_child_tasks_in_placement_group(self):
--> 501     return self.core_worker.should_capture_child_tasks_in_placement_group()

AttributeError: 'Worker' object has no attribute 'core_worker'

Although it seems unnecesasary to invoke should_capture_child_tasks_in_placement_group in ray client, but sometimes the code are nested deeply, and it's not easy to workaround it.

Versions / Dependencies

ray==2.3.0

Reproduction script

import ray
ray.init(address='localhost:10001')
ray.worker.should_capture_child_tasks_in_placement_group()

Issue Severity

High: It blocks me from completing my task.

zhe-thoughts commented 1 year ago

Thanks for reporting this @chaokunyang ! We will try to resolve