ferrox_cuda/lib.rs
1//! ferrox-cuda: hardware capability detection (always compiled, always
2//! tested) plus an optional, feature-gated CUDA execution path.
3//!
4//! Build without any GPU support (the default): `cargo build -p ferrox-cuda`.
5//! Build with the CUDA scaffolding included: `cargo build -p ferrox-cuda --features cuda`.
6//!
7//! The `cuda` feature compiles cleanly in this development sandbox
8//! (which has neither a CUDA toolkit nor a GPU) because `cudarc` is
9//! configured for dynamic loading -- the driver and NVRTC libraries
10//! are `dlopen`'d at runtime, not linked at build time. That means
11//! "this crate compiles with `--features cuda`" is a true, checked
12//! fact. It does **not** mean the CUDA kernels in `gpu.rs` have ever
13//! executed successfully; see that module's docs for exactly what has
14//! and has not been verified.
15
16pub mod capability;
17pub mod coalesced_twin;
18
19/// The per-kind CUDA matvec (decode) kernel table. Always compiled,
20/// for the same reason [`mul_mm`] is: it is kernel text plus three
21/// strings per row, and `ferrox-core` derives its CUDA decode
22/// capability from it on builds that do not link `cudarc`.
23pub mod matvec_kinds;
24
25/// The `mul_mm` kernel source and its per-quant-kind dispatch table.
26/// Always compiled: it is CUDA C *text* plus a scalar twin, neither of
27/// which needs `cudarc`, so the default `cargo test -p ferrox-cuda` run
28/// on a GPU-less host still exercises the arithmetic the kernel encodes.
29/// Only the launch path ([`mul_mm_launch`]) is feature-gated.
30pub mod mul_mm;
31/// One module per quant-format family, holding the [`mul_mm::KINDS`]
32/// rows. Split out of `mul_mm.rs` so that adding a format is a new file
33/// rather than a new section of a file nobody wants to open.
34pub mod mul_mm_kinds;
35pub mod mul_mm_ref;
36
37#[cfg(feature = "cuda")]
38pub mod attn;
39#[cfg(feature = "cuda")]
40pub mod gpu;
41#[cfg(feature = "cuda")]
42pub mod graph;
43#[cfg(feature = "cuda")]
44pub mod mul_mm_launch;
45
46pub use capability::{HardwareProfile, SimdCaps};