Skip to content

Cleaning up HAL timeouts and tunneling iree_hal_device_submit_and_wait through the stack. - #5501

Merged
benvanik merged 6 commits into
mainfrom
benvanik-hal-submit-and-wait
Apr 19, 2021
Merged

benvanik merged 6 commits into
mainfrom
benvanik-hal-submit-and-wait

Conversation

@benvanik

@benvanik benvanik commented Apr 18, 2021 •

Copy link
Copy Markdown
Collaborator

This prepares for thread donation to the task pool by adding iree_hal_device_submit_and_wait to define an atomic operation that will let us avoid thread switches. In the process of adding yet another _with_deadline and _with_timeout I decided to clean that up to keep the API leaner.

This change gets us to the point where we have both the submit and wait happen side-by-side but does not yet implement the task system donation mechanism (tracked in #5507):
image
(the improvement stands to save ~12us from this 37us execution of a teeny tiny ++i dispatch, but that % will be larger on Android which has larger context switch delays - note that not doing this style of work at all is the smartest approach :)

@benvanik benvanik added performance ⚡ Performance/optimization related work across the compiler and runtime runtime/api IREE's public C runtime API and iree-run-module hal/api IREE's public C hardware abstraction layer API labels Apr 18, 2021
@benvanik
benvanik requested a review from ScottTodd April 18, 2021 08:25
@google-cla google-cla Bot added the cla: yes label Apr 18, 2021
@benvanik
benvanik marked this pull request as ready for review April 18, 2021 08:52
Comment thread iree/hal/device.h Resolved
This avoids the duplication of _with_deadline/_with_timeout throughout the
HAL.

This change does not try to optimize any of the use-sites. Some of the
Vulkan methods are going rel->abs->rel (and were before, but now it's
clear and easy to fix).
This misuse was causing a 16 byte copy to take 7ms o_o
@benvanik
benvanik force-pushed the benvanik-hal-submit-and-wait branch from 6861032 to 4d25359 Compare April 19, 2021 17:19
@benvanik
benvanik merged commit 3c275fc into main Apr 19, 2021
@benvanik
benvanik deleted the benvanik-hal-submit-and-wait branch April 19, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hal/api IREE's public C hardware abstraction layer API performance ⚡ Performance/optimization related work across the compiler and runtime runtime/api IREE's public C runtime API and iree-run-module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants