Commit 01e9368
feat: add accelerate feature + document acceleration matrix
Add `accelerate` feature flag that enables Apple's Accelerate framework
(AMX hardware) for CPU matmul. Benchmark results on M3 Pro:
| Config | tok/s | Notes |
|-------------------------|-------|---------------------------------|
| CPU F16 (no features) | 26.4 | Pure-Rust gemm, best CPU option |
| CPU F32 + accelerate | 23.3 | 2.7x faster F32, but 2x memory |
| CPU F32 (no accelerate) | 8.5 | Baseline F32 |
| Metal | 42.4 | Best overall on Apple Silicon |
Key finding: F16 with pure-Rust gemm beats F32 with Accelerate because
the 2x memory bandwidth savings outweigh BLAS optimization. Apple's
Accelerate has no F16 BLAS (cblas_hgemm) — F16 is only available via
Metal MPS.
Also cleaned up CPU fallback path in Qwen3.5 full attention and added
comprehensive acceleration feature documentation to CLAUDE.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f1787d9 commit 01e9368
3 files changed
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
253 | 251 | | |
254 | 252 | | |
255 | 253 | | |
| |||
0 commit comments