Repository navigation
[UR][L0v2] Replace deprecated ZEX_counter_based_event extension with core API - #23154
Conversation
2d7a585 to
6421884
Compare
|
This PR is blocked by oneapi-src/level-zero#512 and oneapi-src/level-zero#513 |
22494f7 to
77b9181
Compare
|
Waiting for oneapi-src/level-zero#513 to be included in a public release |
77b9181 to
bd0fed5
Compare
bd0fed5 to
5489134
Compare
v1.34.0 adds tracking of zeEventCounterBasedCreate in basic_leak_checker (oneapi-src/level-zero#513), which is required for the counter-based-event leak-check E2E tests to pass once the L0 v2 adapter switches to calling the core zeEventCounterBasedCreate API (see PR intel#23154) instead of the deprecated zexCounterBasedEventCreate2 extension. Without this bump, the leak checker undercounts counter-based event creations and reports a false negative-leak mismatch. Bumps both the CI-installed loader package version (devops/dependencies.json) and the FetchContent-built loader used when SYCL_UR_FORCE_FETCH_LEVEL_ZERO is set (unified-runtime/cmake/FetchLevelZero.cmake), along with the matching pkg-config minimum version for the preinstalled-loader detection path.
The fix is already included in v1.34.0 level-zero loader release. Now waiting for level-zero loader to be updated to v1.34.0+ in CI. @sarnex Do you know when it will happen ? |
|
@ldorau For Linux, I can try bumping it now, but for Windows, as far as I remember we need to use the version shipped with the GPU driver and can't manually bump it, and given that L0 1.34 came out within a week, I expect it will be months before the Windows driver has 1.34 support. I see a couple of options: Let me know what you prefer. |
v1.34.0 adds tracking of zeEventCounterBasedCreate in basic_leak_checker (oneapi-src/level-zero#513), which is required for the counter-based-event leak-check E2E tests to pass once the L0 v2 adapter switches to calling the core zeEventCounterBasedCreate API (see PR intel#23154) instead of the deprecated zexCounterBasedEventCreate2 extension. Without this bump, the leak checker undercounts counter-based event creations and reports a false negative-leak mismatch. Bumps both the CI-installed loader package version (devops/dependencies.json) and the FetchContent-built loader used when SYCL_UR_FORCE_FETCH_LEVEL_ZERO is set (unified-runtime/cmake/FetchLevelZero.cmake), along with the matching pkg-config minimum version for the preinstalled-loader detection path.
bc84e28 to
0532d18
Compare
Thanks @sarnex! |
v1.34.0 adds tracking of zeEventCounterBasedCreate in basic_leak_checker (oneapi-src/level-zero#513), which is required for the counter-based-event leak-check E2E tests to pass once the L0 v2 adapter switches to calling the core zeEventCounterBasedCreate API (see PR intel#23154) instead of the deprecated zexCounterBasedEventCreate2 extension. Without this bump, the leak checker undercounts counter-based event creations and reports a false negative-leak mismatch. Bumps both the CI-installed loader package version (devops/dependencies.json) and the FetchContent-built loader used when SYCL_UR_FORCE_FETCH_LEVEL_ZERO is set (unified-runtime/cmake/FetchLevelZero.cmake), along with the matching pkg-config minimum version for the preinstalled-loader detection path.
e1f0538 to
89eff45
Compare
89eff45 to
f256ba4
Compare
a72c087 to
9314a54
Compare
|
The current versions for Windows: This PR is waiting for L0 loader v.1.34+ on Windows ... |
9314a54 to
e3d6f48
Compare
|
Rebased on the current sycl branch ... |
|
The current versions for Windows: This PR is waiting for L0 loader v.1.34+ on Windows ... |
…re API Migrate the level_zero v2 adapter's counter-based event provider from the deprecated ZEX_counter_based_event extension to the official Level Zero core API, which has been part of the spec since version 1.15, per https://github.com/intel/compute-runtime/blob/master/level_zero/doc/experimental_extensions/COUNTER_BASED_EVENTS.md - zexCounterBasedEventCreate2 -> zeEventCounterBasedCreate, called directly instead of via zeDriverGetExtensionFunctionAddress lookup - zex_counter_based_event_desc_t -> ze_event_counter_based_desc_t (signalScope/waitScope -> signal/wait) - ZEX_STRUCTURE_COUNTER_BASED_EVENT_DESC -> ZE_STRUCTURE_TYPE_EVENT_COUNTER_BASED_DESC - ZEX_COUNTER_BASED_EVENT_FLAG_* -> ZE_EVENT_COUNTER_BASED_FLAG_* (including the non-mechanical KERNEL_TIMESTAMP -> DEVICE_TIMESTAMP rename) Since the core API is dispatched through the loader like other core entry points, the zelLoaderTranslateHandle calls used to obtain raw driver handles for the extension function pointer are no longer needed on that path. The event creation logic previously inlined in allocate() is factored out into createZeEvent() and called once from the provider_counter constructor to probe whether the driver actually supports the core counter-based-event API. This restores the previous behavior where construction failure is caught by createProvider() and triggers a fallback to the event-pool based provider_normal, instead of only failing later inside allocate() with no fallback. The probe event is kept in the freelist so it isn't wasted. Add ur_platform_handle_t_::ZeCounterBasedEventsCoreApiSupported, set in platform initialization based on the driver's reported Level Zero API version (ZeApiVersion >= ZE_API_VERSION_1_15). provider_counter uses this flag to decide, at construction time, whether to use the new core API or fall back to the deprecated ZEX_counter_based_event extension (zexCounterBasedEventCreate2), which is kept around specifically for this purpose and used unchanged on drivers reporting an older API version. Signed-off-by: Lukasz Dorau <[email protected]>
|
That might take a while (months) :P |
L0 loader v.1.34+ is needed only on Windows BMG machines and only these 4 tests fail there: |
39d0642 to
3733672
Compare
|
Please review @intel/llvm-reviewers-runtime and/or @intel/unified-runtime-reviewers-level-zero |
The L0 loader on Windows CI (v1.32.0) does not count events created with
the core zeEventCounterBasedCreate API, so their zeEventDestroy calls are
reported by the UR_L0_LEAKS_DEBUG leak checker as a negative leak
("LEAK = -64"). This makes the L0 leak-check tests fail on Windows.
Temporarily ignore negative leak counts on Windows in these tests until
the loader is updated. Positive leaks are still detected on all platforms
and Linux keeps the full check.
Signed-off-by: Lukasz Dorau <[email protected]>
|
Please review @intel/unified-runtime-reviewers-level-zero |
|
Please review @kswiecicki |
|
Please merge @intel/llvm-gatekeepers |
Use the core Level Zero counter-based events API (part of the spec
since version 1.15) in the level_zero v2 adapter's counter-based event
provider instead of the deprecated ZEX_counter_based_event extension,
see
https://github.com/intel/compute-runtime/blob/master/level_zero/doc/experimental_extensions/COUNTER_BASED_EVENTS.md
directly instead of via zeDriverGetExtensionFunctionAddress lookup,
so the zelLoaderTranslateHandle calls are not needed
(signalScope/waitScope -> signal/wait)
ZE_STRUCTURE_TYPE_EVENT_COUNTER_BASED_DESC
(including the non-mechanical KERNEL_TIMESTAMP -> DEVICE_TIMESTAMP
rename)
The core API is used only if the driver reports Level Zero API version
1.15 or newer, recorded in the new platform flag
ur_platform_handle_t_::ZeCounterBasedEventsCoreApiSupported. Older
drivers keep using the deprecated extension unchanged.
Event creation is factored out of allocate() into createZeEvent() (core
API) and createZeEventLegacy() (extension). With the core API, the
provider_counter constructor creates one event up front, so if the
driver does not actually support the API, the constructor throws and
createProvider() falls back to the event-pool based provider_normal, as
before. The probe event is kept in the freelist.
The second commit, "[SYCL][E2E] Temporarily ignore negative L0 leak
counts on Windows", is a temporary workaround: the L0 loader on Windows
CI (v1.32.0) does not count events created with
zeEventCounterBasedCreate, so their zeEventDestroy calls are reported
as "LEAK = -64" and the following tests fail with a false-positive
leak:
On Windows these tests now ignore only negative leak counts, so real
(positive) leaks are still detected; Linux keeps the full check. The
workaround should be reverted once the L0 loader on Windows CI is
updated.