Skip to content

Conversation

@janetsc
Copy link
Contributor

@janetsc janetsc commented Oct 24, 2022

Add support to lock and unlock resources on the individual threads. Adds APIs to get a thread handle for a given resource type, and get a resource type for a given thread handle. This will aid in asynchronous support that is sending work to dedicated threads for the hardware resources.

There are two steps to fully acquire a resource: reserve and lock. HTP/HVX manager objects are created on the global thread, which will reserve the resources. The lock/unlock will occur on the thread that owns a particular instance. The manager objects will be deconstructed when the thread manager is deconstructed. This will release the resources.

cc: @csullivan, @adstraw, @JosephTheOctonaut, @kparzysz-quic

@tvm-bot
Copy link
Collaborator

tvm-bot commented Oct 24, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@janetsc janetsc marked this pull request as ready for review October 24, 2022 16:03
@janetsc
Copy link
Contributor Author

janetsc commented Oct 24, 2022

@tvm-bot run

1 similar comment
@janetsc
Copy link
Contributor Author

janetsc commented Oct 24, 2022

@tvm-bot run

Copy link
Contributor

@csullivan csullivan left a comment

Choose a reason for hiding this comment

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

Great! Just a few questions

Copy link
Contributor

@csullivan csullivan left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@tkonolige tkonolige merged commit 3836eb9 into apache:main Oct 26, 2022
@janetsc janetsc deleted the thread_resources branch October 26, 2022 18:14
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 10, 2022
…3181)

Add support to lock and unlock resources on the individual threads. Adds APIs to get a thread handle for a given resource type, and get a resource type for a given thread handle. This will aid in asynchronous support that is sending work to dedicated threads for the hardware resources.

There are two steps to fully acquire a resource: reserve and lock. HTP/HVX manager objects are created on the global thread, which will reserve the resources. The lock/unlock will occur on the thread that owns a particular instance. The manager objects will be deconstructed when the thread manager is deconstructed. This will release the resources.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…3181)

Add support to lock and unlock resources on the individual threads. Adds APIs to get a thread handle for a given resource type, and get a resource type for a given thread handle. This will aid in asynchronous support that is sending work to dedicated threads for the hardware resources.

There are two steps to fully acquire a resource: reserve and lock. HTP/HVX manager objects are created on the global thread, which will reserve the resources. The lock/unlock will occur on the thread that owns a particular instance. The manager objects will be deconstructed when the thread manager is deconstructed. This will release the resources.
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.

5 participants