Splash for M1 and M2
Upstream Splash needs an M3 or newer. Its kernels use bfloat16, which the M1 has no hardware for, and Apple's MPP matrix library, which reaches about a third of the GPU's peak there. I rewrote those parts to use formats the M1 runs natively.
- 2.1× decode on npanj's five-prompt benchmark, 18.9 to 39.1 tok/s on the same Mac
- 7.4 TFLOPS prefill matmul, up from 2.4 to 3.5 through MPP
- 4-bit weights turned into exact half values with a bit trick, products and sums stay in fp32
- Found a split-K reduction reading through a non-coherent cache that made the fastest decode path print garbage on M1
- Verification kernel unpacks each weight once for all parallel requests: 18 to 65 tok/s with four requests
- 35B-A3B at 144 tok/s, and the Neural Engine prefill from upstream 1.3 works on M1/M2 too