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

update latency configuration for multi numa nodes on one socket #26798

Merged
merged 18 commits into from
Nov 12, 2024

Conversation

wangleis
Copy link
Contributor

@wangleis wangleis commented Sep 26, 2024

Details:

Tickets:

@wangleis wangleis requested review from a team as code owners September 26, 2024 06:40
@github-actions github-actions bot added category: inference OpenVINO Runtime library - Inference category: CPU OpenVINO CPU plugin labels Sep 26, 2024
@wangleis wangleis requested review from sunxiaoxia2022 and dmitry-gorokhov and removed request for a team September 26, 2024 06:40
@github-actions github-actions bot added the category: build OpenVINO cmake script / infra label Sep 28, 2024

namespace ov {

void update_table_for_proc(const int _processor_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need to exposure this function? Do you have expectation developers will be needed to call it explicitly?
I would propose to keep it as private method of CPU class.
Tests should have its own implementation of this utility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move this function into CPU class. Now this is not private method because specific test case for this function.

@dmitry-gorokhov is it ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned test should have own implementation of this utility. I don't think this is good practice to exposure some functionality as dev API only in order to access it in the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@@ -282,6 +283,11 @@ CPU::CPU() {
OPENVINO_THROW("CPU affinity check failed. No CPU is eligible to run inference.");
};

if (_proc_type_table.size() > 1) {
int cur_processor_id = sched_getcpu();
update_table_for_proc(cur_processor_id, _proc_type_table, _cpu_mapping_table);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Too generic name? It is mostly like: sort_table_by_cpu_id
  2. We have to add comment why this sort is needed at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated function name and added function description.

@dmitry-gorokhov dmitry-gorokhov added this to the 2024.5 milestone Oct 8, 2024
@github-actions github-actions bot removed the category: build OpenVINO cmake script / infra label Oct 8, 2024
@wangleis
Copy link
Contributor Author

wangleis commented Oct 9, 2024

@dmitry-gorokhov Updated code as comments. Please review again.

}
};

friend class LinuxSortProcTableTests;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can test class as friend be removed?
Make sort_table_by_cpu_id as public or in test use test function to sort data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@praasz Dmitry ask to keep sort_table_by_cpu_id() as private function.

@dmitry-gorokhov any comments on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I would prefer to avoid making functionality public just because we want to test it in unit tests.
GoogleTests has some recommendations on it https://github.com/google/googletest/blob/main/docs/advanced.md#testing-private-code. Maybe FRIEND_TEST will work here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we just followed this GoogleTests recommendation. Since the private function in class CPU is defined in namespace ov, we follow the recommendation to use friend class.

Since the test function is only used inside the unit test file, "FRIEND_TEST" is not necessary.

@praasz @dmitry-gorokhov If you do not have concern, this PR will be merged in following days.

@wangleis wangleis added this pull request to the merge queue Nov 12, 2024
Merged via the queue into openvinotoolkit:master with commit 72bf426 Nov 12, 2024
166 checks passed
@wangleis wangleis deleted the latency_on_numa_node branch November 12, 2024 10:28
github-merge-queue bot pushed a commit that referenced this pull request Nov 12, 2024
… socket (#26944)

### Details:
- *update document for latency configuration for multi numa nodes on one
socket*
- *PR #26798 is code
change*

### Tickets:
 - *CVS-140601*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin category: inference OpenVINO Runtime library - Inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants