Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 56 variants UnexpectedDType { msg: &'static str, expected: DType, got: DType, }, DTypeMismatchBinaryOp { lhs: DType, rhs: DType, op: &'static str, }, UnsupportedDTypeForOp(DType, &'static str), NoZeroScalar(DType), NoOneScalar(DType), ScalarUnrepresentable(DType, f64), PackedElementHasNoScalar(DType), DimOutOfRange { shape: Box<Shape>, dim: i32, op: &'static str, }, DuplicateDimIndex { shape: Box<Shape>, dims: Vec<usize>, op: &'static str, }, UnexpectedNumberOfDims { expected: usize, got: usize, shape: Box<Shape>, }, UnexpectedShape { msg: String, expected: Box<Shape>, got: Box<Shape>, }, ShapeMismatch { buffer_size: usize, shape: Box<Shape>, }, ShapeMismatchBinaryOp { lhs: Box<Shape>, rhs: Box<Shape>, op: &'static str, }, ShapeMismatchCat { dim: usize, first_shape: Box<Shape>, n: usize, nth_shape: Box<Shape>, }, ShapeMismatchSplit { shape: Box<Shape>, dim: usize, n_parts: usize, }, OnlySingleDimension { op: &'static str, dims: Vec<usize>, }, EmptyTensor { op: &'static str, }, DeviceMismatchBinaryOp { lhs: DeviceLocation, rhs: DeviceLocation, op: &'static str, }, NarrowInvalidArgs { shape: Box<Shape>, dim: usize, start: usize, len: usize, msg: &'static str, }, Conv1dInvalidArgs { inp_shape: Box<Shape>, k_shape: Box<Shape>, padding: usize, stride: usize, msg: &'static str, }, InvalidIndex { op: &'static str, index: usize, size: usize, }, BroadcastIncompatibleShapes { src_shape: Box<Shape>, dst_shape: Box<Shape>, }, CannotSetVar { msg: &'static str, }, MatMulUnexpectedStriding(Box<MatMulUnexpectedStriding>), RequiresContiguous { op: &'static str, }, OpRequiresAtLeastOneTensor { op: &'static str, }, OpRequiresAtLeastTwoTensors { op: &'static str, }, BackwardNotSupported { op: &'static str, }, NoBackendForOp { op: OpKind, dtypes: Vec<DType>, available_backends: Vec<BackendId>, supported_combinations: Vec<(BackendId, OpKind, Vec<DType>)>, }, UnsupportedTransfer { from: DeviceLocation, to: DeviceLocation, available_paths: Vec<TransferPath>, }, AlignmentMismatch { backend: BackendId, required: usize, actual: usize, }, TopologyChanged { plan_generation: u64, current_generation: u64, }, NotCompiledWithCudaSupport, NotCompiledWithMetalSupport, NotCompiledWithVulkanSupport, CannotFindTensor { path: String, }, Cuda(Box<dyn Error + Send + Sync>), Metal(Box<dyn Error + Send + Sync>), Vulkan(Box<dyn Error + Send + Sync>), TryFromIntError(TryFromIntError), Npy(String), Zip(ZipError), ParseInt(ParseIntError), FromUtf8(FromUtf8Error), Io(Error), SafeTensor(SafeTensorError), UnsupportedSafeTensorDtype(Dtype), Wrapped(Box<dyn Display + Send + Sync>), WrappedContext { wrapped: Box<dyn Error + Send + Sync>, context: String, }, Context { inner: Box<Error>, context: Box<dyn Display + Send + Sync>, }, WithPath { inner: Box<Error>, path: PathBuf, }, WithBacktrace { inner: Box<Error>, backtrace: Box<Backtrace>, }, Msg(String), UnwrapNone, FilterRejected { filter: &'static str, ctx_summary: String, available_alternatives: usize, }, InvalidBranch { reason: String, },
}
Expand description

The main error type for the fuel library.

Variants§

§

UnexpectedDType

Fields

§msg: &'static str
§expected: DType
§got: DType
§

DTypeMismatchBinaryOp

Fields

§lhs: DType
§rhs: DType
§op: &'static str
§

UnsupportedDTypeForOp(DType, &'static str)

§

NoZeroScalar(DType)

§

NoOneScalar(DType)

§

ScalarUnrepresentable(DType, f64)

§

PackedElementHasNoScalar(DType)

§

DimOutOfRange

Fields

§shape: Box<Shape>
§dim: i32
§op: &'static str
§

DuplicateDimIndex

Fields

§shape: Box<Shape>
§dims: Vec<usize>
§op: &'static str
§

UnexpectedNumberOfDims

Fields

§expected: usize
§got: usize
§shape: Box<Shape>
§

UnexpectedShape

Fields

§expected: Box<Shape>
§got: Box<Shape>
§

ShapeMismatch

Fields

§buffer_size: usize
§shape: Box<Shape>
§

ShapeMismatchBinaryOp

Fields

§lhs: Box<Shape>
§rhs: Box<Shape>
§op: &'static str
§

ShapeMismatchCat

Fields

§dim: usize
§first_shape: Box<Shape>
§nth_shape: Box<Shape>
§

ShapeMismatchSplit

Fields

§shape: Box<Shape>
§dim: usize
§n_parts: usize
§

OnlySingleDimension

Fields

§op: &'static str
§dims: Vec<usize>
§

EmptyTensor

Fields

§op: &'static str
§

DeviceMismatchBinaryOp

Fields

§op: &'static str
§

NarrowInvalidArgs

Fields

§shape: Box<Shape>
§dim: usize
§start: usize
§len: usize
§msg: &'static str
§

Conv1dInvalidArgs

Fields

§inp_shape: Box<Shape>
§k_shape: Box<Shape>
§padding: usize
§stride: usize
§msg: &'static str
§

InvalidIndex

Fields

§op: &'static str
§index: usize
§size: usize
§

BroadcastIncompatibleShapes

Fields

§src_shape: Box<Shape>
§dst_shape: Box<Shape>
§

CannotSetVar

Fields

§msg: &'static str
§

MatMulUnexpectedStriding(Box<MatMulUnexpectedStriding>)

§

RequiresContiguous

Fields

§op: &'static str
§

OpRequiresAtLeastOneTensor

Fields

§op: &'static str
§

OpRequiresAtLeastTwoTensors

Fields

§op: &'static str
§

BackwardNotSupported

Fields

§op: &'static str
§

NoBackendForOp

No registered backend supports (op, dtypes) for the given input residency. Fires at DAG construction (planning time), not at execution.

dtypes is the per-operand dtype list (inputs in order, then outputs) used as the binding-table lookup key. For uniform- precision ops the list contains a single repeated dtype; for mixed-precision ops (e.g. Cast: src→dst) the list distinguishes the operands.

Fields

§dtypes: Vec<DType>
§available_backends: Vec<BackendId>
§supported_combinations: Vec<(BackendId, OpKind, Vec<DType>)>
§

UnsupportedTransfer

No transfer path connects from and to directly, and host-staging fallback isn’t available either (e.g. neither device can copy_to_host). Fires at DAG construction.

Fields

§available_paths: Vec<TransferPath>
§

AlignmentMismatch

Source storage’s alignment doesn’t meet the destination backend’s required alignment, and Router has no way to repack on this path. Fires at DAG construction.

Fields

§backend: BackendId
§required: usize
§actual: usize
§

TopologyChanged

The ExecutionPlan consumed by the executor was built against an older SystemTopology generation than the one observable at dispatch time — backends were added, removed, or had their capabilities re-probed since the plan was committed. Caught at dispatch-chunk boundaries by Phase 4.3 of the picker-work arc; the realize layer catches this and rebuilds the plan against the fresh topology.

plan_generation is the counter the plan was stamped with at compile_plan time. current_generation is the value fuel_dispatch::dispatch::topology_generation() observed when the executor crossed the chunk boundary.

Fields

§plan_generation: u64
§current_generation: u64
§

NotCompiledWithCudaSupport

§

NotCompiledWithMetalSupport

§

NotCompiledWithVulkanSupport

§

CannotFindTensor

Fields

§path: String
§

Cuda(Box<dyn Error + Send + Sync>)

§

Metal(Box<dyn Error + Send + Sync>)

§

Vulkan(Box<dyn Error + Send + Sync>)

§

TryFromIntError(TryFromIntError)

§

Npy(String)

§

Zip(ZipError)

Zip file format error.

§

ParseInt(ParseIntError)

Integer parse error.

§

FromUtf8(FromUtf8Error)

Utf8 parse error.

§

Io(Error)

I/O error.

§

SafeTensor(SafeTensorError)

SafeTensor error.

§

UnsupportedSafeTensorDtype(Dtype)

§

Wrapped(Box<dyn Display + Send + Sync>)

Arbitrary errors wrapping.

§

WrappedContext

Arbitrary errors wrapping with context.

Fields

§wrapped: Box<dyn Error + Send + Sync>
§context: String
§

Context

Fields

§inner: Box<Error>
§context: Box<dyn Display + Send + Sync>
§

WithPath

Adding path information to an error.

Fields

§inner: Box<Error>
§path: PathBuf
§

WithBacktrace

Fields

§inner: Box<Error>
§backtrace: Box<Backtrace>
§

Msg(String)

User generated error message, typically created via bail!.

§

UnwrapNone

§

FilterRejected

A hard filter in the optimizer ranker’s filter chain rejected every candidate at this decision point. Phase 1.1 of the picker-work arc. The user asked for something the binding-table can’t deliver — typically a precision floor or tolerance budget no registered kernel meets — and the ranker surfaces it rather than silently substituting a non-admissible alternative.

Soft filters (caps preferences, empirical refinements) never raise this error; only filters classified FilterClass::Hard fail loudly when they would leave the candidate set empty.

Fields

§filter: &'static str

Name of the filter that triggered the rejection.

§ctx_summary: String

Short diagnostic summary of the decision point’s context (op kind, dtypes, device).

§available_alternatives: usize

How many candidates entered the filter (zero on the way in is also possible — the candidate enumerator may have produced an empty set).

§

InvalidBranch

Build-time rejection from the Op::Branch builders (Graph::open_branch / BranchBuilder::add_arm / BranchBuilder::finalize_branches). Phase A PR-A1 of the “plan IS the graph” rebuild. The multi-path structure is an arena fact validated at graph-build time — never a realize-time panic — so an ill-formed branch (a reconverge_at that is not a descendant of the diverge point, arms that are not internally disjoint, arm exits that disagree on shape/dtype at reconverge) surfaces here with a human-readable reason rather than corrupting the arena.

Fields

§reason: String

Why the branch was rejected — names the violated invariant and the offending node ids for localization.

Implementations§

Source§

impl Error

Source

pub fn wrap(err: impl Display + Send + Sync + 'static) -> Error

Wraps an arbitrary displayable error.

Source

pub fn msg(err: impl Display) -> Error

Creates an error message from any displayable value.

Source

pub fn debug(err: impl Debug) -> Error

Creates an error message from the debug representation of a value.

Source

pub fn cuda(err: impl Error + Send + Sync + 'static) -> Error

Wraps a CUDA backend error.

Source

pub fn metal(err: impl Error + Send + Sync + 'static) -> Error

Wraps a Metal backend error.

Source

pub fn vulkan(err: impl Error + Send + Sync + 'static) -> Error

Wraps a Vulkan backend error.

Source

pub fn bt(self) -> Error

Captures a backtrace and attaches it to this error.

Source

pub fn with_path<P>(self, p: P) -> Error
where P: AsRef<Path>,

Attaches a filesystem path to this error for better diagnostics.

Source

pub fn context(self, c: impl Display + Send + Sync + 'static) -> Error

Wraps this error with additional context.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Error

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(source: FromUtf8Error) -> Error

Converts to this type from the input type.
Source§

impl From<Object> for Error

Source§

fn from(value: Object) -> Error

Converts to this type from the input type.
Source§

impl From<ParseIntError> for Error

Source§

fn from(source: ParseIntError) -> Error

Converts to this type from the input type.
Source§

impl From<SafeTensorError> for Error

Source§

fn from(source: SafeTensorError) -> Error

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for Error

Source§

fn from(source: TryFromIntError) -> Error

Converts to this type from the input type.
Source§

impl From<ZipError> for Error

Source§

fn from(source: ZipError) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more