Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7276d95
[SYCL] Deprecate fallback assertions
steffenlarsen May 5, 2025
63d1354
Change extension mention of non-native path
steffenlarsen May 5, 2025
4b60f39
Fix support in L0
steffenlarsen May 5, 2025
f3448cf
Fix warnings
steffenlarsen May 5, 2025
f81a6cc
Remove safe implementation mention
steffenlarsen May 6, 2025
ba2c467
Inline post-processing
steffenlarsen May 6, 2025
3273daa
Flip conditional
steffenlarsen May 13, 2025
b8d028c
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen May 13, 2025
76e7387
Fix after merge
steffenlarsen May 13, 2025
4c71a40
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen May 23, 2025
b8b616b
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen May 23, 2025
6d14b71
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Jun 10, 2025
fb63485
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Aug 11, 2025
e1eec5f
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Aug 11, 2025
e690e43
Fix unittest cmake
steffenlarsen Aug 11, 2025
bab0ad3
Make warning disabling target specific
steffenlarsen Aug 11, 2025
47cf1bb
Mask out Signatures
steffenlarsen Aug 11, 2025
3a0ee98
Disable service kernel ID test
steffenlarsen Aug 13, 2025
270c75d
Fix unittests
steffenlarsen Aug 13, 2025
4e76e95
Remove fallback asserts
steffenlarsen Aug 13, 2025
2addd68
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Aug 13, 2025
8cc1567
Fix formatting
steffenlarsen Aug 14, 2025
ee0707b
Remove fallback macro in tests and disable known failing L0 cases
steffenlarsen Aug 14, 2025
1f0df57
Missed test
steffenlarsen Aug 14, 2025
bae0683
Reintroduce symbols
steffenlarsen Aug 15, 2025
87119d3
Fix formatting
steffenlarsen Aug 15, 2025
5388760
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Aug 18, 2025
c1a80b4
Exclude compatibility test for now
steffenlarsen Aug 18, 2025
38e03a2
Disable non-native test for OCL GPU
steffenlarsen Aug 18, 2025
b27aedd
Apply suggestions from code review
steffenlarsen Aug 18, 2025
18c8076
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Sep 2, 2025
ebdc467
Merge remote-tracking branch 'intel/sycl' into steffen/deprecate_fall…
steffenlarsen Sep 4, 2025
a619c8f
Remove fallback preview flag in test
steffenlarsen Sep 4, 2025
1684e3f
Reorder operations for cleanliness
steffenlarsen Sep 4, 2025
5aa78ae
Update sycl/test-e2e/Assert/assert_in_kernels_non_native.cpp
steffenlarsen Sep 5, 2025
2b143af
Fix formatting
steffenlarsen Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions devops/compat_ci_exclude.sycl-rel-6_2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ KernelCompiler/opencl.cpp
KernelCompiler/opencl_cache_eviction.cpp
KernelCompiler/opencl_queries.cpp

# https://github.com/intel/llvm/pull/18310 removed fallback assertions, but due
# to a bug in the L0 drivers, one test causes the implementation to continue
# after assertions are triggered. We allow this regression while the drivers bug
# gets addressed.
# See GSD-11097.
Assert/assert_in_kernels.cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xtian-github & @gmlueck & @jbrodman - Are you okay with this (hopefully temporary) backwards compatibility issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so. It seems like the driver bug is not new. It what scenario is there a loss of functionality compared to the current state of affairs? Is there only a loss of functionality in the follow situation:

  • The user compiles with -DSYCL_FALLBACK_ASSERT and also runs on a device that has native assertion support.

In the old implementation, this would work because we use the (slow) fallback approach and bypass the (broken) native support? In the new implementation, the -D flag has no effect, so the application uses the native support, which hits this bug?

If that's the only compatibility break, I think it's OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be it indeed, with the caveat that the L0 adapter didn't report support for native assertions previous, despite actually supporting them.


# Likely OK, but need author to provide justification, get approval/confirmation
# from someone:

Expand Down
7 changes: 7 additions & 0 deletions devops/compat_ci_exclude.sycl-rel-6_3
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Matrix/joint_matrix_bf16_fill_k_cache_arg_dim.cpp
Matrix/joint_matrix_bf16_fill_k_cache_runtime_dim.cpp

# https://github.com/intel/llvm/pull/18310 removed fallback assertions, but due
# to a bug in the L0 drivers, one test causes the implementation to continue
# after assertions are triggered. We allow this regression while the drivers bug
# gets addressed.
# See GSD-11097.
Assert/assert_in_kernels.cpp

# Likely OK, but need author to provide justification, get approval/confirmation
# from someone:

Expand Down
14 changes: 0 additions & 14 deletions sycl/doc/PreprocessorMacros.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@ This file describes macros that have effect on SYCL compiler and run-time.
Disable warning diagnostic issued when including `<sycl/sycl.hpp>` without
`-fsycl` compiler flag.

- **SYCL_FALLBACK_ASSERT**

