pub struct Cuda;Expand description
The CUDA backend (ferrox-cuda).
Trait Implementations§
Source§impl BackendCaps for Cuda
impl BackendCaps for Cuda
Source§const GEMM_FALLBACK: &'static str = "CUDA per-position matvec"
const GEMM_FALLBACK: &'static str = "CUDA per-position matvec"
apply_batch_with_acts decomposes a CUDA prefill into one
matvec per position for every kind off Cuda::gemm_supported.
Source§fn matvec_kernel(kind: QuantKind) -> Option<&'static str>
fn matvec_kernel(kind: QuantKind) -> Option<&'static str>
The decode path, and the arm that has actually run on a GPU.
Wider than Cuda::gemm_supported. The name is returned only to
share BackendCaps::matvec_kernel’s shape with Metal; nothing
on the CUDA path reads it, because ferrox-cuda’s launchers are
named functions rather than entries in a string-keyed table.
Source§fn gemm_supported(kind: QuantKind) -> bool
fn gemm_supported(kind: QuantKind) -> bool
The mul_mm prefill path.
Deliberately narrower than Cuda::matvec_kernel: ferrox-cuda
had no matrix-matrix product at all until Q8_0 and Q4_0 landed,
so every other kind still decomposes a prefill into per-position
matvecs.
Stated here rather than delegating to
ferrox_cuda::mul_mm::kind_by_name, because ferrox-cuda is
only a dependency under the cuda feature and this predicate is
compiled unconditionally (the capability report reads it on every
build).
Two tables that must agree about one set is the failure this
codebase keeps paying for, so the agreement is a TEST rather than
a hope: the_cuda_gemm_kinds_match_the_kernel_table runs under
--features cuda and compares this against kind_by_name for
every QuantKind.
UNRUN ON HARDWARE. The kernel is checked against a scalar
twin and by executing the emitted CUDA C on the host, and has
never executed on a GPU. See crates/ferrox-cuda/src/mul_mm.rs.
Source§const ID: Backend = Backend::Cuda
const ID: Backend = Backend::Cuda
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 Cuda
impl RefUnwindSafe for Cuda
impl Send for Cuda
impl Sync for Cuda
impl Unpin for Cuda
impl UnsafeUnpin for Cuda
impl UnwindSafe for Cuda
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