Skip to main content

Crate fuel_cpu_backend

Crate fuel_cpu_backend 

Source
Expand description

CPU backend computation kernels for fuel.

This crate contains the core CPU computation helpers (MatMul, pooling, convolution, reductions, etc.) extracted from fuel-core so they can be reused and tested independently. It also re-exports the MKL and Accelerate FFI bindings when the corresponding features are enabled.

Re-exports§

pub use byte_storage::CPU_ALIGN_BYTES;
pub use byte_storage::CpuStorageBytes;
pub use dyn_impl::CpuStorage;
pub use quantized::CpuQStorage;
pub use ops::*;
pub use utils::*;

Modules§

byte_kernels
Typed byte-shaped kernels — Phase 7.5 B5. These operate on CpuStorageBytes directly via bytemuck typed views. The dispatch wrapper in fuel_dispatch::dispatch::cpu_wrappers extracts CpuStorageBytes from BackendStorage::Cpu(...) and calls these kernels. Typed byte-shaped kernels — Phase 7.5 B5.
byte_storage
Phase 7.5 storage-unification target: byte-shaped CPU storage with Arc<AlignedBytes> backing, 64-byte alignment, and CoW mutation. Coexists with the legacy CpuStorage (HostBuffer-based) during op-kernel migration; legacy retires when the last kernel migrates. Byte-shaped CPU storage — Phase 7.5 storage-unification target.
chassis
Trait-chassis surface shared by elementwise + reduction CPU kernels. One shape/loop pass per kernel family; op-specific math lives in tiny trait impls. See chassis::reduction. Trait-chassis surface for CPU kernels.
conv2d
dyn_impl
DynBackendStorage and DynBackendDevice implementations for the CPU backend.
host_storage
Alternative HostStorage impls beyond the default owned crate::dyn_impl::CpuBackendStorage(crate::dyn_impl:: CpuBackendStorage).
ops
CPU backend operation helper structs and functions.
probe
Device enumeration for the default CPU backend.
quantized
CPU-side quantized storage adapter — bridges Box<dyn QuantizedType> (per-block-format scalar ops from fuel-quantized) to the backend-agnostic DynQuantizedStorage trait that fuel-core dispatches against.
system_memory
OS-level system RAM queries for the CPU backend’s fuel_backend_contract::backend::BackendRuntime impl.
utils