pub enum MlxError {
DeviceNotFound,
CommandBufferError(String),
ShaderCompilationError {
name: String,
message: String,
},
BufferAllocationError {
bytes: usize,
},
InvalidArgument(String),
KernelNotFound(String),
IoError(String),
SafetensorsError(String),
QuantConfigError(String),
UnsupportedDtype(String),
GgufParseError(String),
}Expand description
Unified error type for all Metal GPU operations.
Variants§
DeviceNotFound
No Metal-capable GPU device was found on this system.
CommandBufferError(String)
A Metal command buffer completed with an error status.
ShaderCompilationError
An MSL shader failed to compile.
Fields
BufferAllocationError
Metal buffer allocation failed (usually out of GPU memory).
InvalidArgument(String)
An argument to a public function was invalid.
KernelNotFound(String)
A kernel function was not found in the compiled library.
IoError(String)
An I/O error occurred (e.g. reading a safetensors file).
SafetensorsError(String)
A safetensors file could not be parsed or contains invalid data.
QuantConfigError(String)
A quantization config file could not be parsed.
UnsupportedDtype(String)
An unsupported data type was encountered.
GgufParseError(String)
A GGUF file could not be parsed or contains invalid data.
Implementations§
Source§impl MlxError
Display implementation is handled by thiserror; this is a manual Debug
helper for the shader variant to keep log output readable.
impl MlxError
Display implementation is handled by thiserror; this is a manual Debug
helper for the shader variant to keep log output readable.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if this is a transient error that might succeed on retry
(e.g. a command buffer timeout). Most errors are permanent.
Trait Implementations§
Source§impl Error for MlxError
impl Error for MlxError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()