Add support for oneCCL and Synchronization events.#1335
Open
tsocha wants to merge 21 commits intopytorch:mainfrom
Open
Add support for oneCCL and Synchronization events.#1335tsocha wants to merge 21 commits intopytorch:mainfrom
tsocha wants to merge 21 commits intopytorch:mainfrom
Conversation
ptiViewGetApiIdName requires valid _api_group and _api_id values. Use PTI_API_GROUP_LEVELZERO (1) with zeEventHostSynchronize_id (84) in test records to avoid PTI_ERROR_BAD_ARGUMENT.
gtest_discover_tests runs the test executable at build time to enumerate tests. With the MSVC generator, the oneAPI DLLs are not in PATH, causing STATUS_DLL_NOT_FOUND (0xc0000135). gtest_add_tests parses the source at configure time instead, avoiding the runtime dependency.
…pported PTI does not support communication events on Windows. Replace XPUPTI_CALL with LOG(WARNING) for PTI_VIEW_COMMUNICATION enable and disable to allow the session to be constructed gracefully.
Separate PTI_VIEW_DEVICE_SYNCHRONIZATION from COLLECTIVE_COMM into its own XPU_SYNC activity type, as device synchronization is unrelated to collective communication.
Add FORCE:UNRESOLVED and WINDOWS_EXPORT_ALL_SYMBOLS for Windows DLL builds, and use platform-aware import library path instead of hardcoded .so extension. With multi-config generators (Visual Studio), CMAKE_BUILD_TYPE is empty at configure time. The inner ExternalProject (Ninja, single-config) was receiving an empty build type and defaulting to Release, causing _ITERATOR_DEBUG_LEVEL and RuntimeLibrary linker mismatches when building Debug. - Use custom CONFIGURE_COMMAND with $<CONFIG> generator expression to forward the active configuration to the inner Ninja build - Simplify find_library PATH_SUFFIXES in compute/CMakeLists.txt to prioritize CMAKE_BUILD_TYPE-matching libraries
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Fix invalid JSON in synchronization metadata: use addMetadataQuoted for string (Type) and pointer (handle) fields - Increment gpuOpCount for GPU barrier synchronization types - Guard communication tests with PTI_VERSION_AT_LEAST(0, 17) - Fix ExternalProject_Add for single/multi-config generators on Linux/Windows
Co-authored-by: Slawomir Siwek <slawomir.siwek@intel.com>
Author
|
@EikanWang, @gujinghui please review. |
gujinghui
reviewed
Apr 9, 2026
libkineto/include/ActivityType.h
Outdated
| PRIVATEUSE1_RUNTIME = 24, // host side privateUse1 runtime events | ||
| PRIVATEUSE1_DRIVER = 25, // host side privateUse1 driver events | ||
| PRIVATEUSE1_RUNTIME = 25, // host side privateUse1 runtime events | ||
| PRIVATEUSE1_DRIVER = 26, // host side privateUse1 driver events |
There was a problem hiding this comment.
Do not change the existing values in the list. Let's add the new item before the ENUM_COUNT only.
gujinghui
reviewed
Apr 9, 2026
| XPUPTI_CALL(ptiViewEnable(PTI_VIEW_COLLECTION_OVERHEAD)); | ||
| break; | ||
|
|
||
| #if PTI_VERSION_AT_LEAST(0, 17) |
Author
There was a problem hiding this comment.
Could you be more precise here?
This change is consistent with this function: example in line 233.
This PR have 7 hits with #if PTI_VERSION_AT_LEAST(0, 17):
- 2x
ptiViewEnableandptiViewDisable. It's consistent within the function handling PTI versions. - 3x in event handlers
.cppand.hforXpuptiActivityProfilerSession::handleCommunicationActivity.
I could move.cpppart to another file but it's a single function. - 2x in tests.
I think that I can't use @moksiuc design here.
Most of these #ifs are here because it's the new feature in PTI.
@moksiuc could you confirm that?
Contributor
There was a problem hiding this comment.
At first glance I don't see how new code could be extracted to separate files or classes except separate Handlers file.
The --export-dynamic linker flag is Linux-specific and causes build failures on Windows. Guard it with a platform check to only apply on non-Windows systems. On Windows, symbol exporting is handled differently via DLL exports and doesn't require this linker flag.
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.
XPU_SYNCActivityTypePTI_VIEW_COMMUNICATIONis unsupportedXpuptiProfilerTestLiblinking, ExternalProject Debug/Release mismatch, general MSVC compilation fixesXPUPTI_BUILD_FLAGlogging in CMakeCommits marked with 🤖 are made with usage of gen AI.