-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Hexagon] [runtime] Create objects to manage thread hardware resources #13111
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
Conversation
|
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 |
| } | ||
|
|
||
| TEST_F(HexagonThreadManagerTest, pipe_overflow) { | ||
| // TODO(HWE): Create a temporary thread manager with a smaller pipe for this test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion this morning, one way around this is to split out a base class for thread management, and then a HexagonThreadManager that inherits this. Hardware acquisition only occurs from the HexagonThreadManager. We could use that base class to test pipe length, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, would like to know the feasibility of splitting into testable base class + HexagonThreadManager before we decide whether to land this PR with this disabled test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might have some complexity when we parameterize the thread_main for each hardware resource that will be dedicated to that thread. So I'd like to postpone this until that task to acquire one hardware resource per thread.
csullivan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we'll need to add -mhmx to the build but it looks like the power and acquire APIs don't require this compiler flag.
adstraw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A couple small things. Is the idea that existing testing should cover this change?
| //! \brief Prevent move assignment. | ||
| HexagonHvx& operator=(HexagonHvx&&) = delete; | ||
|
|
||
| private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this can be deleted. No private members / methods.
| int answer{0}; | ||
| const unsigned threads{6}; | ||
| const unsigned pipe_size{100}; | ||
| const unsigned pipe_size{1000}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might add a "getter" for the pipe size and stack size.
apache#13111) This is the first step towards threads dedicated to different hardware resources. Added two objects to manage compute resources - HexagonHmx and HexagonHvx. These can be created on the main thread for now. The next step will be to acquire those resources on specific threads. * Add HexagonHvx and HexagonHmx * Disable pipe overflow test for now
apache#13111) This is the first step towards threads dedicated to different hardware resources. Added two objects to manage compute resources - HexagonHmx and HexagonHvx. These can be created on the main thread for now. The next step will be to acquire those resources on specific threads. * Add HexagonHvx and HexagonHmx * Disable pipe overflow test for now
This is the first step towards threads dedicated to different hardware resources.
Added two objects to manage compute resources - HexagonHmx and HexagonHvx. These can be created on the main thread for now. The next step will be to acquire those resources on specific threads.
Tested on HDK:
pytest tests/python/contrib/test_hexagon/test_parallel_hvx_load_vtcm.py
pytest tests/python/contrib/test_hexagon/test_parallel_hvx.py
pytest tests/python/contrib/test_hexagon/test_launcher.py
pytest tests/python/contrib/test_hexagon/test_run_unit_tests.py
pytest tests/python/contrib/test_hexagon/test_software_pipeline_async.py
cc: @csullivan, @kparzysz-quic, @JosephTheOctonaut, @adstraw