Errors
All custom exceptions in this repository inherit from TritonKernelError.
Hierarchy
TritonKernelError
├── ShapeMismatchError
├── UnsupportedDtypeError
├── NumericalOverflowError
├── TuningFailedError
└── DeviceError
ShapeMismatchError
Attached attributes may include:
expectedactualtensor_name
Typical use: incompatible tensor dimensions for kernel inputs.
UnsupportedDtypeError
Attached attributes may include:
dtypesupported_dtypestensor_name
Typical use: integer tensor passed into a floating-only kernel path.
NumericalOverflowError
Attached attributes may include:
max_valuescaleattempts
Typical use: FP8 quantization still overflows after repeated scale reduction.
TuningFailedError
Attached attributes may include:
problem_sizeconfigs_triedlast_error
Typical use: every candidate configuration fails during autotuning.
DeviceError
Attached attributes may include:
expected_deviceactual_devicetensor_name
Typical use: calling a Triton kernel path with CPU tensors or mixed-device inputs.
Catching patterns
from triton_ops import fused_rmsnorm_rope
from triton_ops import DeviceError, ShapeMismatchError, UnsupportedDtypeError
try:
y = fused_rmsnorm_rope(x, weight, cos, sin)
except DeviceError as exc:
print(exc.expected_device, exc.actual_device)
except ShapeMismatchError as exc:
print(exc.tensor_name, exc.expected, exc.actual)
except UnsupportedDtypeError as exc:
print(exc.tensor_name, exc.dtype)