Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][cgraph] Clean up CompiledDAG.actor_refs #51174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions python/ray/dag/compiled_dag_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,6 @@ def __init__(
# ObjectRef for each worker's task. The task is an infinite loop that
# repeatedly executes the method specified in the DAG.
self.worker_task_refs: Dict["ray.actor.ActorHandle", "ray.ObjectRef"] = {}
# Set of actors present in the DAG.
self.actor_refs = set()
self.actor_to_tasks: Dict[
"ray.actor.ActorHandle", List["CompiledTask"]
] = defaultdict(list)
Expand Down Expand Up @@ -1653,7 +1651,6 @@ def _get_or_compile(
task.output_node_idxs.append(self.dag_node_to_idx[downstream_node])
actor_handle = task.dag_node._get_actor_handle()
assert actor_handle is not None
self.actor_refs.add(actor_handle)
self.actor_to_tasks[actor_handle].append(task)
elif (
isinstance(task.dag_node, ClassMethodNode)
Expand Down Expand Up @@ -2157,7 +2154,7 @@ def teardown(self, kill_actors: bool = False):
outer._dag_submitter.close()
outer._dag_output_fetcher.close()

for actor in outer.actor_refs:
for actor in outer.actor_to_executable_tasks.keys():
logger.info(f"Cancelling compiled worker on actor: {actor}")
# Cancel all actor loops in parallel.
cancel_refs = [
Expand Down