Skip to content

Conversation

@janetsc
Copy link
Contributor

@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
Contributor 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
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