iree-org / iree-org/iree

Reuse non-reusable command buffer arenas for task queue submission alloc.

Open
#5,502 1 comment 0 reactions 1 assignee View on GitHub

@benvanik is already working on this.

Since Apr 18, 2021.

hal/cpu performance ⚡
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.