Refactor of handling version metadata parameters for devices and add XPU support#1198
Draft
PawelSwider2000 wants to merge 1 commit intopytorch:mainfrom
Draft
Refactor of handling version metadata parameters for devices and add XPU support#1198PawelSwider2000 wants to merge 1 commit intopytorch:mainfrom
PawelSwider2000 wants to merge 1 commit intopytorch:mainfrom
Conversation
Extend version metadata for XPU
moksiuc
suggested changes
Dec 16, 2025
| } | ||
| } | ||
| for (auto& pair : versionMetadata_) { | ||
| for (auto& pair : versionLogger_ ? versionLogger_->getVersionMetadata() : std::unordered_map<std::string, std::string>{}) { |
Contributor
There was a problem hiding this comment.
if (versionLogger_) for ... would be simpler
tsocha
suggested changes
Dec 16, 2025
| #elif HAS_XPUPTI | ||
| return std::make_unique<XpuVersionLogger>(mutex); | ||
| #else | ||
| return nullptr; |
There was a problem hiding this comment.
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.
Suggested change
| 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.
Check if we need this 0 here.
Suggested change
| auto result = zeInit(0); | |
| auto result = zeInit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: