-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Data]Update Data progress bars to use row as the iteration unit #46699
Merged
Merged
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4cb78b0
fix
Bye-legumes 7161754
fix
Bye-legumes 1f5ddac
fix
Bye-legumes 6b5857c
fix
Bye-legumes 1501a6c
fix
Bye-legumes 6e5a784
fix
Bye-legumes d4fc58c
fix
Bye-legumes 813b2e6
Merge branch 'master' into fix_row
Bye-legumes 7d3e049
fix
Bye-legumes 1c8a618
fix
Bye-legumes b57fea4
fix default
Bye-legumes 190e38e
rever changed for progress bar
Bye-legumes bcafb6e
rever changed for progress bar
Bye-legumes c8885ed
Merge branch 'master' into fix_row
scottjlee 833f8da
Merge branch 'master' into fix_row
Bye-legumes 7ffe665
add assert
Bye-legumes e3da096
Merge branch 'master' into fix_row
scottjlee 37791cb
Merge branch 'master' into fix_row
Bye-legumes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,7 +316,8 @@ def _output_ready_callback(task_index, output: RefBundle): | |
def _task_done_callback(task_index: int, exception: Optional[Exception]): | ||
self._metrics.on_task_finished(task_index, exception) | ||
|
||
# Estimate number of tasks from inputs received and tasks submitted so far | ||
# Estimate number of tasks and rows from inputs received and tasks | ||
# submitted so far | ||
upstream_op_num_outputs = self.input_dependencies[0].num_outputs_total() | ||
if upstream_op_num_outputs: | ||
estimated_num_tasks = ( | ||
|
@@ -329,6 +330,11 @@ def _task_done_callback(task_index: int, exception: Optional[Exception]): | |
* self._metrics.num_outputs_of_finished_tasks | ||
/ self._metrics.num_tasks_finished | ||
) | ||
self._estimated_num_output_rows = round( | ||
estimated_num_tasks | ||
* self._metrics.rows_task_outputs_generated | ||
/ self._metrics.num_tasks_finished | ||
) | ||
|
||
self._data_tasks.pop(task_index) | ||
# Notify output queue that this task is complete. | ||
|
@@ -427,6 +433,10 @@ def num_active_tasks(self) -> int: | |
# to reflect the actual data processing tasks. | ||
return len(self._data_tasks) | ||
|
||
@property | ||
def estimated_output_num_rows(self) -> Optional[int]: | ||
return getattr(self, "_estimated_output_num_rows", 0) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't need this once we implement class attribute at the |
||
|
||
def _map_task( | ||
map_transformer: MapTransformer, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -210,8 +210,8 @@ def initialize_progress_bars(self, index: int, verbose_progress: bool) -> int: | |||||||
) | ||||||||
self.progress_bar = ProgressBar( | ||||||||
"- " + self.op.name, | ||||||||
self.op.num_outputs_total(), | ||||||||
unit="bundle", | ||||||||
self.op.estimated_output_num_rows, | ||||||||
unit="row", | ||||||||
position=index, | ||||||||
enabled=progress_bar_enabled, | ||||||||
) | ||||||||
|
@@ -242,7 +242,8 @@ def add_output(self, ref: RefBundle) -> None: | |||||||
self.outqueue.append(ref) | ||||||||
self.num_completed_tasks += 1 | ||||||||
if self.progress_bar: | ||||||||
self.progress_bar.update(1, self.op.num_outputs_total()) | ||||||||
num_rows = sum(meta.num_rows for _, meta in ref.blocks) | ||||||||
self.progress_bar.update(num_rows, self.op.estimated_output_num_rows) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
def refresh_progress_bar(self, resource_manager: ResourceManager) -> None: | ||||||||
"""Update the console with the latest operator progress.""" | ||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename property to keep naming convention consistent with
num_outputs_total
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, can we add
_estimated_output_num_rows
as a class attribute inPhysicalOperator.__init__()
(set toNone
)? so that here, we can simply returnself._estimated_output_num_rows
. and inMapOperator
, we won't need to define its ownestimated_output_num_rows