numba_dpex.core.exceptions module
The module defines the custom error classes used in numba_dpex.
- exception numba_dpex.core.exceptions.ExecutionQueueInferenceError(kernel_name, *, usmarray_argnum_list)
Bases:
ExceptionException raised when an execution queue for a given array expression or a kernel function could not be deduced using the compute-follows-data programming model.
Compute-follows-data is a programming model that determines the execution device or queue of an array expression or kernel based on the arrays that are on the right hand side of the expression or are the arguments to the kernel function. The execution queue is deduced based on the device on which the array operands were allocated. Computation is required to occur on the same device where the arrays currently reside.
A ExecutionQueueInferenceError is raised when the execution queue using compute-follows-data rules could not be deduced. It may happen when arrays that have a device attribute such as
dpctl.tensor.usm_ndarrayare mixed with host arrays such asnumpy.ndarray. The error may also be raised if the array operands are allocated on different devices.- Args:
kernel_name : Name of the kernel function for which the error occurred. usmarray_argnum_list: The list of
dpctl.tensor.usm_ndarrayarguments identified by the argument position that caused the error.
- exception numba_dpex.core.exceptions.IllegalRangeValueError(kernel_name)
Bases:
ExceptionException raised when a range used to launch a kernel is not well-formed.
A non-well-formed range value is either empty or is not a list of ints.
- Args:
kernel_name (str): The kernel function name.
- exception numba_dpex.core.exceptions.InvalidKernelLaunchArgsError(kernel_name)
Bases:
ExceptionException raised when a kernel is dispatched with insufficient or incorrect launch arguments.
A global range value is needed to submit a kernel to an execution queue. The global range provides the number of work items that the SYCL runtime should create to execute the kernel. The exception is raised if a kernel is dispatched without specifying a valid global range.
- Args:
kernel_name (str): The kernel function name.
- exception numba_dpex.core.exceptions.InvalidKernelSpecializationError(kernel_name, invalid_sig, unsupported_argnum_list)
Bases:
ExceptionException raised when a the specialization argument types are not supported by the dpex kernel decorator.
The exception is raised whenever an unsupported kernel argument is provided in the specialization signature passed to a dpex kernel decorator instance. For example, dpex kernels require arrays to be of USMNdArray type and no other Array type, such as NumPy ndarray, are supported. If the signature has an non USMNdArray Array type the exception is raised.
- Args:
kernel_name (str): Name of kernel where the error was raised. invalid_sig: Unsupported signature. unsupported_argnum_list : The list of argument numbers that are unsupported.
- exception numba_dpex.core.exceptions.KernelHasReturnValueError(kernel_name, return_type, sig=None)
Bases:
ExceptionException raised when a kernel function is defined with a return statement.
@numba_dpex.kernel does not allow users to return any value. The restriction is inline with the general ABI for device functions in OpenCL, CUDA, and SYCL.
- Args:
kernel_name: Name of the kernel function that caused the error. return_type: Numba type representing the return value specified for the kernel function.
- exception numba_dpex.core.exceptions.MissingSpecializationError(kernel_name, argtypes)
Bases:
Exception- Exception raised when a specialized JitKernel was called with arguments
that do not match any of the specialized versions of the JitKernel.
- Args:
kernel_name (str): Name of kernel where the error was raised. sig: Unsupported argument types used to call a specialized JitKernel.
- exception numba_dpex.core.exceptions.SUAIProtocolError(kernel_name, arg)
Bases:
ExceptionException raised when an array-like object passed to a kernel is neither a NumPy array nor does it implement the __sycl_usm_array_interface__ attribute.
- Args:
kernel_name (str): Name of kernel where the error was raised. arg: Array-like object
- exception numba_dpex.core.exceptions.UncompiledKernelError(kernel_name)
Bases:
ExceptionException raised when an attribute of a KernelInterface object is accessed before the object is compiled.
- Args:
kernel_name (str): Name of kernel where the error was raised.
- exception numba_dpex.core.exceptions.UnknownGlobalRangeError(kernel_name)
Bases:
ExceptionException raised when a kernel is launched without specifying a global range.
- Args:
kernel_name (str): The kernel function name.
- exception numba_dpex.core.exceptions.UnmatchedNumberOfRangeDimsError(kernel_name, global_ndims, local_ndims)
Bases:
ExceptionException raised when the global range and local range have different number of dimensions or rank.
- Args:
kernel_name (str): The kernel function name. global_ndims (int): Rank of the global range. local_ndims (int): Rank of the local range.
- exception numba_dpex.core.exceptions.UnreachableError
Bases:
ExceptionInternal compiler error when an unreachable branch is taken somewhere in the compiler code.
- exception numba_dpex.core.exceptions.UnsupportedBackendError(kernel_name, backend, supported_backends)
Bases:
ExceptionException raised when the target device is not supported by dpex.
Presently only L0 and OpenCL devices are supported by numba_dpex. If the provided execution queue is for any other SYCL platform (e.g., Cuda) then it results in an UnsupportedBackendError.
- Args:
kernel_name (str): Name of kernel where the error was raised. backend (str): name of the unsupported backend. supported_backends (List): The list of supported backends.
- exception numba_dpex.core.exceptions.UnsupportedCompilationModeError
Bases:
Exception
- exception numba_dpex.core.exceptions.UnsupportedGroupWorkItemSizeError(kernel_name, dim, work_groups, work_items)
Bases:
ExceptionException raised when the value in a specific dimension of a global range is not evenly divisible by the value in the corresponding dimension in a local range.
- Args:
kernel_name (str): The kernel function name. dim (int): Dimension where the mismatch was identified. work_groups (int): Number of requested work groups. work_items (int): Number of requested work items in the errant dimension of the local range.
- exception numba_dpex.core.exceptions.UnsupportedKernelArgumentError(type, value, kernel_name='')
Bases:
ExceptionException raised when the type of a kernel argument is not supported by the compiler.
- Args:
type (str): The type of the unsupported argument. value (object): The Python object passed as a kernel argument. kernel_name (str): Name of kernel where the error was raised.
- exception numba_dpex.core.exceptions.UnsupportedNumberOfRangeDimsError(kernel_name, ndims, max_work_item_dims)
Bases:
ExceptionException raised when a range is created for a device that has more number of dimensions than is supported by the device.
- Args:
kernel_name (str): The kernel function name. ndims (int): Rank of the errant range. max_work_item_dims (int): Maximum number of range dimensions supported by the device.
- exception numba_dpex.core.exceptions.UnsupportedParforError(extra_msg=None)
Bases:
ExceptionException raised when a parfor node could not be lowered by Numba-dpex
- exception numba_dpex.core.exceptions.UnsupportedWorkItemSizeError(kernel_name, dim, requested_work_items, supported_work_items)
Bases:
ExceptionException raised when the number of work items requested for a specific dimension exceeds the number supported by the device.
- Args:
kernel_name (str): The kernel function name. requested_work_items (int): Number of requested work items. supported_work_items (int): Supported number of work items.