forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtime][hip] Propagate errors through semaphores (iree-org#18021)
Adds proper handling of errors that occur when executing operations on the device or when a semaphore fails in the wait list. These errors will propagate to downstream semaphores that are in the signal list of the operation. This change includes some refactor the pending queue actions: * Make the context hold a sticky status instead of just an status code. * Remove the worker threads' "error" state. This can be handled by the context's status. * Remove "exit committed" thread state in favor of standard thread joining. * Make the "exit requested" thread state a separate boolean variable and guard against submitting more work after an exit is requested. Also wait on all work to complete before exiting worker threads, not just on the currently ran actions. * Make pending work items increment immediately when an action is enqueued instead of when scheduled on the HIP stream. This is required to properly count outstanding work. * Remove and merge some of the redundant state for the worker and completion threads. * Remove reference counting from the pending queue actions context. It has a clear owner, which is the device. * Rework when the threads exit, which is pretty much only when exit is requested and there is no more queued or executing actions. Errors don't cause the threads to exit. Here is not included moving the destruction and cleanup of actions from the worker thread to the completion thread. This is an optimization and code simplification that is now possible since we are not using HIP stream callbacks, so we could do that right after an action completes. Technically, actions get destroyed on the completion thread as well when not on the happy path and actions fail.
- Loading branch information
Showing
14 changed files
with
724 additions
and
515 deletions.
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
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
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
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
Oops, something went wrong.