Skip to main content

Cuda

Struct Cuda 

Source
pub struct Cuda;
Expand description

The CUDA backend (ferrox-cuda).

Trait Implementations§

Source§

impl BackendCaps for Cuda

Source§

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>

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

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

How 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.
Source§

const NAME: &'static str = "CUDA"

Human-readable name, for the one message a dispatch failure prints.

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.