pub struct Metal;Expand description
The Metal backend (ferrox-metal).
Trait Implementations§
Source§impl BackendCaps for Metal
impl BackendCaps for Metal
Source§const GEMM_FALLBACK: &'static str = "Metal N x matvec batch"
const GEMM_FALLBACK: &'static str = "Metal N x matvec batch"
apply_gpu_batch re-reads the whole weight matrix once per
position, on the GPU. Still Metal, still the 13.7x shape.
Source§fn matvec_kernel(kind: QuantKind) -> Option<&'static str>
fn matvec_kernel(kind: QuantKind) -> Option<&'static str>
As the kernel name [ferrox_metal::gpu::matvec_launch_meta]
resolves.
This is the single source of truth for that question. It is not
#[cfg(feature = "metal")]-gated deliberately: the table is a
property of the kernel set, and gating it would make it
untestable on the builds that run cargo test --workspace.
Duplicating this list is how IQ4_XS batched prefill silently ran
on the CPU — metal_kind_supported and apply_gpu_batch’s kind
table disagreed by exactly one entry, and the only symptom was a
benchmark row 13.7x behind. Every Metal-kind question now routes
through here.
Source§fn gemm_supported(kind: QuantKind) -> bool
fn gemm_supported(kind: QuantKind) -> bool
The *_mul_mm_sg simdgroup GEMMs.
The invariant that this set equals Metal::matvec_kernel’s is
asserted by a test, so adding a matvec kernel without a GEMM
fails the suite instead of a benchmark.
Source§const ID: Backend = Backend::Metal
const ID: Backend = Backend::Metal
crate::kernel_registry reports this backend. Dispatch and
observability read the same constant, so a backend cannot be
dispatched to under one name and reported under another.Auto Trait Implementations§
impl Freeze for Metal
impl RefUnwindSafe for Metal
impl Send for Metal
impl Sync for Metal
impl Unpin for Metal
impl UnsafeUnpin for Metal
impl UnwindSafe for Metal
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
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> ⓘ
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> ⓘ
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