Defining as non-zero enables the fallback assert feature even on devices
without native support. Be aware that this will add some overhead that is
associated with submitting kernels that call `assert()`. When this macro is
defined as 0 or is not defined, the logic for detecting assertion failures in kernels is
disabled, so a failed assert will not cause a message to be printed and will
not cause the program to abort. Some devices have native support for
assertions. The logic for detecting assertion failures is always enabled on
these devices regardless of whether this macro is defined because that logic
does not add any extra overhead. One can check to see if a device has native
support for `assert()` via `aspect::ext_oneapi_native_assert`.
This macro is undefined by default.

- **SYCL2020_CONFORMANT_APIS (deprecated)**
This macro is used to comply with the SYCL 2020 specification, as some of the current
implementations may be widespread and not conform to it.
Expand Down
2 changes: 2 additions & 0 deletions sycl/doc/design/Assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ The following sequence of events describes how user code gets notified:

## Fallback approach

**The fallback approach has been deprecated and will be removed in the future.**

If Device-side Runtime doesn't support `__devicelib_assert_fail` (as reported
via "cl_intel_devicelib_assert" extension query) then a fallback approach comes
in place. The approach doesn't require any support from Device-side Runtime and
Expand Down
22 changes: 7 additions & 15 deletions sycl/doc/extensions/supported/sycl_ext_oneapi_assert.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,11 @@ and `+__LINE__+`, and the value of the standard variable `+__func__+`. If the
failing assert comes from an `nd_range` `parallel_for` it will also include the
global ID and the local ID of the failing work item.

Some devices implement `assert()` natively while others use a fallback
implementation, and the two implementations provide different guarantees. The
native implementation is most similar to the way `assert()` works on the host. If
an assertion fails in the native implementation, the assertion message is
immediately printed to stderr and the program terminates by calling
`std::abort()`. If an assertion fails with the fallback implementation, the
failing assert() returns back to its caller and the device code must continue
executing (without deadlocking) until the kernel completes. The implementation
prints the assertion message to stderr and terminates with `std::abort()` only
after the kernel completes execution. An application can determine which of the
two mechanisms a device uses by testing the device aspect
`aspect::ext_oneapi_native_assert`.
Only some devices support `assert()` natively, as determinable by querying the
new `aspect::ext_oneapi_native_assert` aspect. If an assertion fails in devices
that support these natively, the assertion message is immediately printed to
stderr and the program terminates by calling `std::abort()`. Failures in calls
to `assert()` on devices that do not natively support it are ignored.

The `assert()` macro is defined in system include headers, not in SYCL headers.
On most of systems it is `<cassert>` and/or `<assert.h>` header files.
Expand Down Expand Up @@ -137,9 +130,8 @@ enum class aspect {
----

If device has the `ext_oneapi_native_assert` aspect, then its Device-Side
Runtime is capable of native support of `assert`. That is, safe implementation
is used. If device doesn't have the aspect, then fallback implementation is
used.
Runtime is capable of native support of `assert`. If device doesn't have the
aspect, then assertions on the device will be silently ignored.

== Version

Expand Down
42 changes: 0 additions & 42 deletions sycl/include/sycl/detail/assert_happened.hpp

This file was deleted.

9 changes: 4 additions & 5 deletions sycl/include/sycl/detail/defines_elementary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@
static_assert(__cplusplus >= 201703L,
"DPCPP does not support C++ version earlier than C++17.");

// Helper macro to identify if fallback assert is needed
#if defined(SYCL_FALLBACK_ASSERT)
#define __SYCL_USE_FALLBACK_ASSERT SYCL_FALLBACK_ASSERT
#else
#define __SYCL_USE_FALLBACK_ASSERT 0
// MSVC doesn't support #warning and we cannot use other methods to report a
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a tracker to remove this warning in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! CMPLRLLVM-70220

// warning from inside a system header (which SYCL is considered to be).
#if defined(SYCL_FALLBACK_ASSERT) && (!defined(_MSC_VER) || defined(__clang__))
#warning "SYCL_FALLBACK_ASSERT has been removed and no longer has any effect."
#endif

#if defined(_WIN32) && !defined(_DLL) && !defined(__SYCL_DEVICE_ONLY__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,14 @@ template <typename LCRangeT, typename LCPropertiesT> struct LaunchConfigAccess {
template <typename CommandGroupFunc, typename PropertiesT>
void submit_impl(const queue &Q, PropertiesT Props, CommandGroupFunc &&CGF,
const sycl::detail::code_location &CodeLoc) {
Q.submit_without_event<__SYCL_USE_FALLBACK_ASSERT>(
Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
Q.submit_without_event(Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
}

template <typename CommandGroupFunc, typename PropertiesT>
event submit_with_event_impl(const queue &Q, PropertiesT Props,
CommandGroupFunc &&CGF,
const sycl::detail::code_location &CodeLoc) {
return Q.submit_with_event<__SYCL_USE_FALLBACK_ASSERT>(
Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
return Q.submit_with_event(Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
}
} // namespace detail

Expand Down
Loading