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

[FEAT] annotate ray tasks with name of instructions #1729

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions daft/execution/execution_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return self.__str__()

def name(self) -> str:
return f"{'-'.join(i.__class__.__name__ for i in self.instructions)} [Stage:{self.stage_id}]"


class PartitionTaskBuilder(Generic[PartitionT]):
"""Builds a PartitionTask by adding instructions to its pipeline."""
Expand Down
2 changes: 1 addition & 1 deletion daft/runners/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def mark_task_start(self, step: PartitionTask[Any]) -> None:
stage_id = step.stage_id

if stage_id not in self.pbars:
name = "-".join(i.__class__.__name__ for i in step.instructions)
name = step.name()
self._make_new_bar(stage_id, name)
else:
pb = self.pbars[stage_id]
Expand Down
4 changes: 1 addition & 3 deletions daft/runners/ray_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,7 @@ def _build_partitions(
daft_execution_config_objref: ray.ObjectRef, task: PartitionTask[ray.ObjectRef]
) -> list[ray.ObjectRef]:
"""Run a PartitionTask and return the resulting list of partitions."""
ray_options: dict[str, Any] = {
"num_returns": task.num_results + 1,
}
ray_options: dict[str, Any] = {"num_returns": task.num_results + 1, "name": task.name()}

if task.resource_request is not None:
ray_options = {**ray_options, **_get_ray_task_options(task.resource_request)}
Expand Down
Loading