Expand description
Accelerator backends: a trait the model’s linear layers dispatch through, plus a global registry chosen at start-up from the platform detection. Every backend is optional at run time; the CPU kernels remain the reference path and the fallback.
Structs§
- Conv
Geom - Geometry of a k x k convolution with padding k/2 over channels-last input
[h*w, cin], producing[oh*ow, n_out]; the weights are in the unfolded[n_out][ky][kx][cin]layout. - Job
- One matmul of a batch sharing the same input
x:y[t][n_out] = x[t][n_in] * W^T. - Norm
Spec
Enums§
- Norm
Kind - A normalization applied to a convolution’s input as it is loaded (so it runs on the device
without an extra pass):
GroupNorm(groups)over the channels of all pixels, orLayerover each pixel’s (row’s) channels; then* gamma + beta, then SiLU ifsilu. - Weight
Ref - A weight matrix in one of the supported storage formats (
[n_out, n_in]).
Traits§
Functions§
- active
- exact
- See
set_exact. - init
- Picks and initialises a backend for the detected platform and the user’s preference.
- initialized
- Whether a backend choice (possibly “none”) was installed already.
- install
- Installs the backend for this process (call once, before loading models).
- moe_
offload - See
set_moe_offload. - set_
exact - Keeps GPU matmuls bit-identical to the CPU: no reduced-precision matrix units (Metal on
M5/A19 converts inputs to half with f32 accumulation, a KL divergence of 1e-7 to 1e-3 from
the CPU). Process-wide, takes effect on the next dispatch. Default: off, or
OXINFER_METAL_MMA=0. - set_
moe_ offload - Runs MoE expert matmuls on the GPU when the backend can (prefill). Process-wide; affects
models loaded afterwards. Default: on, or
OXINFER_METAL_MOE=0for off.
Type Aliases§
- Device
Weight - Device-side state for one weight matrix (buffers / handles), owned by the layer.