Skip to content

Propagating errors through the task system. - #8219

Merged
benvanik merged 7 commits into
mainfrom
benvanik-task-errors
Feb 1, 2022
Merged

benvanik merged 7 commits into
mainfrom
benvanik-task-errors

Conversation

@benvanik

@benvanik benvanik commented Feb 1, 2022

Copy link
Copy Markdown
Collaborator

This allows for errors to properly fail task scopes and ensure subsequent work is discarded correctly; errors now propagate up to their parent scope and can be retrieved by HAL semaphores or users for graceful handling. Misc cleanup and simplification was done as part of this and new tests were added to verify the behavior.

Progress on #4026. Waits still need work but are being redesigned in future changes.

This allows it to be owned by the task system and shared between both
the HAL and the upcoming VM loop scheduler.
@benvanik benvanik added runtime Relating to the IREE runtime library hal/cpu Runtime Host/CPU-based HAL backend labels Feb 1, 2022
@benvanik
benvanik requested a review from ScottTodd February 1, 2022 18:51
Comment thread iree/task/task.h Resolved
Comment thread iree/task/task_impl.h Resolved
Comment thread iree/task/task_impl.h Resolved
No reason to have it be an int and that hurts compiler analysis.
Waits still need work that will come with follow-on refactorings.
Failures of calls and dispatch workgroups will now make their way to the
parent scope and properly discard all subsequent tasks. The scope
retains the first failure encountered so that it can be returned back to
user layers (propagated to HAL semaphores, the event loop, etc).

Progress on #4026.
Sharding is better and it wasn't worth keeping the slicing code around
and allocating the extra memory at runtime in case it was used.

This drops executor memory consumption to the ~1-4KB + ~512B/worker.
@benvanik
benvanik force-pushed the benvanik-task-errors branch from 31fdea8 to 0adc497 Compare February 1, 2022 19:33
@benvanik
benvanik marked this pull request as ready for review February 1, 2022 19:36
@benvanik
benvanik enabled auto-merge February 1, 2022 20:02
@benvanik
benvanik disabled auto-merge February 1, 2022 20:48
@benvanik
benvanik enabled auto-merge February 1, 2022 20:49
@benvanik
benvanik merged commit e838b4a into main Feb 1, 2022
@benvanik
benvanik deleted the benvanik-task-errors branch February 1, 2022 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hal/cpu Runtime Host/CPU-based HAL backend runtime Relating to the IREE runtime library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants