Expand description
Backend-agnostic quantized (ggml/gguf block-format) numerics.
This crate owns the format-side of fuel’s quantization stack:
k_quants—BlockQXblock types, theGgmlTypetrait, and scalar reference impls of every fmt fuel supports.- [
avx] / [neon] — cfg-gated CPU SIMDvec_dothelpers used byGgmlType::vec_dotimpls ink_quants. They live here (rather than infuel-cpu-backend) because the orphan rule pins them to the crate that definesBlockQX. utils— quantization-time helpers shared by k_quants impls.cpu— CPU-side adapters that bridgeVec<BlockQX>to the backend-agnosticfuel_backend_contract::quantized::DynQuantizedStoragetrait, plus theQuantizedDeviceKernelsimpl onfuel_cpu_backend::CpuBackendDevice.
Per-backend (CUDA, Metal, future Vulkan) quantized fast paths live in
their own crates and implement the same trait pair from
fuel-core-types.
Re-exports§
pub use cpu::QuantizedType;pub use cpu::cpu_from_data;pub use cpu::cpu_zeros;pub use dequant::dequant_ggml_bytes;pub use k_quants::BlockQ2K;pub use k_quants::BlockQ3K;pub use k_quants::BlockQ4_0;pub use k_quants::BlockQ4_1;pub use k_quants::BlockQ4K;pub use k_quants::BlockQ5_0;pub use k_quants::BlockQ5_1;pub use k_quants::BlockQ5K;pub use k_quants::BlockQ6K;pub use k_quants::BlockQ8_0;pub use k_quants::BlockQ8_1;pub use k_quants::BlockQ8K;pub use k_quants::GgmlType;pub use k_quants::K_SCALE_SIZE;pub use k_quants::QK_K;pub use k_quants::QK4_0;pub use k_quants::QK4_1;pub use k_quants::QK5_0;pub use k_quants::QK5_1;pub use k_quants::QK8_0;pub use k_quants::QK8_1;pub use k_quants::blocks_as_bytes;pub use k_quants::blocks_from_bytes_cow;pub use k_quants::matmul;pub use k_quants::matmul_f16;
Modules§
- cpu
- Format-agnostic CPU helpers for quantized storage.
- dequant
- Byte-to-
f32dequantization dispatched onGgmlDType, for callers holding a raw GGUF tensor byte slice and its declared dtype (the common shape at a model-loader’sfrom_ggufsite). - k_
quants - utils
Enums§
- GgmlD
Type - The ggml block-format dtype tag. Mirrors llama.cpp’s
ggml_type@9d57ce456cfor the subset fuel supports (the classic 15 — F32/F16/BF16 plus Q4_0..Q8_1 and Q2K..Q8K; NOT the IQ*/TQ*/MXFP4/NVFP4 families).
Traits§
- DynQuantized
Storage - Object-safe per-backend quantized storage. Each backend (CPU, CUDA,
Metal, …) supplies a concrete type that implements this trait;
fuel-core holds them as
Box<dyn DynQuantizedStorage>and dispatches without naming backends. - Quantized
Device Kernels - Backend device → quantized-kernel constructors. fuel-core looks this up per Device to allocate fresh QStorage of a given dtype, or to load pre-quantized bytes.