pub enum BackendPlan {
Cpu,
Metal,
MetalCpuSplit {
gpu_layers: usize,
total_layers: usize,
},
Cuda,
}Expand description
The backend(s) to use for a given model.
Variants§
Cpu
Run everything on the CPU using NEON/AVX2 kernels.
Metal
Run everything on the Metal GPU via MLX (Apple Silicon only).
MetalCpuSplit
Run the first gpu_layers transformer layers on Metal, the rest on CPU.
Only used when the model doesn’t fit entirely in the Metal memory budget.
Cuda
CUDA backend (future — not yet implemented).
Implementations§
Source§impl BackendPlan
impl BackendPlan
Sourcepub fn estimated_tps(&self, model_bytes: u64, profile: &DeviceProfile) -> f64
pub fn estimated_tps(&self, model_bytes: u64, profile: &DeviceProfile) -> f64
Rough tok/s estimate for a model with model_bytes weights.
Trait Implementations§
Source§impl Clone for BackendPlan
impl Clone for BackendPlan
Source§fn clone(&self) -> BackendPlan
fn clone(&self) -> BackendPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BackendPlan
impl RefUnwindSafe for BackendPlan
impl Send for BackendPlan
impl Sync for BackendPlan
impl Unpin for BackendPlan
impl UnsafeUnpin for BackendPlan
impl UnwindSafe for BackendPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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