Expand description
ferrox-cuda: hardware capability detection (always compiled, always tested) plus an optional, feature-gated CUDA execution path.
Build without any GPU support (the default): cargo build -p ferrox-cuda.
Build with the CUDA scaffolding included: cargo build -p ferrox-cuda --features cuda.
The cuda feature compiles cleanly in this development sandbox
(which has neither a CUDA toolkit nor a GPU) because cudarc is
configured for dynamic loading – the driver and NVRTC libraries
are dlopen’d at runtime, not linked at build time. That means
“this crate compiles with --features cuda” is a true, checked
fact. It does not mean the CUDA kernels in gpu.rs have ever
executed successfully; see that module’s docs for exactly what has
and has not been verified.
Re-exports§
pub use capability::HardwareProfile;pub use capability::SimdCaps;
Modules§
- capability
- Runtime hardware capability detection: probe once, report a plain
struct, and let every performance-relevant decision (thread pool
width, SIMD kernel selection, GPU residency) derive from the
detected machine rather than being hardcoded. Ferrox
today only has a CPU execution path, so
HardwareProfile::detect()is honest about that: the CUDA fields are always populated (zero / false / None) unless built with--features cuda, and even then they report exactly whatferrox-cuda’s device probe finds, no more. - coalesced_
twin - Scalar twin of the coalesced Q4_K matvec kernel.
- matvec_
kinds - The per-kind CUDA matvec (decode) kernel table. Always compiled,
for the same reason
mul_mmis: it is kernel text plus three strings per row, andferrox-corederives its CUDA decode capability from it on builds that do not linkcudarc. The per-quant-kind matvec table: which formats CUDA can DECODE, and the three strings a launch needs for each. - mul_mm
- The
mul_mmkernel source and its per-quant-kind dispatch table. Always compiled: it is CUDA C text plus a scalar twin, neither of which needscudarc, so the defaultcargo test -p ferrox-cudarun on a GPU-less host still exercises the arithmetic the kernel encodes. Only the launch path ([mul_mm_launch]) is feature-gated.mul_mm: a batched quantized GEMM for CUDA – the CUDA C source and the per-quant-kind dispatch table. - mul_
mm_ kinds - One module per quant-format family, holding the
mul_mm::KINDSrows. Split out ofmul_mm.rsso that adding a format is a new file rather than a new section of a file nobody wants to open. The per-quant-kind rows of the CUDAmul_mmdispatch table, one module per format family. - mul_
mm_ ref - The scalar twin of the CUDA
mul_mmkernel: the same GEMM, executed on the host, one emulated threadblock at a time.