llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[L0] Backend context will contain all devices even if frontend context contains single device

Open CaoZhongZ opened this issue 2 years ago • 4 comments

Which will let the driver create extra allocations in certain scenarios. Should we use zeContextCreateEx instead of zeContextCreate?

https://github.com/intel/llvm/blob/ad880488f093333d93e4025573587f7d522e79d5/sycl/plugins/unified_runtime/ur/adapters/level_zero/context.cpp#L32

CaoZhongZ avatar Jul 11 '23 03:07 CaoZhongZ

@CaoZhongZ : the devices exposed by the L0 driver vary depending on ZE_AFFINITY_MASK, while the devices exposed by the SYCL runtime are determined by ONEAPI_DEVICE_SELECTOR. Idea is that a SYCL user uses the ONEAPI_DEVICE_SELECTOR to select the devices that wants to use, and SYCL runtime filters those from all available from L0 (or the subset defined by ZE_AFFINITY_MASK).

Now, we could definitely make this safer by creating the L0 context only with a sub-set of the devices with the function you mentioned above. So far, we haven't gotten reports of issues (that I recall) that are not working correctly due to this, which is why we may have not added the support.

If you have a failed case, then we can prioritize adding this.

CC: @smaslov-intel , to confirm my understanding above.

jandres742 avatar Jul 11 '23 17:07 jandres742

Yes, the safer part is what I mean. We triggered other problem in backend, though it could be fixed but the performance would also be impaired a little bit.

CaoZhongZ avatar Jul 12 '23 02:07 CaoZhongZ

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.

github-actions[bot] avatar Oct 23 '25 02:10 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please, re-open if the issue still exists.

github-actions[bot] avatar Nov 22 '25 02:11 github-actions[bot]