Skip to content

Conversation

@PawelSwider2000
Copy link

Refactor of existing CuptiActivityProfiler::logGpuVersions and extracting it into separate class DeviceVersionLogger which 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 XpuVersionLogger class.

For XPU following information will be added to logs:

      "pti_version": "<version>",
      "level_zero_version": <version>,
      "sycl_compiler_version": <version>,

Extend version metadata for XPU
@meta-cla meta-cla bot added the cla signed label Dec 16, 2025
}
}
for (auto& pair : versionMetadata_) {
for (auto& pair : versionLogger_ ? versionLogger_->getVersionMetadata() : std::unordered_map<std::string, std::string>{}) {
Copy link
Contributor

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

Copy link

@tsocha tsocha left a 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;
Copy link

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)
Copy link

Choose a reason for hiding this comment

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

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);
Copy link

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.

Suggested change
auto result = zeInit(0);
auto result = zeInit();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants