-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Deprecate fallback assertions #18310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
[SYCL] Deprecate fallback assertions #18310
Conversation
This commit deprecates (and removes under preview flag) the fallback assertion implementation for SYCL kernels. The expected behavior after this is that backends that do not support native asserts, as reported through the ext_oneapi_native_assert aspect, will ignore assertions in kernel code. Signed-off-by: Larsen, Steffen <[email protected]>
I believe these two tests also rely on the fallback asserts:
Or at least they used to, I'm not sure the current checks represent that intent, and they never had the macros defined. But you can see the comment for the cuda/hip unsupported. And fallback is really the only case that would make sense to test for discard events with assert since it adds extra commands that might add/use events. I've been meaning to dig further into them to re-enable them for CUDA and HIP, but if we're dropping fallback we might be able to just delete these eventually. |
What is our plan for the assert feature once the environment variable is removed? Will Or, will |
Signed-off-by: Larsen, Steffen <[email protected]>
We'd ultimately like to get rid of DiscardEvents too... |
Signed-off-by: Larsen, Steffen <[email protected]>
This seems like the safest solution to me, as it means users can still run their kernels on devices where they would run before, even if we can't do the asserts in there for them. I've updated the extension. |
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
It appears that L0 assertions don't print and abort at synchronization points, but instead does so at the end of the application. This has been reported internally. |
This seems like it could be a serious bug. What happens if the application crashes and terminates abnormally? Does Level Zero print the assertion even when the application terminates abnormally like this? What if the application hangs, and the user terminates it via CTRL-C? I would expect many failed assertion checks to result in either a crash or a hung application. If the assertion is not printed in either of these cases, it seems pretty limited. |
I absolutely agree. Even if there is some guarantee that it is printed by the end of the program, if the user cannot rely on it failing at the point of synchronization, it can be hard to track failures and users may want to rely on the abort happening before they continue on with the following tasks. |
Hi, @steffenlarsen |
Thank you, @jinge90 ! This patch should not change the behavior without the preview flag being set. Can we integrate your changes in the same way? |
Hi, @steffenlarsen |
If it isn't too much work, I don't mind doing it as part of this, though alternatively we can do it in a separate patch and just let the patch sit there until the breaking window opens. That way we won't need to make some preview work-around for now. |
Hi, @steffenlarsen |
Hi, @steffenlarsen |
@@ -371,9 +377,15 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> { | |||
std::enable_if_t<std::is_invocable_r_v<void, T, handler &>, event> submit( | |||
T CGF, | |||
const detail::code_location &CodeLoc = detail::code_location::current()) { | |||
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: For if/else
cases it's more readable to use #ifdef <preview>/#else/#endif
, IMO.
This commit deprecates (and removes under preview flag) the fallback assertion implementation for SYCL kernels. The expected behavior after this is that backends that do not support native asserts, as reported through the ext_oneapi_native_assert aspect, will ignore assertions in kernel code.
This commit also makes the L0 adapter report support for native assert, as it was incorrectly reporting false before.