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

Support turbo mode for better latency but burn more power on CPU & NPU #250

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

mamin506
Copy link
Contributor

@mamin506 mamin506 commented Sep 11, 2024

  1. Mailbox channel support three types: MGMT, USER_NORMAL and USER_POLL
  • MGMT channel is interrupt based and good for not critical path.
  • USER_NORMAL channel is interrupt based and good for critical path.
  • USER_POLL channel is polling based and good for critical path which needs the best latency.
  1. Support "xrt-smi configure --pmode turbo"
  • Only when no context is opened, change pmode from/to turbo are allowed.
  • In turbo mode, all contexts are creating USER_POLL mailbox channel for best latency.
  1. Support hwq::poll_command() in shim
  2. Add shim_test for polling
test name ID (wait in ioctl) ID (polling)
latency 25 41
throughput 40 42
runlist latency 39 43
runlist throughput 30 44

Signed-off-by: Min Ma <min.ma@amd.com>
Signed-off-by: Min Ma <min.ma@amd.com>
Signed-off-by: Min Ma <min.ma@amd.com>
@@ -41,7 +67,7 @@ int aie2_pm_set_mode(struct amdxdna_dev_hdl *ndev, enum amdxdna_power_mode_type
if (ndev->pw_mode == target)
return 0;

if (target == POWER_MODE_LOW || target == POWER_MODE_MEDIUM)
if (target != POWER_MODE_DEFAULT && target != POWER_MODE_TURBO)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to support performance/default/turbo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if (io_test_parameters.wait == IO_TEST_POLL_WAIT) {
auto start = clk::now();
while(!hwq->poll_command(bo->get())) {
auto now = clk::now();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be too heavy to call clk::now() for every poll.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: Min Ma <min.ma@amd.com>
@maxzhen maxzhen merged commit eddd92c into amd:main Sep 11, 2024
@mamin506 mamin506 deleted the mbox_turbo branch September 11, 2024 21:59
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.

2 participants