Repository navigation
[vulkan] Support emulated timeline semaphores - #2208
antiagainst wants to merge 22 commits into
Conversation
This commit adds a iree::hal::Semaphore implementation for Vulkan using binary semaphores and fences. It supports the functionality of a timeline semaphore while guaranteeing the usage requirements of binary semaphores and fences. In order to do that, we also need a special iree::hal::CommandQueue implementation for Vulkan that is able to defer releasing submissions to the GPU. This commit only wires up build configuration on CMake side for now. Conditionally compiling targets needs more consideration on Bazel side.
| option(IREE_HAL_VULKAN_EMULATE_TIMELINE_SEMAPHORE | ||
| "Emulates timeline semaphore with binary semaphores and fences" OFF) |
There was a problem hiding this comment.
How about always including emulation support and choosing at runtime whether to use it or not based on the Vulkan driver's capabilities (if Vulkan 1.2 or the extension exists)? We could also switch to that after working through some of the configuration details on the Bazel side (mostly thinking of our upstream setup). We've leaned towards increasing binary size instead of adding build complexity for similar pieces of code before.
There was a problem hiding this comment.
That's actually a good point. Agreed that choices inside the build system is not preferrable. It would require quite some large scope changes though; let me get to this later.
| // TODO(antiagainst): We actually should get the fences associated with the | ||
| // emulated timeline semaphores so that we can wait them in a bunch. This | ||
| // implementation is problematic if we wait to wait any and we have the first | ||
| // semaphore taking extra long time but the following ones signal quickly. |
There was a problem hiding this comment.
Thanks for the TODO. This could end up waiting the full deadline (possibly deadlocking?) even if one of the semaphores is already past its signal value...
There was a problem hiding this comment.
Yup. Sorry for being lazy. ;-P Don't want to further balloon this patch. It is working; I'll fix this later. :)
|
Ready for another round of review now. :) |
|
Okay there are some additional bugs in the impl I need to track down.. Please wait a bit. |
|
Okay this is good to go for a second round of reviews for now. |
571fa90 to
c74d8a6
Compare
This commit adds a iree::hal::Semaphore implementation for Vulkan using binary semaphores and fences. It supports the functionality of a timeline semaphore while guaranteeing the usage requirements of binary semaphores and fences. In order to do that, we also need a special iree::hal::CommandQueue implementation for Vulkan that is able to defer releasing submissions to the GPU. Progress on #2002. Closes #2208 PiperOrigin-RevId: 317944867
This commit adds a iree::hal::Semaphore implementation for Vulkan using binary semaphores and fences. It supports the functionality of a timeline semaphore while guaranteeing the usage requirements of binary semaphores and fences. In order to do that, we also need a special iree::hal::CommandQueue implementation for Vulkan that is able to defer releasing submissions to the GPU. Progress on #2002. Closes #2208 PiperOrigin-RevId: 317944867
This commit adds a iree::hal::Semaphore implementation for Vulkan using binary semaphores and fences. It supports the functionality of a timeline semaphore while guaranteeing the usage requirements of binary semaphores and fences. In order to do that, we also need a special iree::hal::CommandQueue implementation for Vulkan that is able to defer releasing submissions to the GPU. Progress on #2002. Closes #2208 PiperOrigin-RevId: 317944867
This commit adds a iree::hal::Semaphore implementation for Vulkan using binary semaphores and fences. It supports the functionality of a timeline semaphore while guaranteeing the usage requirements of binary semaphores and fences. In order to do that, we also need a special iree::hal::CommandQueue implementation for Vulkan that is able to defer releasing submissions to the GPU. Progress on #2002. Closes #2208 PiperOrigin-RevId: 317944867
This commit adds a iree::hal::Semaphore implementation for Vulkan
using binary semaphores and fences. It supports the functionality
of a timeline semaphore while guaranteeing the usage requirements
of binary semaphores and fences. In order to do that, we also need
a special iree::hal::CommandQueue implementation for Vulkan that
is able to defer releasing submissions to the GPU.
This commit only wires up build configuration on CMake side for
now. Conditionally compiling targets needs more consideration
on Bazel side.
Progress on #2002.