-
Notifications
You must be signed in to change notification settings - Fork 208
[XPTI] introduce new interface to kineto for PTI-0.11 and PTI-0.12 #1066
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
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 |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| /* | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| #include "XpuptiActivityApi.h" | ||
|
|
||
| #include <assert.h> | ||
|
|
@@ -170,6 +178,43 @@ void XpuptiActivityApi::bufferCompleted( | |
| } | ||
| #endif | ||
|
|
||
| #if PTI_VERSION_MAJOR > 0 || PTI_VERSION_MINOR > 10 | ||
| static void enableSpecifcRuntimeAPIsTracing() { | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueUSMFill_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueUSMFill2D_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueUSMMemcpy_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueUSMMemcpy2D_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueKernelLaunch_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, | ||
| pti_api_group_id::PTI_API_GROUP_SYCL, | ||
| urEnqueueKernelLaunchCustomExp_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, | ||
| pti_api_group_id::PTI_API_GROUP_SYCL, | ||
| urEnqueueCooperativeKernelLaunchExp_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueMemBufferFill_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueMemBufferRead_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueMemBufferWrite_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urEnqueueMemBufferCopy_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urUSMHostAlloc_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urUSMSharedAlloc_id)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApi( | ||
| 1, pti_api_group_id::PTI_API_GROUP_SYCL, urUSMDeviceAlloc_id)); | ||
| } | ||
|
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. why we still need these UR specific API ids? we should use API set?
Contributor
Author
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. Yes. We will use API set, just apply the previous patch and open a draft PR. 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. then, can we make this PR as a draft? |
||
| #endif | ||
|
|
||
| void XpuptiActivityApi::enableXpuptiActivities( | ||
| const std::set<ActivityType>& selected_activities) { | ||
| #ifdef HAS_XPUPTI | ||
|
|
@@ -192,7 +237,16 @@ void XpuptiActivityApi::enableXpuptiActivities( | |
| externalCorrelationEnabled_ = true; | ||
| } | ||
| if (activity == ActivityType::XPU_RUNTIME) { | ||
| #if PTI_VERSION_MAJOR > 0 || PTI_VERSION_MINOR > 11 | ||
| XPUPTI_CALL(ptiViewEnable(PTI_VIEW_RUNTIME_API)); | ||
| XPUPTI_CALL(ptiViewEnableRuntimeApiClass( | ||
| 1, PTI_API_CLASS_GPU_OPERATION_CORE, PTI_API_GROUP_ALL)); | ||
| #elif PTI_VERSION_MAJOR == 0 && PTI_VERSION_MINOR == 11 | ||
| XPUPTI_CALL(ptiViewEnable(PTI_VIEW_RUNTIME_API)); | ||
| enableSpecifcRuntimeAPIsTracing(); | ||
| #else | ||
| XPUPTI_CALL(ptiViewEnable(PTI_VIEW_SYCL_RUNTIME_CALLS)); | ||
| #endif | ||
| } | ||
| if (activity == ActivityType::OVERHEAD) { | ||
| XPUPTI_CALL(ptiViewEnable(PTI_VIEW_COLLECTION_OVERHEAD)); | ||
|
|
@@ -222,7 +276,12 @@ void XpuptiActivityApi::disablePtiActivities( | |
| XPUPTI_CALL(ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION)); | ||
| } | ||
| if (activity == ActivityType::XPU_RUNTIME) { | ||
| #if PTI_VERSION_MAJOR > 0 || PTI_VERSION_MINOR > 10 | ||
| XPUPTI_CALL(ptiViewDisable(PTI_VIEW_RUNTIME_API)); | ||
| #else | ||
|
|
||
| XPUPTI_CALL(ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS)); | ||
| #endif | ||
| } | ||
| if (activity == ActivityType::OVERHEAD) { | ||
| XPUPTI_CALL(ptiViewDisable(PTI_VIEW_COLLECTION_OVERHEAD)); | ||
|
|
||
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.
Might be useful to use a version schema similar to cuda where they embed the MAJOR, MINOR and PATCH number into one number. If you use OR statements like this it can lead to more complexity if many ifdefs are needed
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.
Hi, @sraikund16
Thank you for good suggestion.
For now, intel GPU doesn't have capability version control API. Only XPTI has release version macro so we use it here to do conditional building. We will consider to add the capability version control then refine here.
Thank you.