Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hexagon] [runtime] VTCM Allocator #12947

Merged
merged 16 commits into from
Oct 3, 2022
Merged

Conversation

janetsc
Copy link
Collaborator

@janetsc janetsc commented Sep 29, 2022

Adds a VTCM Memory Pool class, which allocates the largest contiguous buffer possible within 1 page upon construction.

Allocations and free space are maintained in two lists. Buffers that align on 2k size boundaries will choose the smallest open buffer which will satisfy the request. Non-aligned buffers will be allocated from the end of the free space.

HexagonBuffer will use this pool to service VTCM scope requests, replacing the individual calls to allocated the memory on separate pages.

The pool is created and destroyed in the device API Acquire/ReleaseResources.

Adds unit tests to exercise edge cases.

cc: @supersat @adstraw

@janetsc janetsc changed the title [WIP] VTCM Allocator [WIP] [Hexagon] [runtime] VTCM Allocator Sep 29, 2022
@janetsc
Copy link
Collaborator Author

janetsc commented Sep 30, 2022

@tvm-bot rerun

@janetsc janetsc marked this pull request as ready for review October 1, 2022 00:12
@janetsc janetsc changed the title [WIP] [Hexagon] [runtime] VTCM Allocator [Hexagon] [runtime] VTCM Allocator Oct 1, 2022
src/runtime/hexagon/hexagon_vtcm_pool.cc Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.cc Outdated Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.cc Outdated Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.cc Outdated Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.cc Outdated Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.cc Outdated Show resolved Hide resolved
src/runtime/hexagon/hexagon_vtcm_pool.h Outdated Show resolved Hide resolved
Copy link
Contributor

@kparzysz-quic kparzysz-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@driazati driazati merged commit f121e5e into apache:main Oct 3, 2022
@janetsc janetsc deleted the vtcm_allocator branch October 4, 2022 13:10
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
Adds a VTCM Memory Pool class, which allocates the largest contiguous buffer possible within 1 page upon construction.

Allocations and free space are maintained in two lists.  Buffers that align on 2k size boundaries will choose the smallest open buffer which will satisfy the request.  Non-aligned buffers will be allocated from the end of the free space.

HexagonBuffer will use this pool to service VTCM scope requests, replacing the individual calls to allocated the memory on separate pages.

The pool is created and destroyed in the device API Acquire/ReleaseResources.

Adds unit tests to exercise edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants