transformers
be73645e - GGUF: optional Metal dequant fast path via kernels-community/gguf-dequant

Commit
65 days ago
GGUF: optional Metal dequant fast path via kernels-community/gguf-dequant When the `kernels` package is installed and `kernels-community/gguf-dequant` has a build for the current torch/Apple-Silicon combo, route Q4_0 / Q8_0 / Q4_K / Q5_K / Q6_K / IQ4_NL / IQ4_XS dequant on MPS through one Metal compute kernel per tensor — 2.3-7.5× faster than the chained PyTorch path on M3 Max at real-world tensor sizes (apples-to-apples with input already on device). Lazy import on first dequant; opt-out with `TRANSFORMERS_GGUF_USE_METAL_KERNELS=0`. Falls back to the existing pure-torch path for CPU/CUDA, unsupported quant types, or when the Hub doesn't have a build variant for the current env. No behavioural change for any path that doesn't have the package installed.
Author
Parents
Loading