Expand description
Hardware-agnostic compute driver trait.
The Driver trait exposes low-level compute primitives (GEMM, layer-norm,
activations, etc.) that each hardware backend implements. Model architectures
are generic over D: Driver and compose these primitives into a forward pass.
§Design
- Associated type
Tensor: each driver defines its own opaque tensor handle (Metal: buffer+offset, CUDA: device pointer, CPU: ndarray). - Not object-safe: architectures use
D: Drivergenerics so the compiler can monomorphize and inline driver calls. - Send + Sync: drivers are shared across the pipeline.
Structs§
- Batch
Inputs - Batch input tensors on device, produced by
Driver::prepare_batch.
Traits§
- Driver
- Hardware-agnostic compute primitives for BERT inference.