Repository navigation
Adding inline command buffers to the HAL API and a basic implementation. - #5508
Merged
Merged
Conversation
benvanik
force-pushed
the
benvanik-inline-cmd-buf
branch
from
April 18, 2021 23:11
026603c to
b2f34a3
Compare
This was referenced Apr 18, 2021
benvanik
force-pushed
the
benvanik-hal-submit-and-wait
branch
from
April 19, 2021 17:19
6861032 to
4d25359
Compare
This will allow us to implement synchronous execution behavior for local execution.
ScottTodd
reviewed
Apr 19, 2021
This is a command buffer that can be used for _ALLOW_INLINE_EXECUTION mode command buffers when no threading is desired. Future improvements could make the actual dispatch pluggable such that it could be used with the task system, another thread pool, etc. For now all dispatches execute synchronously on the recording thread.
benvanik
force-pushed
the
benvanik-inline-cmd-buf
branch
from
April 19, 2021 18:32
b2f34a3 to
a01e9ff
Compare
ScottTodd
approved these changes
Apr 19, 2021
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the
IREE_HAL_COMMAND_BUFFER_MODE_ALLOW_INLINE_EXECUTIONmode to the HAL API.This information can be useful for just about any backend (not just local single-threaded CPU) and it's carefully defined here to allow us to use it in remote/sandbox, async accelerator, and the task system backends as well. The intent is that future compiler passes that introduce asynchronous overlapping execution will be optional and when disabled all command buffers can carry this flag (or have an alternate code path generated for them).
To test this I've added
iree_hal_inline_command_buffer_t- a simple command buffer that just executes as it records and does not persist the recorded commands. This can be used for one-shot primary command buffers in the task system when we start to use secondary command buffers to contain the bulk of the dispatches and for the synchronous HAL.This is only part of what's required for a full non-task-system synchronous backend: command buffer recording and reuse will be an important performance feature and we'll want to allow it (if not require it) even on systems where we would use this. In such cases the inline execution will be used for the primary dynamic command buffers and they may execute reusable secondary command buffers.
To test this I hacked it into the task backend to create this hilarious trace:

Progress on #4680.