-
Notifications
You must be signed in to change notification settings - Fork 216
Refactor of handling version metadata parameters for devices and add XPU support #1198
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
base: main
Are you sure you want to change the base?
Refactor of handling version metadata parameters for devices and add XPU support #1198
Conversation
Extend version metadata for XPU
| } | ||
| } | ||
| for (auto& pair : versionMetadata_) { | ||
| for (auto& pair : versionLogger_ ? versionLogger_->getVersionMetadata() : std::unordered_map<std::string, std::string>{}) { |
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.
if (versionLogger_) for ... would be simpler
tsocha
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.
+1 @moksiuc comment
| #elif HAS_XPUPTI | ||
| return std::make_unique<XpuVersionLogger>(mutex); | ||
| #else | ||
| return nullptr; |
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 would like to avoid nullptr, could you add default behavior for CPU?
| set(XPUPTI_INCLUDE_DIR ${XPUPTI_INCLUDE_DIR} PARENT_SCOPE) | ||
|
|
||
| # find level zero library | ||
| find_library(LEVEL_ZERO_LIBRARY ze_loader) |
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.
| find_library(LEVEL_ZERO_LIBRARY ze_loader) | |
| find_library(LEVEL_ZERO_LIBRARY ze_loader REQUIRED) |
|
|
||
| std::string getLevelZeroVersion() { | ||
| uint32_t version = 0; | ||
| auto result = zeInit(0); |
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.
Check if we need this 0 here.
| auto result = zeInit(0); | |
| auto result = zeInit(); |
Refactor of existing
CuptiActivityProfiler::logGpuVersionsand extracting it into separate classDeviceVersionLoggerwhich should be overwritten by each device. Such approach allow for much easier creating support for this feature for various devices, it allow also to keep the device specific code separated from the rest of code.PR converts existing CUDA and ROCTRACER implementations to new format and add support for XPU devices via
XpuVersionLoggerclass.For XPU following information will be added to logs: