Repository navigation
Conversation
Narrow XPU_DRIVER to PTI's GPU_OPERATION_CORE class. The class filter has to follow ptiViewEnable(), which enables all api ids and clears the granularity flag; the first granular call then resets the group to all-disabled before enabling its class. zeCommandQueueExecuteCommandLists submits work to the GPU but is absent from PTI's class list, so enable it explicitly until that is fixed upstream.
|
@pytorchbot label 'ciflow/xpu' |
|
The ciflow label(s) ciflow/xpu will be added, but CI won't be triggered until the workflows are approved (scroll to the bottom of this page). Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
|
|
@gujinghui please review. |
| XPUPTI_CALL(ptiViewEnableDriverApi( | ||
| /*enable=*/1, | ||
| PTI_API_GROUP_LEVELZERO, | ||
| pti_api_id_driver_levelzero::zeCommandQueueExecuteCommandLists_id)); |
There was a problem hiding this comment.
@tsocha Should we ask the PTI team to add this API to the PTI_API_CLASS_GPU_OPERATION_CORE list?
Ideally, we should avoid hardcoding specific API names in pytorch/kineto. Asking the PTI team to handle this internally on their end would save us the effort of maintaining this custom bypass in the future.
There was a problem hiding this comment.
@tsocha Could you help address my below questions with this change? Thanks.
- If the kernel is launched by SYCL API, both SYCL kernel launch and L0 kernel launch will be traced, or only traces the SYCL kernel launch?
- If a lib launches kernel with L0 API directly, will the kernel launch be traced?
- All other implicit L0 calls will be hidden, for example, the event creations, host synchronization?
There was a problem hiding this comment.
@tsocha @gujinghui Yes - adding zeCommandQueueExecuteCommandLists to PTI_API_CLASS_GPU_OPERATION_CORE (in PTI ) makes sense and this is to add one line.
@tsocha can you pls do it.
There was a problem hiding this comment.
pti_api_id_driver_levelzero::zeCommandQueueExecuteCommandLists_id will be added into PTI_API_CLASS_GPU_OPERATION_CORE soon, but it won't be available until new oneAPI will be used in PyTorch.
Are you OK to keep it here for now?
- SYCL will produce L0 kernel launch event so it will be traced.
- It should be captured by XPU_DRIVER activity. list of events
- Yes, it will be hidden. For synchronization events I need to create a follow-up PR to enable
XPU_SYNCactivity type by default, it have to be enabled in PyTorch.
There was a problem hiding this comment.
Thanks for quick response.
Yes, it will be hidden. For synchronization events I need to create a follow-up PR to enable XPU_SYNC activity type by default, it have to be enabled in PyTorch.
@tsocha Can we have this first? The SYNC activity is important.
pti_api_id_driver_levelzero::zeCommandQueueExecuteCommandLists_id will be added into PTI_API_CLASS_GPU_OPERATION_CORE soon, but it won't be available until new oneAPI will be used in PyTorch.
Are you OK to keep it here for now?
We'd better have the fix in PTI first. @jfedorov May I know the plan for upcoming PTI release? Thanks.
|
@tsocha @gujinghui Just a heads up on #1571. We are planning to lock this repo tomorrow -- you'll need to recreate this PR in pytorch/pytorch on Monday if this hasn't landed by then. Dir structure and everything should be the same, so it should be trivial to copy the changes over. Thanks! |
|
@ryanzhang22 I will migrate this PR to the PyTorch repository when all issues will be resolved. |
Currently PTI reports 200+ types of events for
XPU_DRIVERactivity type.This PR reduce it to 20 related to launching kernels.
It will reduce size of the trace and limit the noise caused by L0 calls.
Narrow XPU_DRIVER to PTI's GPU_OPERATION_CORE class. The class filter has to follow ptiViewEnable(), which enables all api ids and clears the granularity flag; the first granular call then resets the group to all-disabled before enabling its class.
zeCommandQueueExecuteCommandLists submits work to the GPU but is absent from PTI's class list, so enable it explicitly until that is fixed upstream.