-
Notifications
You must be signed in to change notification settings - Fork 41
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
test: Make streamer test to use concurrent metric groups #123
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,31 @@ bool check_metric_type_ip(ze_device_handle_t device, std::string groupName, | |
return check_metric_type_ip(groupHandle, includeExpFeature); | ||
} | ||
|
||
std::vector<zet_metric_group_handle_t> get_concurrent_metric_group( | ||
ze_device_handle_t device, | ||
std::vector<zet_metric_group_handle_t> &metricGroupHandleList) { | ||
|
||
uint32_t concurrentGroupCount = 0; | ||
EXPECT_EQ(ZE_RESULT_SUCCESS, | ||
zetDeviceGetConcurrentMetricGroupsExp( | ||
device, metricGroupHandleList.size(), | ||
metricGroupHandleList.data(), nullptr, &concurrentGroupCount)); | ||
std::vector<uint32_t> countPerConcurrentGroup(concurrentGroupCount); | ||
EXPECT_EQ(ZE_RESULT_SUCCESS, | ||
zetDeviceGetConcurrentMetricGroupsExp( | ||
device, metricGroupHandleList.size(), | ||
metricGroupHandleList.data(), countPerConcurrentGroup.data(), | ||
&concurrentGroupCount)); | ||
|
||
std::vector<zet_metric_group_handle_t> concurrentMetricGroupList; | ||
uint32_t metricGroupCountInConcurrentGroup = countPerConcurrentGroup[0]; | ||
|
||
for (uint32_t i = 0; i < metricGroupCountInConcurrentGroup; i++) { | ||
concurrentMetricGroupList.push_back(metricGroupHandleList[i]); | ||
} | ||
return concurrentMetricGroupList; | ||
} | ||
|
||
std::vector<metricGroupInfo_t> optimize_metric_group_info_list( | ||
std::vector<metricGroupInfo_t> &metricGroupInfoList, | ||
uint32_t percentOfMetricGroupForTest, const char *metricGroupName) { | ||
|
@@ -270,6 +295,7 @@ get_metric_group_info(ze_device_handle_t device, | |
get_metric_group_handles(device); | ||
|
||
std::vector<metricGroupInfo_t> matchedGroupsInfo; | ||
std::vector<zet_metric_group_handle_t> concurrentMetricGroupHandles; | ||
|
||
for (auto metricGroupHandle : metricGroupHandles) { | ||
zet_metric_group_properties_t metricGroupProp = {}; | ||
|
@@ -288,12 +314,25 @@ get_metric_group_info(ze_device_handle_t device, | |
continue; | ||
} | ||
|
||
concurrentMetricGroupHandles.push_back(metricGroupHandle); | ||
matchedGroupsInfo.emplace_back( | ||
metricGroupHandle, metricGroupProp.name, metricGroupProp.description, | ||
metricGroupProp.domain, metricGroupProp.metricCount); | ||
} | ||
|
||
return matchedGroupsInfo; | ||
concurrentMetricGroupHandles = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the rationale to change existing tests to use getConcurrentMetricGroups() instead of creating a new test? I think the value of this API will be when we have platforms with multiple metrics domains (or metrics sources) and effectively confirm the groups can be collected concurrently by opening different streamers (one per group) and/or tracers (with many groups ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is not to test the functionality of getConcurrentMetricGroups. Currently in all streamer tests we are iterating over all metric groups. This was resulting in timeouts on Elmo runs. Hence the idea here is to somehow reduce the run-time by reducing the metric groups that the tests run on. Santhosh had suggested we can just run for 1 metric group from each source, which should be enough for all the tests. This new implementation does exactly this. It takes the first concurrent group returned by the getConcurrentMetricGroups API and only uses that for the tests. This today is expected to have 1 from OA and 1 from IP sampling.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect, makes sense. Just a few comments:
|
||
get_concurrent_metric_group(device, concurrentMetricGroupHandles); | ||
std::vector<metricGroupInfo_t> concurrentMatchedGroupsInfo; | ||
|
||
for (auto groupsInfo : matchedGroupsInfo) { | ||
if (count(concurrentMetricGroupHandles.begin(), | ||
concurrentMetricGroupHandles.end(), | ||
groupsInfo.metricGroupHandle)) { | ||
concurrentMatchedGroupsInfo.push_back(groupsInfo); | ||
} | ||
} | ||
|
||
return concurrentMatchedGroupsInfo; | ||
} | ||
|
||
std::vector<metricGroupInfo_t> get_metric_type_ip_group_info( | ||
|
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.
how do you know what size to allocate for metricGroupHandleList ?
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.
Its coming as a reference to get_concurrent_metric_group method right. So its already appropriately allocated.
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.
ok its defined by metricGroupHandleList.size()