KernelExecutionError

KernelExecutionError#

class brainevent.KernelExecutionError#

Raised when a compiled kernel fails during execution at runtime.

This exception wraps runtime errors that occur after a kernel has been successfully compiled and dispatched, such as out-of-bounds memory access, numerical overflow, or device-side assertions. The error message includes information about available alternative backends.

Parameters:

message (str) – A human-readable description of the runtime failure, typically including the backend name, the operation, and suggestions for alternative backends.

See also

KernelCompilationError

Raised when the kernel fails to compile rather than at runtime.

KernelFallbackExhaustedError

Raised when no backends are available at all.

Notes

When this exception is raised, the user may be able to work around the issue by switching to a different backend via the backend= keyword argument in the operation call.

Examples

>>> from brainevent._error import KernelExecutionError
>>> raise KernelExecutionError(
...     "Warp kernel 'csrmv' failed. Try backend='pallas' instead."
... )