Reuse non-reusable command buffer arenas for task queue submission alloc.
@benvanik is already working on this.
Since Apr 18, 2021.
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 47
Description
We need some scratch memory for submissions and currently we are pulling this from the block pool. This has the side-effect of forcing another concurrently outstanding block as both the command buffer backing storage and the submission arena block have the same lifetime. This happens each submission:
https://github.com/google/iree/blob/064a4160108bb7d68ec4ac07c3de9f64a9c7622f/iree/hal/local/task_queue.c#L332-L342
Instead we should check the command buffer flags and if it is non-reusable then we can continue appending to its arena. This may still spill but significantly less often. For simple models that fit their commands within a single command buffer block this will reduce memory consumption as this scratch work uses the small block pool at 4KB block sizes by default and we could avoid acquiring any of those.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.