Skip to main content

ferrum_kernels/backend/
mod.rs

1//! Unified Backend trait for CUDA, Metal, and CPU compute.
2//!
3//! Each backend implements the same set of transformer-layer primitives
4//! (GEMM, norms, RoPE, attention, activations). `layer_forward()` and
5//! `ModelRunner` are generic over `Backend`, so one forward path serves
6//! all hardware targets.
7
8mod traits;
9pub use traits::*;
10
11mod types;
12pub use types::*;
13
14mod capabilities;
15mod native_status;
16
17#[cfg(any(feature = "cuda", test))]
18mod reusable_execution;
19
20mod kv_layer;
21pub use kv_layer::*;
22
23pub mod dtype;
24pub use dtype::{Dtype, HostDtype};
25
26pub mod buffer;
27pub use buffer::CpuBuf;
28#[cfg(feature = "cuda")]
29pub use buffer::CudaBuf;
30
31pub mod cpu;
32
33pub mod reference;
34
35#[cfg(feature = "metal")]
36pub mod metal;
37
38#[cfg(feature = "cuda")]
39pub mod cuda;
40
41pub mod timer;