Skip to content

Conversation

@againull
Copy link
Contributor

@againull againull commented Mar 27, 2025

Replace the following e2e tests with unit test:

    ProgramManager/multi_device_bundle/device_libs_and_caching.cpp
    ProgramManager/multi_device_bundle/build_twice.cpp
    KernelAndProgram/persistent-cache-multi-device.cpp

The reason is that the checks performed in those e2e tests (number of UR calls, etc.) can be done more effificently using unit tests, such checks in e2e tests are expensive. Another reason is that e2e tests use NEO-specific CreateMultipleRootDevices=[num] environment variable which is not guaranteed to work, in unit tests we can emulate as many devices as we want.

@againull againull requested a review from a team as a code owner March 27, 2025 17:39
@againull againull requested a review from slawekptak March 27, 2025 17:39
@againull againull force-pushed the replace_with_unit_test branch from 2cd5d37 to d0d6751 Compare March 31, 2025 08:50
@againull againull changed the title [SYCL][Test] Replace multi-device kernel_bundle e2e test with unit test [SYCL] Replace multi-device kernel_bundle e2e tests with unit test Mar 31, 2025
Replace the following e2e tests with unit test:
ProgramManager/multi_device_bundle~device_libs_and_caching.cpp
ProgramManager/multi_device_bundle~build_twice.cpp
KernelAndProgram/persistent-cache-multi-device.cpp

The reason is that the checks performed in those e2e tests (number of UR
calls, etc.) can be done more effificently using unit tests, such checks
in e2e tests are expensive.
Another reson is that e2e tests use NEO-specific CreateMultipleRootDevices=[num]
environment variable which is not guaranteed to work, in unit tests we
can emulate as many devices as we want.
@againull
Copy link
Contributor Author

againull commented Apr 7, 2025

@slawekptak @intel/llvm-reviewers-runtime Could you review please.

Copy link
Contributor

@slawekptak slawekptak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small thing: This PR also modifies config.hpp. Could you please add a note to the description about this change and how it relates to the changes in tests?

@againull
Copy link
Contributor Author

againull commented Apr 11, 2025

Just a small thing: This PR also modifies config.hpp. Could you please add a note to the description about this change and how it relates to the changes in tests?

Sorry, I've removed that part as I have realized it is excessive. Initially I have added specialization of the SYCLConfig for SYCL_DEVICELIB_NO_FALLBACK to be able to unset that config value from inside the unit test - because I want to test behavior when fallback libs are allowed. Now I've realized that there is a simpler way to do so using existing ScopedEnvVar and by passing nullptr to it (which results in unsetting the value, i.e. same desired behavior).

@againull againull requested a review from slawekptak April 11, 2025 16:51
@againull againull changed the title [SYCL] Replace multi-device kernel_bundle e2e tests with unit test [SYCL][Test] Replace multi-device kernel_bundle e2e tests with unit test Apr 11, 2025
itt_annotations.cpp contains two unit tests.
First one was setting INTEL_ENABLE_OFFLOAD_ANNOTATIONS=1 and didn't
restore original value  - this is a bug, because there is no guarantee
that the first and the second test from this file run in order, google
test might run other tests in between.
So INTEL_ENABLE_OFFLOAD_ANNOTATIONS=1 was interfering with other tests -
the ones which test persistent cache, because INTEL_ENABLE_OFFLOAD_ANNOTATIONS=1
disables persistent cache.

So, this commit fixes this behaviour by using scoped env var.
If we register an image with device lib extensions then files must
already be available. There are some tests in ProgramManager unit test
executable which  create a kernel bundle withouth specifying
particular kernel name, so kernels from all images (from all tests) can
be used and must be functional.
@againull againull merged commit 085d07e into intel:sycl Apr 14, 2025
25 checks passed
@againull againull deleted the replace_with_unit_test branch September 29, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants