Initial implementation of async execution.#91
Open
stellaraccident wants to merge 2 commits into
Open
Conversation
* Only implements async execution and asynd d2h. * Need to come up with a better way to bridge async completion signals to EventInstance::OnReady callback. * There is room here for more of a scheduler that has some knowledge of the transfer and execution timeline. Will be needed when joining h2d transfer timelines.
cd28a70 to
e2212a6
Compare
benvanik
approved these changes
Jan 17, 2023
| /*wait_semaphore_list=*/iree_hal_fence_semaphore_list(done_fence()), | ||
| /*signal_semaphore_list=*/iree_hal_semaphore_list_empty(), | ||
| iree_hal_buffer_view_buffer(buffer_view_.get())); | ||
| return iree_ok_status(); |
Collaborator
There was a problem hiding this comment.
Suggested change
| return iree_ok_status(); |
| // Import the destination (host) buffer as an iree_hal_buffer_t so that we | ||
| // can issue copy commands. | ||
| iree::vm::ref<iree_hal_buffer_t> dst_buffer; | ||
| iree_hal_buffer_params_t dst_buffer_params = { |
Collaborator
There was a problem hiding this comment.
you'll want to set the type to IREE_HAL_MEMORY_TYPE_HOST_LOCAL | IREE_HAL_MEMORY_TYPE_DEVICE_VISIBLE
| IREE_RETURN_IF_ERROR(iree_hal_device_queue_execute( | ||
| device_.device(), IREE_HAL_QUEUE_AFFINITY_ANY, | ||
| /*wait_semaphore_list=*/iree_hal_fence_semaphore_list(ready_fence_.get()), | ||
| /*signal_semaphore_list=*/iree_hal_semaphore_list_empty(), |
Collaborator
There was a problem hiding this comment.
RE comment above: you'll want a signal fence for this so when it's implemented you'll be able to hook on to that to get your event signal callback (or ideally if it's a standard event type like an fd/HANDLE import it so we can signal it directly from the GPU). You'll at least need the signal so that you ensure you don't schedule more work while this copy is outstanding: you need to make sure nothing is able to mutate the device buffer.
Comment on lines
+603
to
+605
| // IREE_RETURN_IF_ERROR(iree_hal_fence_create_at(transfer_timeline_.get(), 0, | ||
| // client_.host_allocator(), | ||
| // &transfer_now_fence_)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| // IREE_RETURN_IF_ERROR(iree_hal_fence_create_at(transfer_timeline_.get(), 0, | |
| // client_.host_allocator(), | |
| // &transfer_now_fence_)); |
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.
Uh oh!
There was an error while loading. Please reload this page.