[SYCL][E2E] Fix Plugin/level_zero_usm_residency.cpp on Multi-card PVC #12844
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.
Problem:
Plugin/level_zero_usm_residency.cpp fails on Multi-card PVC due to unexpected number of calls to zeContextMakeMemoryResident. The test was expecting just one call to zeContextMakeMemoryResident upon piextUSMDeviceAlloc. However,
// RUN: env SYCL_PI_TRACE=-1 UR_L0_DEBUG=-1 %{l0_leak_check} %{run} %t.out 2>&1
produces two calls to zeContextMakeMemoryResident.
Solution:
The default value of SYCL_PI_LEVEL_ZERO_USM_RESIDENT is 0x002, which makes memory residence on all devices, which IIUC, means on all tiles of a multi-card PVC. That's why we see two calls to zeContextMakeMemoryResident, one for each tile of a multi-tile PVC.
This doesn't look like a bug in the code, but in the test instead. This PR updates the test case to also accept more than one calls to zeContextMakeMemoryResident for device allocations.